Lines Matching defs:object

198 CJSON_PUBLIC(char *) cJSONUtils_FindPointerFromObjectTo(const cJSON * const object, const cJSON * const target)
203 if ((object == NULL) || (target == NULL))
208 if (object == target)
214 /* recursively search all children of the object or array */
215 for (current_child = object->child; current_child != NULL; (void)(current_child = current_child->next), child_index++)
221 if (cJSON_IsArray(object))
240 if (cJSON_IsObject(object))
301 static cJSON *get_item_from_pointer(cJSON * const object, const char * pointer, const cJSON_bool case_sensitive)
303 cJSON *current_element = object;
348 CJSON_PUBLIC(cJSON *) cJSONUtils_GetPointer(cJSON * const object, const char *pointer)
350 return get_item_from_pointer(object, pointer, false);
353 CJSON_PUBLIC(cJSON *) cJSONUtils_GetPointerCaseSensitive(cJSON * const object, const char *pointer)
355 return get_item_from_pointer(object, pointer, true);
430 static cJSON *detach_path(cJSON *object, const unsigned char *path, const cJSON_bool case_sensitive)
452 parent = get_item_from_pointer(object, (char*)parent_pointer, case_sensitive);
470 /* Couldn't find object to remove child from. */
595 static void sort_object(cJSON * const object, const cJSON_bool case_sensitive)
597 if (object == NULL)
601 object->child = sort_list(object->child, case_sensitive);
678 /* compare object keys */
691 /* object length mismatch (one of both children is not null) */
747 static cJSON *get_object_item(const cJSON * const object, const char* name, const cJSON_bool case_sensitive)
751 return cJSON_GetObjectItemCaseSensitive(object, name);
754 return cJSON_GetObjectItem(object, name);
824 static int apply_patch(cJSON *object, const cJSON *patch, const cJSON_bool case_sensitive)
851 status = !compare_json(get_item_from_pointer(object, path->valuestring, case_sensitive), get_object_item(patch, "value", case_sensitive), case_sensitive);
862 overwrite_item(object, invalid);
886 overwrite_item(object, *value);
893 if (object->string != NULL)
895 cJSON_free(object->string);
896 object->string = NULL;
907 cJSON *old_item = detach_path(object, (unsigned char*)path->valuestring, case_sensitive);
935 value = detach_path(object, (unsigned char*)from->valuestring, case_sensitive);
939 value = get_item_from_pointer(object, from->valuestring, case_sensitive);
988 parent = get_item_from_pointer(object, (char*)parent_pointer, case_sensitive);
994 /* Couldn't find object to add to. */
1035 else /* parent is not an object */
1037 /* Couldn't find object to add to. */
1055 CJSON_PUBLIC(int) cJSONUtils_ApplyPatches(cJSON * const object, const cJSON * const patches)
1073 status = apply_patch(object, current_patch, false);
1084 CJSON_PUBLIC(int) cJSONUtils_ApplyPatchesCaseSensitive(cJSON * const object, const cJSON * const patches)
1102 status = apply_patch(object, current_patch, true);
1241 /* for all object values in the object with more of them */
1260 /* both object keys are the same */
1277 /* object element doesn't exist in 'to' --> remove it */
1284 /* object element doesn't exist in 'from' --> add it */
1328 CJSON_PUBLIC(void) cJSONUtils_SortObject(cJSON * const object)
1330 sort_object(object, false);
1333 CJSON_PUBLIC(void) cJSONUtils_SortObjectCaseSensitive(cJSON * const object)
1335 sort_object(object, true);
1468 /* object key exists in both objects */
1475 /* next key in the object */