| 63 | } |
| 64 | |
| 65 | std::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 | |
| 78 | std::string strip_jsonc_comments(std::string_view text) { |
| 79 | std::string out; |
no test coverage detected