#include <FileLoader.h>
Definition at line 26 of file FileLoader.h.
◆ FileLoader() [1/2]
foder::FileLoader::FileLoader |
( |
const std::string & |
path | ) |
|
|
inlineexplicit |
◆ FileLoader() [2/2]
foder::FileLoader::FileLoader |
( |
const FileLoader & |
| ) |
|
|
delete |
◆ load()
DataBuffer foder::FileLoader::load |
( |
void |
| ) |
const |
|
inline |
Definition at line 39 of file FileLoader.h.
40 {
41 std::ifstream
file(_path, std::ios::binary | std::ios::in);
43 {
44 std::string errmsg = "Failed to open file: " + _path;
45 throw std::runtime_error(errmsg.c_str());
46 }
47
48 file.unsetf(std::ios::skipws);
49
50 file.seekg(0, std::ios::end);
51 auto fileSize =
file.tellg();
52 file.seekg(0, std::ios::beg);
53
54
55 DataBuffer
data(fileSize);
56
57
60 {
61 std::string errmsg = "Failed to read file: " + _path;
62 throw std::runtime_error(errmsg.c_str());
63 }
64
66 }
Referenced by entry(), crew::read_ini(), and VerifyFlatbuffers::run().
◆ operator=()
The documentation for this class was generated from the following file: