Detatch and Remove objects from Arrays/Objects.

git-svn-id: http://svn.code.sf.net/p/cjson/code@21 e3330c51-1366-4df0-8b21-3ccf24e3d50e
This commit is contained in:
Dave Gamble
2009-11-25 17:04:05 +00:00
parent 29b085bc5d
commit 79a796aed2
2 changed files with 11 additions and 1 deletions

View File

@ -99,7 +99,12 @@ extern void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item);
// Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON.
extern void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item);
extern void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item);
// Remove/Detatch items from Arrays/Objects.
extern cJSON *cJSON_DetachItemFromArray(cJSON *array,int which);
extern void cJSON_DeleteItemFromArray(cJSON *array,int which);
extern cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string);
extern void cJSON_DeleteItemFromObject(cJSON *object,const char *string);
// Update array items.
extern void cJSON_ReplaceItemInArray(cJSON *array,int which,cJSON *newitem);