MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / print_cjson

Function print_cjson

src/framework/io/json.cpp:65–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65std::string print_cjson(cJSON * root) {
66 if (root == nullptr) {
67 throw std::runtime_error("cannot print null cJSON root");
68 }
69 char * text = cJSON_PrintUnformatted(root);
70 if (text == nullptr) {
71 throw std::runtime_error("failed to serialize json");
72 }
73 std::string out(text);
74 cJSON_free(text);
75 return out;
76}
77
78std::string strip_jsonc_comments(std::string_view text) {
79 std::string out;

Callers 1

stringifyFunction · 0.85

Calls 2

cJSON_PrintUnformattedFunction · 0.85
cJSON_freeFunction · 0.85

Tested by

no test coverage detected