Skip to content

Commit dede4e3

Browse files
committed
Add cJSON_ReplaceItemInObjectCaseSensitive
1 parent 8b953d1 commit dede4e3

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

‎cJSON.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1980,6 +1980,11 @@ CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON *object, const char *string,
19801980
cJSON_ReplaceItemViaPointer(object, cJSON_GetObjectItem(object, string), newitem);
19811981
}
19821982

1983+
CJSON_PUBLIC(void) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object, const char *string, cJSON *newitem)
1984+
{
1985+
cJSON_ReplaceItemViaPointer(object, cJSON_GetObjectItemCaseSensitive(object, string), newitem);
1986+
}
1987+
19831988
/* Create basic types: */
19841989
CJSON_PUBLIC(cJSON *) cJSON_CreateNull(void)
19851990
{

‎cJSON.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newit
216216
CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement);
217217
CJSON_PUBLIC(void) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem);
218218
CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem);
219+
CJSON_PUBLIC(void) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object,const char *string,cJSON *newitem);
219220

220221
/* Duplicate a cJSON item */
221222
CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse);

0 commit comments

Comments
 (0)