48 std::ifstream ifs(filename);
50 std::string contents( (std::istreambuf_iterator<char>(ifs) ),
51 (std::istreambuf_iterator<char>() ) );
54 throw std::runtime_error(
"File " + filename +
" does not exist.");
65 found = filename.find_last_of(
"/\\");
66 if(found == filename.npos)
68 return filename.substr(0, found);
std::string GetFileContents(const std::string filename)
Read contents from a file.
std::string GetFilePath(const std::string filename)
Gets file path from filename.