| 112 | } |
| 113 | |
| 114 | static std::string JsonObject(std::initializer_list<std::pair<std::string, std::string>> fields) { |
| 115 | std::ostringstream out; |
| 116 | out << "{"; |
| 117 | bool first = true; |
| 118 | for (const auto& [key, value] : fields) { |
| 119 | if (!first) out << ","; |
| 120 | out << "\"" << key << "\":" << value; |
| 121 | first = false; |
| 122 | } |
| 123 | out << "}"; |
| 124 | return out.str(); |
| 125 | } |
| 126 | |
| 127 | static std::string JsonString(const std::string& s) { |
| 128 | return "\"" + JsonEscape(s) + "\""; |
no outgoing calls
no test coverage detected