MCPcopy Create free account
hub / github.com/SOUI2/soui / readInputTestFile

Function readInputTestFile

third-part/jsoncpp/src/jsontestrunner/main.cpp:58–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58static JSONCPP_STRING readInputTestFile(const char* path) {
59 FILE* file = fopen(path, "rb");
60 if (!file)
61 return JSONCPP_STRING("");
62 fseek(file, 0, SEEK_END);
63 long const size = ftell(file);
64 unsigned long const usize = static_cast<unsigned long>(size);
65 fseek(file, 0, SEEK_SET);
66 JSONCPP_STRING text;
67 char* buffer = new char[size + 1];
68 buffer[size] = 0;
69 if (fread(buffer, 1, usize, file) == usize)
70 text = buffer;
71 fclose(file);
72 delete[] buffer;
73 return text;
74}
75
76static void
77printValueTree(FILE* fout, Json::Value& value, const JSONCPP_STRING& path = ".") {

Callers 1

runTestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected