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

Method skipArray

base/base/JSON.cpp:322–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

320
321
322JSON::Pos JSON::skipArray() const
323{
324 if (!isArray())
325 throw JSONException("JSON: expected [");
326 Pos pos = ptr_begin;
327 ++pos;
328 checkPos(pos);
329 if (*pos == ']')
330 return ++pos;
331
332 while (true)
333 {
334 pos = JSON(pos, ptr_end, level + 1).skipElement();
335
336 checkPos(pos);
337
338 switch (*pos)
339 {
340 case ',':
341 ++pos;
342 break;
343 case ']':
344 return ++pos;
345 default:
346 throw JSONException(std::string("JSON: expected one of ',]', got ") + *pos);
347 }
348 }
349}
350
351
352JSON::Pos JSON::skipObject() const

Callers

nothing calls this directly

Calls 2

skipElementMethod · 0.80
JSONClass · 0.70

Tested by

no test coverage detected