MCPcopy Create free account
hub / github.com/Tencent/TAD_Sim / cJSON_AddItemToObject

Function cJSON_AddItemToObject

common/map_sdk/transmission/src/cJSON.cpp:713–718  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

711}
712
713void cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item) {
714 if (!item) return;
715 if (item->string) cJSON_free(item->string);
716 item->string = cJSON_strdup(string);
717 cJSON_AddItemToArray(object, item);
718}
719void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item) { cJSON_AddItemToArray(array, create_reference(item)); }
720void cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item) {
721 cJSON_AddItemToObject(object, string, create_reference(item));

Callers 4

AddEmptySubObjectMethod · 0.85
AddEmptySubArrayMethod · 0.85
AddMethod · 0.85

Calls 2

cJSON_strdupFunction · 0.85
cJSON_AddItemToArrayFunction · 0.85

Tested by

no test coverage detected