MCPcopy Create free account
hub / github.com/HumbleNet/HumbleNet / loadFile

Function loadFile

src/api_builder/utilities.cpp:16–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14}
15
16std::string loadFile(const std::string& file)
17{
18 std::string ret = "";
19
20 char *buff = nullptr;
21
22 FILE *fp = fopen(file.c_str(), "rb");
23 if (fp) {
24 fseek(fp, 0, SEEK_END);
25 size_t size = ftell(fp);
26 fseek(fp, 0, SEEK_SET);
27 buff = new char[size];
28 if (fread(buff, 1, size, fp) == size) {
29 ret.assign(buff, size);
30 }
31 delete [] buff;
32 fclose(fp);
33 }
34 return ret;
35}
36
37json_value* get_object_key(json_value *root, const std::string& key)
38{

Callers 4

buildLoaderFunction · 0.85
buildCSharpFunction · 0.85
buildExportFunction · 0.85
GameDBFlatFileMethod · 0.85

Calls 1

c_strMethod · 0.80

Tested by

no test coverage detected