#include <OSFileUtil.h>
Public Member Functions | |
FileUtil () | |
the class constructor | |
~FileUtil () | |
the class destructor | |
std::string | getFileAsString (const char *fname) |
read a file and return contents as a string. | |
char * | getFileAsChar (const char *fname) |
read a file and return contents as a char pointer. | |
bool | writeFileFromString (char *fname, std::string thestring) |
write a file from an input string. | |
bool | writeFileFromString (std::string fname, std::string thestring) |
write a file from an input string. | |
bool | writeFileFromChar (char *fname, char *ch) |
write a file from an input char pointer. |
FileUtil
class contains methods for reading and writing files from strings used by many classes in the Optimization Services (OS) framework.
Definition at line 38 of file OSFileUtil.h.
FileUtil::FileUtil | ( | ) |
the class constructor
FileUtil::~FileUtil | ( | ) |
the class destructor
std::string FileUtil::getFileAsString | ( | const char * | fname | ) |
read a file and return contents as a string.
fname | holds the name of the file. |
char* FileUtil::getFileAsChar | ( | const char * | fname | ) |
read a file and return contents as a char pointer.
fname | holds the name of the file. |
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. |
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. |
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. |