|
Pol
Revision:cb584c9
|
#include <filecont.h>
Public Member Functions | |
| FileContents (const char *filname) | |
| const char * | contents () const |
| void | set_contents (const std::string &str) |
Private Attributes | |
| std::string | contents_ |
Simple class to read a whole file as a char array
Definition at line 12 of file filecont.h.
| Pol::Clib::FileContents::FileContents | ( | const char * | filename | ) |
Creates the instance and reads the whole file content into it
| filename | Full path of the file to be read |
| std::runtime_error | When something goes wrong when reading the file |
Definition at line 23 of file filecont.cpp.
References contents_, and ERROR_PRINT.
| const char * Pol::Clib::FileContents::contents | ( | ) | const |
Returns a pointer to the file content
Definition at line 46 of file filecont.cpp.
References contents_.
Referenced by Pol::Bscript::preprocess_web_script().
| void Pol::Clib::FileContents::set_contents | ( | const std::string & | str | ) |
Replaces the internal content with a copy of the given one
Definition at line 54 of file filecont.cpp.
References contents_.
Referenced by Pol::Bscript::preprocess_web_script().
|
private |
Definition at line 21 of file filecont.h.
Referenced by contents(), FileContents(), and set_contents().