MCPcopy Create free account
hub / github.com/ByConity/ByConity / parse

Method parse

src/DataTypes/Serializations/JSONDataParser.cpp:15–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13
14template <typename ParserImpl>
15std::optional<ParseResult> JSONDataParser<ParserImpl>::parse(const char * begin, size_t length)
16{
17 std::string_view json{begin, length};
18 Element document;
19 if (!parser.parse(json, document))
20 return {};
21
22 ParseContext context;
23 traverse(document, context);
24
25 ParseResult result;
26 result.values = std::move(context.values);
27 result.paths.reserve(context.paths.size());
28
29 for (auto && path : context.paths)
30 result.paths.emplace_back(std::move(path));
31
32 return result;
33}
34
35template <typename ParserImpl>
36void JSONDataParser<ParserImpl>::traverse(const Element & element, ParseContext & ctx)

Callers 6

initAndCheckTaskMethod · 0.45
parseMySQLDDLQueryFunction · 0.45
deserializeTextImplMethod · 0.45
readJSONMethod · 0.45
checkFunction · 0.45

Calls 4

traverseFunction · 0.85
reserveMethod · 0.45
sizeMethod · 0.45
emplace_backMethod · 0.45

Tested by 1

checkFunction · 0.36