start of JSON Patch implementation. cJSON gained a cJSON_InsertItemToArray which pushes elements up by one.

This is needed for JSON Patch. Everything but Test is implemented for ApplyPatches.


git-svn-id: svn://svn.code.sf.net/p/cjson/code@65 e3330c51-1366-4df0-8b21-3ccf24e3d50e
This commit is contained in:
Dave Gamble
2015-02-10 14:17:59 +00:00
parent 858671cc7f
commit 3c6b3cc617
5 changed files with 158 additions and 3 deletions

View File

@ -115,6 +115,7 @@ extern cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string);
extern void cJSON_DeleteItemFromObject(cJSON *object,const char *string);
/* Update array items. */
extern void cJSON_InsertItemInArray(cJSON *array,int which,cJSON *newitem); // Shifts pre-existing items to the right.
extern void cJSON_ReplaceItemInArray(cJSON *array,int which,cJSON *newitem);
extern void cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem);