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

Function cJSON_ReplaceItemInObject

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

Source from the content-addressed store, hash-verified

760 cJSON_Delete(c);
761}
762void cJSON_ReplaceItemInObject(cJSON *object, const char *string, cJSON *newitem) {
763 int i = 0;
764 cJSON *c = object->child;
765 while (c && cJSON_strcasecmp(c->string, string)) i++, c = c->next;
766 if (c) {
767 newitem->string = cJSON_strdup(string);
768 cJSON_ReplaceItemInArray(object, i, newitem);
769 }
770}
771
772/* Create basic types: */
773cJSON *cJSON_CreateNull() {

Callers 1

ReplaceMethod · 0.85

Calls 3

cJSON_strcasecmpFunction · 0.85
cJSON_strdupFunction · 0.85
cJSON_ReplaceItemInArrayFunction · 0.85

Tested by

no test coverage detected