mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
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:
@ -3,3 +3,17 @@
|
||||
// Implement RFC6901 (https://tools.ietf.org/html/rfc6901) JSON Pointer spec.
|
||||
cJSON *cJSONUtils_GetPointer(cJSON *object,const char *pointer);
|
||||
|
||||
// Implement RFC6902 (https://tools.ietf.org/html/rfc6902) JSON Patch spec.
|
||||
//cJSON* cJSONUtils_GeneratePatches(cJSON *from,cJSON *to); // Not yet implemented.
|
||||
int cJSONUtils_ApplyPatches(cJSON *object,cJSON *patches); // Returns 0 for success.
|
||||
|
||||
// Note that ApplyPatches is NOT atomic on failure. To implement an atomic ApplyPatches, use:
|
||||
//int cJSONUtils_AtomicApplyPatches(cJSON **object, cJSON *patches)
|
||||
//{
|
||||
// cJSON *modme=cJSON_Duplicate(*object,1);
|
||||
// int error=cJSONUtils_ApplyPatches(modme,patches);
|
||||
// if (!error) {cJSON_Delete(*object);*object=modme;}
|
||||
// else cJSON_Delete(modme);
|
||||
// return error;
|
||||
//}
|
||||
// Code not added to library since this strategy is a LOT slower.
|
||||
|
Reference in New Issue
Block a user