| 222 | } |
| 223 | |
| 224 | Result<Value> correctJsonToValue(const std::string_view& str) { |
| 225 | Json::Reader reader; |
| 226 | Json::Value root; |
| 227 | if (!reader.parse(str.data(), str.data() + str.size(), root)) { |
| 228 | auto error = reader.getStructuredErrors()[0]; |
| 229 | return TextParser::makeParseError(str, error.message, static_cast<size_t>(error.offset_start)); |
| 230 | } |
| 231 | |
| 232 | return jsonValueToValue(root); |
| 233 | } |
| 234 | |
| 235 | Result<Value> fastJsonToValue(const std::string_view& str) { |
| 236 | JSONReader reader(str); |