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

Function parse_array

src/core/json/sjson.cpp:418–454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

416 }
417
418 void parse_array(JsonArray &arr, const char *json)
419 {
420 if (json == NULL) {
421 fatal("json is NULL");
422 return;
423 }
424
425 if (*json == '[') {
426 json = skip_spaces(++json);
427 if (json == NULL)
428 return;
429
430 if (*json == ']')
431 return;
432
433 while (*json) {
434 array::push_back(arr, json);
435
436 json = skip_value(json);
437 if (json == NULL)
438 return;
439
440 json = skip_spaces(json);
441 if (json == NULL)
442 return;
443
444 if (*json == ']')
445 return;
446
447 json = skip_spaces(json);
448 if (json == NULL)
449 return;
450 }
451 }
452
453 fatal("Bad array");
454 }
455
456 static void parse_root_object(JsonObject &obj, const char *json)
457 {

Callers 5

parse_vector2Function · 0.70
parse_vector3Function · 0.70
parse_vector4Function · 0.70
parse_quaternionFunction · 0.70
parse_matrix4x4Function · 0.70

Calls 3

skip_spacesFunction · 0.85
fatalFunction · 0.70
skip_valueFunction · 0.70

Tested by

no test coverage detected