mirror of
https://github.com/DaveGamble/cJSON.git
synced 2026-11-07 16:01:33 +00:00
Add cJSON_DetachItemFromObjectCaseSensitive
This commit is contained in:
1 parent
33193ea557
commit
8816a568ab
2 files changed
+10
-6
No files matched your search
@@ -1878,13 +1878,16 @@ CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which)
|
|||||||
|
|
||||||
CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string)
|
CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string)
|
||||||
{
|
{
|
||||||
cJSON *c = object->child;
|
cJSON *to_detach = cJSON_GetObjectItem(object, string);
|
||||||
while (c && (case_insensitive_strcmp((unsigned char*)c->string, (const unsigned char*)string) != 0))
|
|
||||||
{
|
|
||||||
c = c->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
return cJSON_DetachItemViaPointer(object, c);
|
return cJSON_DetachItemViaPointer(object, to_detach);
|
||||||
|
}
|
||||||
|
|
||||||
|
CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string)
|
||||||
|
{
|
||||||
|
cJSON *to_detach = cJSON_GetObjectItemCaseSensitive(object, string);
|
||||||
|
|
||||||
|
return cJSON_DetachItemViaPointer(object, to_detach);
|
||||||
}
|
}
|
||||||
|
|
||||||
CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string)
|
CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string)
|
||||||
|
|||||||
@@ -207,6 +207,7 @@ CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const it
|
|||||||
CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which);
|
CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which);
|
||||||
CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which);
|
CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which);
|
||||||
CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string);
|
CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string);
|
||||||
|
CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string);
|
||||||
CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string);
|
CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string);
|
||||||
|
|
||||||
/* Update array items. */
|
/* Update array items. */
|
||||||
|
|||||||
Reference in new issue
Block a user