MCPcopy Create free account
hub / github.com/crownengine/crown / parse_bool

Function parse_bool

src/core/json/sjson.cpp:352–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350 }
351
352 bool parse_bool(const char *json)
353 {
354 if (json == NULL) {
355 fatal("json is NULL");
356 return false;
357 }
358
359 switch (*json) {
360 case 't':
361 NEXT_OR_RETURN(json, 't', false);
362 NEXT_OR_RETURN(json, 'r', false);
363 NEXT_OR_RETURN(json, 'u', false);
364 NEXT_OR_RETURN(json, 'e', false);
365 --json;
366 return true;
367
368 case 'f':
369 NEXT_OR_RETURN(json, 'f', false);
370 NEXT_OR_RETURN(json, 'a', false);
371 NEXT_OR_RETURN(json, 'l', false);
372 NEXT_OR_RETURN(json, 's', false);
373 NEXT_OR_RETURN(json, 'e', false);
374 --json;
375 return false;
376
377 default:
378 fatal("Bad boolean");
379 return false;
380 }
381 }
382
383 void parse_string(DynamicString &str, const char *json)
384 {

Callers

nothing calls this directly

Calls 1

fatalFunction · 0.70

Tested by

no test coverage detected