MCPcopy Create free account
hub / github.com/Snapchat/Valdi / correctJsonToValue

Function correctJsonToValue

valdi_core/src/valdi_core/cpp/Utils/ValueUtils.cpp:224–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222}
223
224Result<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
235Result<Value> fastJsonToValue(const std::string_view& str) {
236 JSONReader reader(str);

Callers 2

jsonToValueFunction · 0.85
jsonToValueFunction · 0.85

Calls 4

jsonValueToValueFunction · 0.85
parseMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by 1

jsonToValueFunction · 0.68