InspIRCd
3.0
|
#include <fileutils.h>
Public Member Functions | |
FileReader () | |
FileReader (const std::string &filename) | |
void | Load (const std::string &filename) |
std::string | GetString () const |
const std::vector< std::string > & | GetVector () const |
unsigned long | TotalSize () const |
Provides an easy method of reading a text file into memory.
|
inline |
Initializes a new file reader.
FileReader::FileReader | ( | const std::string & | filename | ) |
Initializes a new file reader and reads the specified file.
filename | The file to read into memory. |
std::string FileReader::GetString | ( | ) | const |
Retrieves the entire contents of the file cache as a single string.
|
inline |
Retrieves the entire contents of the file cache as a vector of strings.
void FileReader::Load | ( | const std::string & | filename | ) |
Loads a text file from disk.
filename | The file to read into memory. |
CoreException | The file can not be loaded. |
|
inline |
Retrieves the total size in bytes of the file.