From cd4d7b9b6e9fe45fd984f300989758a4ca2786db Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 30 Apr 2017 19:58:00 +0200 Subject: [PATCH] Add cJSONUtils_GetPointerCaseSensitive --- cJSON_Utils.c | 5 +++++ cJSON_Utils.h | 1 + 2 files changed, 6 insertions(+) diff --git a/cJSON_Utils.c b/cJSON_Utils.c index 50950ec..b4dacf3 100644 --- a/cJSON_Utils.c +++ b/cJSON_Utils.c @@ -299,6 +299,11 @@ CJSON_PUBLIC(cJSON *) cJSONUtils_GetPointer(cJSON * const object, const char *po return get_item_from_pointer(object, pointer, false); } +CJSON_PUBLIC(cJSON *) cJSONUtils_GetPointerCaseSensitive(cJSON * const object, const char *pointer) +{ + return get_item_from_pointer(object, pointer, true); +} + /* JSON Patch implementation. */ static void decode_pointer_inplace(unsigned char *string) { diff --git a/cJSON_Utils.h b/cJSON_Utils.h index b20e5db..4ff21f8 100644 --- a/cJSON_Utils.h +++ b/cJSON_Utils.h @@ -24,6 +24,7 @@ /* Implement RFC6901 (https://tools.ietf.org/html/rfc6901) JSON Pointer spec. */ CJSON_PUBLIC(cJSON *) cJSONUtils_GetPointer(cJSON * const object, const char *pointer); +CJSON_PUBLIC(cJSON *) cJSONUtils_GetPointerCaseSensitive(cJSON * const object, const char *pointer); /* 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 */