MCPcopy Create free account
hub / github.com/crawl/crawl / json_delete

Function json_delete

crawl-ref/source/json.cc:437–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

435}
436
437void json_delete(JsonNode *node)
438{
439 if (node != nullptr)
440 {
441 json_remove_from_parent(node);
442
443 switch (node->tag)
444 {
445 case JSON_STRING:
446 free(node->string_);
447 break;
448 case JSON_ARRAY:
449 case JSON_OBJECT:
450 {
451 JsonNode *child, *next;
452 for (child = node->children.head; child != nullptr; child = next)
453 {
454 next = child->next;
455 json_delete(child);
456 }
457 break;
458 }
459 default:;
460 }
461
462 free(node);
463 }
464}
465
466bool json_validate(const char *json)
467{

Callers 4

~JsonWrapperMethod · 0.85
json_decodeFunction · 0.85
parse_arrayFunction · 0.85
parse_objectFunction · 0.85

Calls 1

json_remove_from_parentFunction · 0.85

Tested by

no test coverage detected