MCPcopy Create free account
hub / github.com/MonaSolutions/MonaServer / ignoreObjectRest

Method ignoreObjectRest

MonaCore/sources/JSONReader.cpp:395–427  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

393
394
395void JSONReader::ignoreObjectRest() {
396 UInt8 c;
397 UInt32 inner(0);
398 while (packet.available() && (inner || (c=packet.read8()) != '}')) {
399
400 // skip string
401 if (c == '"') {
402 while (packet.available() && (c=packet.read8()) != '"') {
403 if (c== '\\') {
404 if (packet.available()==0)
405 break;
406 packet.next();
407 }
408 }
409 if(packet.available()==0) {
410 packet.next(packet.available());
411 ERROR("JSON malformed, marker \" end of text not found");
412 return;
413 }
414 } else if (c == '{' || c == '[') {
415 ++inner;
416 } else if (c == ']' || c == '}') {
417 if (inner == 0) {
418 packet.next(packet.available());
419 ERROR("JSON malformed, marker ", c, " without beginning");
420 return;
421 }
422 --inner;
423 }
424 }
425 if (packet.available()==0)
426 ERROR("JSON malformed, marker } end of object not found");
427}
428
429} // namespace Mona

Callers

nothing calls this directly

Calls 3

read8Method · 0.80
availableMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected