| 127 | std::string jsonCompactPrint(Json const& _input) { return jsonPrint(_input, JsonFormat{JsonFormat::Compact}); } |
| 128 | |
| 129 | std::string jsonPrint(Json const& _input, JsonFormat const& _format) |
| 130 | { |
| 131 | // NOTE: -1 here means no new lines (it is also the default setting) |
| 132 | std::string dumped = _input.dump( |
| 133 | /* indent */ (_format.format == JsonFormat::Pretty) ? static_cast<int>(_format.indent) : -1, |
| 134 | /* indent_char */ ' ', |
| 135 | /* ensure_ascii */ true |
| 136 | ); |
| 137 | |
| 138 | return dumped; |
| 139 | } |
| 140 | |
| 141 | bool jsonParseStrict(std::string const& _input, Json& _json, std::string* _errs /* = nullptr */) |
| 142 | { |
no outgoing calls