MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / handle

Method handle

base/poco/JSON/src/ParserImpl.cpp:54–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52
53
54void ParserImpl::handle(const std::string& json)
55{
56 _currentDepth = 0;
57 if (!_allowNullByte && json.find("\\u0000") != json.npos)
58 throw JSONException("Null bytes in strings not allowed.");
59
60 try
61 {
62 json_open_buffer(_pJSON, json.data(), json.size());
63 checkError();
64 //////////////////////////////////
65 // Underlying parser is capable of parsing multiple consecutive JSONs;
66 // we do not currently support this feature; to force error on
67 // excessive characters past valid JSON end, this MUST be called
68 // AFTER opening the buffer - otherwise it is overwritten by
69 // json_open*() call, which calls internal init()
70 json_set_streaming(_pJSON, false);
71 /////////////////////////////////
72 handle(); checkError();
73 if (JSON_DONE != json_next(_pJSON))
74 throw JSONException("Excess characters found after JSON end.");
75 json_close(_pJSON);
76 }
77 catch (std::exception&)
78 {
79 json_close(_pJSON);
80 throw;
81 }
82}
83
84
85Dynamic::Var ParserImpl::parseImpl(const std::string& json)

Callers

nothing calls this directly

Calls 15

json_open_bufferFunction · 0.85
checkErrorFunction · 0.85
json_set_streamingFunction · 0.85
handleFunction · 0.85
json_nextFunction · 0.85
json_closeFunction · 0.85
json_get_stringFunction · 0.85
json_get_errorFunction · 0.85
findMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
nullMethod · 0.45

Tested by

no test coverage detected