#include <text_file_loader.h>
Static Public Member Functions | |
static std::string | load (const std::string &FileName) |
load text from filename and save it in string. | |
Private Member Functions | |
TextFileLoader () | |
~TextFileLoader () |
Definition at line 49 of file text_file_loader.h.
gpucalc::auxillary::TextFileLoader::TextFileLoader | ( | ) | [private] |
gpucalc::auxillary::TextFileLoader::~TextFileLoader | ( | ) | [private] |
std::string gpucalc::auxillary::TextFileLoader::load | ( | const std::string & | FileName | ) | [static] |
load text from filename and save it in string.
FileName | - name to loaded file. |
Definition at line 41 of file text_file_loader.cpp.
00042 { 00043 LogManager::getSingleton().logMessage(Object("TextFileLoader", "TextFileLoader"), "Loading \"" + FileName + "\"", LML_Trivial); 00044 std::ifstream ifile(FileName.c_str()); 00045 if (!ifile) 00046 { 00047 Except<ERR_FILE_NOT_FOUND>(Object("TextFileLoader", "TextFileLoader"), "Failed to load \"" + FileName + "\".", "TextFileLoader::Load", __FILE__, __LINE__); 00048 return ""; 00049 } 00050 else 00051 { 00052 std::ostringstream result; 00053 result << ifile.rdbuf(); 00054 return result.str(); 00055 } 00056 }