MCPcopy Create free account
hub / github.com/Bwar/CJsonObject / cJSON_ReplaceItemInObject

Function cJSON_ReplaceItemInObject

cJSON.c:954–966  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

952 cJSON_Delete(c);
953}
954void cJSON_ReplaceItemInObject(cJSON *object, const char *string,
955 cJSON *newitem)
956{
957 int i = 0;
958 cJSON *c = object->child;
959 while (c && cJSON_strcasecmp(c->string, string))
960 i++, c = c->next;
961 if (c)
962 {
963 newitem->string = cJSON_strdup(string);
964 cJSON_ReplaceItemInArray(object, i, newitem);
965 }
966}
967
968/* Create basic types: */
969cJSON *cJSON_CreateNull()

Callers 3

ReplaceMethod · 0.85
ReplaceWithMoveMethod · 0.85
ReplaceWithNullMethod · 0.85

Calls 3

cJSON_strcasecmpFunction · 0.85
cJSON_strdupFunction · 0.85
cJSON_ReplaceItemInArrayFunction · 0.85

Tested by

no test coverage detected