class used to make it easy to read and write files. More...
#include <OSFileUtil.h>
Public Member Functions | |
FileUtil () | |
the class constructor More... | |
~FileUtil () | |
the class destructor More... | |
std::string | getFileAsString (const char *fname) |
read a file and return contents as a string. More... | |
char * | getFileAsChar (const char *fname) |
read a file and return contents as a char pointer. More... | |
bool | writeFileFromString (char *fname, std::string thestring) |
write a file from an input string. More... | |
bool | writeFileFromString (std::string fname, std::string thestring) |
write a file from an input string. More... | |
bool | writeFileFromChar (char *fname, char *ch) |
write a file from an input char pointer. More... | |
class used to make it easy to read and write files.
The FileUtil
class contains methods for reading and writing files from strings used by many classes in the Optimization Services (OS) framework.
Definition at line 37 of file OSFileUtil.h.
FileUtil::FileUtil | ( | ) |
the class constructor
Definition at line 26 of file OSFileUtil.cpp.
FileUtil::~FileUtil | ( | ) |
the class destructor
Definition at line 31 of file OSFileUtil.cpp.
std::string FileUtil::getFileAsString | ( | const char * | fname | ) |
read a file and return contents as a string.
fname | holds the name of the file. |
Definition at line 35 of file OSFileUtil.cpp.
char * FileUtil::getFileAsChar | ( | const char * | fname | ) |
read a file and return contents as a char pointer.
fname | holds the name of the file. |
Definition at line 70 of file OSFileUtil.cpp.
bool FileUtil::writeFileFromString | ( | char * | fname, |
std::string | thestring | ||
) |
write a file from an input string.
fname | holds the name of the file to be written. |
thestring | holds the string to be written to the file. |
Definition at line 116 of file OSFileUtil.cpp.
bool FileUtil::writeFileFromString | ( | std::string | fname, |
std::string | thestring | ||
) |
write a file from an input string.
fname | holds the name of the file to be written. |
thestring | holds the string to be written to the file. |
Definition at line 148 of file OSFileUtil.cpp.
bool FileUtil::writeFileFromChar | ( | char * | fname, |
char * | ch | ||
) |
write a file from an input char pointer.
fname | holds the name of the file to be written. |
ch | holds a pointer to a char array to be written to the file. |
Definition at line 180 of file OSFileUtil.cpp.