diff --git a/cJSON.c b/cJSON.c index 94f45b29adc1b3982f9c0b75b87b54e2a550e90d..9e192366162d17ca15e904dfd7f3d3e27c391dd5 100644 --- a/cJSON.c +++ b/cJSON.c @@ -1980,6 +1980,11 @@ CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON *object, const char *string, cJSON_ReplaceItemViaPointer(object, cJSON_GetObjectItem(object, string), newitem); } +CJSON_PUBLIC(void) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object, const char *string, cJSON *newitem) +{ + cJSON_ReplaceItemViaPointer(object, cJSON_GetObjectItemCaseSensitive(object, string), newitem); +} + /* Create basic types: */ CJSON_PUBLIC(cJSON *) cJSON_CreateNull(void) { diff --git a/cJSON.h b/cJSON.h index eec11216156f459d513c04f3d9debf1597dd2202..b990a3ff7f3a7e9043c2b0a8217eee9ad8e49eb7 100644 --- a/cJSON.h +++ b/cJSON.h @@ -216,6 +216,7 @@ CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newit CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement); CJSON_PUBLIC(void) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem); CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem); +CJSON_PUBLIC(void) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object,const char *string,cJSON *newitem); /* Duplicate a cJSON item */ CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse);