MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / cJSON_ReplaceItemInObject

Function cJSON_ReplaceItemInObject

outofcore/src/cJSON.cpp:540–540  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

538 newitem->next=c->next;newitem->prev=c->prev;if (newitem->next) newitem->next->prev=newitem;
539 if (c==array->child) array->child=newitem; else newitem->prev->next=newitem;c->next=c->prev=nullptr;cJSON_Delete(c);}
540void cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem){int i=0;cJSON *c=object->child;while(c && cJSON_strcasecmp(c->string,string))i++,c=c->next;if(c){newitem->string=cJSON_strdup(string);cJSON_ReplaceItemInArray(object,i,newitem);}}
541
542/* Create basic types: */
543cJSON *cJSON_CreateNull() {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_NULL;return item;}

Callers

nothing calls this directly

Calls 3

cJSON_strcasecmpFunction · 0.85
cJSON_strdupFunction · 0.85
cJSON_ReplaceItemInArrayFunction · 0.85

Tested by

no test coverage detected