mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
refactor cJSONUtils_GeneratePatches
This commit is contained in:
parent
a67c24c451
commit
f030058183
@ -1021,7 +1021,7 @@ static void cJSONUtils_CompareToPatch(cJSON * const patches, const unsigned char
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CJSON_PUBLIC(cJSON *) cJSONUtils_GeneratePatches(cJSON *from, cJSON *to)
|
CJSON_PUBLIC(cJSON *) cJSONUtils_GeneratePatches(cJSON * const from, cJSON * const to)
|
||||||
{
|
{
|
||||||
cJSON *patches = cJSON_CreateArray();
|
cJSON *patches = cJSON_CreateArray();
|
||||||
cJSONUtils_CompareToPatch(patches, (const unsigned char*)"", from, to);
|
cJSONUtils_CompareToPatch(patches, (const unsigned char*)"", from, to);
|
||||||
|
@ -26,7 +26,8 @@
|
|||||||
CJSON_PUBLIC(cJSON *) cJSONUtils_GetPointer(cJSON * const object, const char *pointer);
|
CJSON_PUBLIC(cJSON *) cJSONUtils_GetPointer(cJSON * const object, const char *pointer);
|
||||||
|
|
||||||
/* Implement RFC6902 (https://tools.ietf.org/html/rfc6902) JSON Patch spec. */
|
/* Implement RFC6902 (https://tools.ietf.org/html/rfc6902) JSON Patch spec. */
|
||||||
CJSON_PUBLIC(cJSON *) cJSONUtils_GeneratePatches(cJSON *from, cJSON *to);
|
/* NOTE: This modifies objects in 'from' and 'to' by sorting the elements by their key */
|
||||||
|
CJSON_PUBLIC(cJSON *) cJSONUtils_GeneratePatches(cJSON * const from, cJSON * const to);
|
||||||
/* Utility for generating patch array entries. */
|
/* Utility for generating patch array entries. */
|
||||||
CJSON_PUBLIC(void) cJSONUtils_AddPatchToArray(cJSON * const array, const char * const operation, const char * const path, const cJSON * const value);
|
CJSON_PUBLIC(void) cJSONUtils_AddPatchToArray(cJSON * const array, const char * const operation, const char * const path, const cJSON * const value);
|
||||||
/* Returns 0 for success. */
|
/* Returns 0 for success. */
|
||||||
|
Loading…
Reference in New Issue
Block a user