MCPcopy Create free account
hub / github.com/arangodb/velocypack / readFile

Function readFile

tests/testsFiles.cpp:51–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51static std::string readFile(std::string filename) {
52#ifdef _WIN32
53 std::string const separator("\\");
54#else
55 std::string const separator("/");
56#endif
57 filename = "tests" + separator + "jsonSample" + separator + filename;
58
59 for (std::size_t i = 0; i < 3; ++i) {
60 try {
61 return tryReadFile(filename);
62 } catch (...) {
63 filename = ".." + separator + filename;
64 }
65 }
66 throw "cannot open input file";
67}
68
69static bool parseFile(std::string const& filename) {
70 std::string const data = readFile(filename);

Callers 1

parseFileFunction · 0.70

Calls 1

tryReadFileFunction · 0.70

Tested by

no test coverage detected