mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
Add cJSONUtils_GeneratePatchesCaseSensitive
This commit is contained in:
parent
cd4d7b9b6e
commit
3bf2913634
@ -1059,6 +1059,14 @@ CJSON_PUBLIC(cJSON *) cJSONUtils_GeneratePatches(cJSON * const from, cJSON * con
|
|||||||
return patches;
|
return patches;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CJSON_PUBLIC(cJSON *) cJSONUtils_GeneratePatchesCaseSensitive(cJSON * const from, cJSON * const to)
|
||||||
|
{
|
||||||
|
cJSON *patches = cJSON_CreateArray();
|
||||||
|
create_patches(patches, (const unsigned char*)"", from, to, true);
|
||||||
|
|
||||||
|
return patches;
|
||||||
|
}
|
||||||
|
|
||||||
/* sort lists using mergesort */
|
/* sort lists using mergesort */
|
||||||
static cJSON *sort_list(cJSON *list, const cJSON_bool case_sensitive)
|
static cJSON *sort_list(cJSON *list, const cJSON_bool case_sensitive)
|
||||||
{
|
{
|
||||||
|
@ -29,6 +29,7 @@ CJSON_PUBLIC(cJSON *) cJSONUtils_GetPointerCaseSensitive(cJSON * const object, c
|
|||||||
/* Implement RFC6902 (https://tools.ietf.org/html/rfc6902) JSON Patch spec. */
|
/* Implement RFC6902 (https://tools.ietf.org/html/rfc6902) JSON Patch spec. */
|
||||||
/* NOTE: This modifies objects in 'from' and 'to' by sorting the elements by their key */
|
/* 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);
|
CJSON_PUBLIC(cJSON *) cJSONUtils_GeneratePatches(cJSON * const from, cJSON * const to);
|
||||||
|
CJSON_PUBLIC(cJSON *) cJSONUtils_GeneratePatchesCaseSensitive(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