MCPcopy Create free account
hub / github.com/Tencent/rapidjson / Open

Method Open

test/unittest/encodedstreamtest.cpp:44–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42
43protected:
44 static FILE* Open(const char* filename) {
45 const char *paths[] = {
46 "encodings",
47 "bin/encodings",
48 "../bin/encodings",
49 "../../bin/encodings",
50 "../../../bin/encodings"
51 };
52 char buffer[1024];
53 for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
54 sprintf(buffer, "%s/%s", paths[i], filename);
55 FILE *fp = fopen(buffer, "rb");
56 if (fp)
57 return fp;
58 }
59 return 0;
60 }
61
62 static char *ReadFile(const char* filename, bool appendPath, size_t* outLength) {
63 FILE *fp = appendPath ? Open(filename) : fopen(filename, "rb");

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected