MCPcopy Create free account
hub / github.com/chigraph/chigraph / dump

Method dump

libchigraph/src/Result.cpp:60–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60std::string Result::dump() const {
61 std::string ret;
62 if (result_json.size() != 0) {
63 for (auto error : result_json) {
64 if (error.find("errorcode") == error.end() || !error["errorcode"].is_string() ||
65 error.find("overview") == error.end() || !error["overview"].is_string()) {
66 return "";
67 }
68 std::string ec = error["errorcode"];
69 std::string desc = error["overview"];
70 ret += ec + ": " + desc + "\n";
71 // recursively display children
72 auto& data = error["data"];
73 ret += prettyPrintJson(data, 1);
74 }
75 }
76 return ret;
77}
78
79int Result::addContext(const nlohmann::json& data) {
80 static int ctxId = 0;

Callers 8

DebuggerTests.cppFile · 0.45
FetchTests.cppFile · 0.45
areArrayEqualUnorderedFunction · 0.45
areJsonEqualFunction · 0.45
mainFunction · 0.45
prettyPrintJsonFunction · 0.45
saveToDiskMethod · 0.45
runFunction · 0.45

Calls 3

prettyPrintJsonFunction · 0.85
endMethod · 0.80
is_stringMethod · 0.80

Tested by 3

areArrayEqualUnorderedFunction · 0.36
areJsonEqualFunction · 0.36
mainFunction · 0.36