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

Method jumpToString

MonaCore/sources/JSONReader.cpp:293–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291}
292
293const char* JSONReader::jumpToString(UInt32& size) {
294 if (!jumpTo('"'))
295 return NULL;
296 const UInt8* cur(packet.current()+1);
297 const UInt8* end(cur+packet.available()-1);
298 size = 0;
299 while (cur<end && *cur != '"') {
300 if (*cur== '\\') {
301 ++size;
302 if (++cur == end)
303 break;
304 }
305 ++size;
306 ++cur;
307 }
308 if(cur==end) {
309 packet.next(packet.available());
310 ERROR("JSON malformed, marker \" end of text not found");
311 return NULL;
312 }
313 return (const char*)packet.current() + 1;
314}
315
316bool JSONReader::jumpTo(char marker) {
317 const UInt8* cur(current());

Callers

nothing calls this directly

Calls 3

availableMethod · 0.45
nextMethod · 0.45
currentMethod · 0.45

Tested by

no test coverage detected