Lines Matching refs:object
322 CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number) in cJSON_SetNumberHelper() argument
325 object->valueint = INT_MAX; in cJSON_SetNumberHelper()
327 object->valueint = INT_MIN; in cJSON_SetNumberHelper()
329 object->valueint = (int)number; in cJSON_SetNumberHelper()
332 return object->valuedouble = number; in cJSON_SetNumberHelper()
335 CJSON_PUBLIC(char *) cJSON_SetValuestring(cJSON *object, const char *valuestring) in cJSON_SetValuestring() argument
339 if (!(object->type & cJSON_String) || (object->type & cJSON_IsReference)) return NULL; in cJSON_SetValuestring()
340 if (strlen(valuestring) <= strlen(object->valuestring)) { in cJSON_SetValuestring()
341 strcpy(object->valuestring, valuestring); in cJSON_SetValuestring()
342 return object->valuestring; in cJSON_SetValuestring()
346 if (object->valuestring != NULL) cJSON_free(object->valuestring); in cJSON_SetValuestring()
347 object->valuestring = copy; in cJSON_SetValuestring()
1445 static cJSON *get_object_item(const cJSON *const object, const char *const name, const cJSON_bool c… in get_object_item() argument
1449 if ((object == NULL) || (name == NULL)) return NULL; in get_object_item()
1451 current_element = object->child; in get_object_item()
1463 CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON *const object, const char *const string) in cJSON_GetObjectItem() argument
1465 return get_object_item(object, string, false); in cJSON_GetObjectItem()
1468 CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON *const object, const char *const… in cJSON_GetObjectItemCaseSensitive() argument
1470 return get_object_item(object, string, true); in cJSON_GetObjectItemCaseSensitive()
1473 CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *string) in cJSON_HasObjectItem() argument
1475 return cJSON_GetObjectItem(object, string) ? 1 : 0; in cJSON_HasObjectItem()
1548 static cJSON_bool add_item_to_object(cJSON *const object, const char *const string, cJSON *const it… in add_item_to_object() argument
1553 if ((object == NULL) || (string == NULL) || (item == NULL) || (object == item)) return false; in add_item_to_object()
1570 return add_item_to_array(object, item); in add_item_to_object()
1573 CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item) in cJSON_AddItemToObject() argument
1575 return add_item_to_object(object, string, item, &global_hooks, false); in cJSON_AddItemToObject()
1579 CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item) in cJSON_AddItemToObjectCS() argument
1581 return add_item_to_object(object, string, item, &global_hooks, true); in cJSON_AddItemToObjectCS()
1591 CJSON_PUBLIC(cJSON_bool) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *i… in cJSON_AddItemReferenceToObject() argument
1593 if ((object == NULL) || (string == NULL)) return false; in cJSON_AddItemReferenceToObject()
1595 …return add_item_to_object(object, string, create_reference(item, &global_hooks), &global_hooks, fa… in cJSON_AddItemReferenceToObject()
1598 CJSON_PUBLIC(cJSON *) cJSON_AddNullToObject(cJSON *const object, const char *const name) in cJSON_AddNullToObject() argument
1601 if (add_item_to_object(object, name, null, &global_hooks, false)) return null; in cJSON_AddNullToObject()
1607 CJSON_PUBLIC(cJSON *) cJSON_AddTrueToObject(cJSON *const object, const char *const name) in cJSON_AddTrueToObject() argument
1610 if (add_item_to_object(object, name, true_item, &global_hooks, false)) return true_item; in cJSON_AddTrueToObject()
1616 CJSON_PUBLIC(cJSON *) cJSON_AddFalseToObject(cJSON *const object, const char *const name) in cJSON_AddFalseToObject() argument
1619 if (add_item_to_object(object, name, false_item, &global_hooks, false)) return false_item; in cJSON_AddFalseToObject()
1625 CJSON_PUBLIC(cJSON *) cJSON_AddBoolToObject(cJSON *const object, const char *const name, const cJSO… in cJSON_AddBoolToObject() argument
1628 if (add_item_to_object(object, name, bool_item, &global_hooks, false)) return bool_item; in cJSON_AddBoolToObject()
1634 CJSON_PUBLIC(cJSON *) cJSON_AddNumberToObject(cJSON *const object, const char *const name, const do… in cJSON_AddNumberToObject() argument
1637 if (add_item_to_object(object, name, number_item, &global_hooks, false)) return number_item; in cJSON_AddNumberToObject()
1643 CJSON_PUBLIC(cJSON *) cJSON_AddStringToObject(cJSON *const object, const char *const name, const ch… in cJSON_AddStringToObject() argument
1646 if (add_item_to_object(object, name, string_item, &global_hooks, false)) return string_item; in cJSON_AddStringToObject()
1652 CJSON_PUBLIC(cJSON *) cJSON_AddRawToObject(cJSON *const object, const char *const name, const char … in cJSON_AddRawToObject() argument
1655 if (add_item_to_object(object, name, raw_item, &global_hooks, false)) return raw_item; in cJSON_AddRawToObject()
1661 CJSON_PUBLIC(cJSON *) cJSON_AddObjectToObject(cJSON *const object, const char *const name) in cJSON_AddObjectToObject() argument
1664 if (add_item_to_object(object, name, object_item, &global_hooks, false)) return object_item; in cJSON_AddObjectToObject()
1670 CJSON_PUBLIC(cJSON *) cJSON_AddArrayToObject(cJSON *const object, const char *const name) in cJSON_AddArrayToObject() argument
1673 if (add_item_to_object(object, name, array, &global_hooks, false)) return array; in cJSON_AddArrayToObject()
1719 CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string) in cJSON_DetachItemFromObject() argument
1721 cJSON *to_detach = cJSON_GetObjectItem(object, string); in cJSON_DetachItemFromObject()
1723 return cJSON_DetachItemViaPointer(object, to_detach); in cJSON_DetachItemFromObject()
1726 CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string) in cJSON_DetachItemFromObjectCaseSensitive() argument
1728 cJSON *to_detach = cJSON_GetObjectItemCaseSensitive(object, string); in cJSON_DetachItemFromObjectCaseSensitive()
1730 return cJSON_DetachItemViaPointer(object, to_detach); in cJSON_DetachItemFromObjectCaseSensitive()
1733 CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string) in cJSON_DeleteItemFromObject() argument
1735 cJSON_Delete(cJSON_DetachItemFromObject(object, string)); in cJSON_DeleteItemFromObject()
1738 CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string) in cJSON_DeleteItemFromObjectCaseSensitive() argument
1740 cJSON_Delete(cJSON_DetachItemFromObjectCaseSensitive(object, string)); in cJSON_DeleteItemFromObjectCaseSensitive()
1799 static cJSON_bool replace_item_in_object(cJSON *object, const char *string, cJSON *replacement, cJS… in replace_item_in_object() argument
1810 …return cJSON_ReplaceItemViaPointer(object, get_object_item(object, string, case_sensitive), replac… in replace_item_in_object()
1813 CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInObject(cJSON *object, const char *string, cJSON *newite… in cJSON_ReplaceItemInObject() argument
1815 return replace_item_in_object(object, string, newitem, false); in cJSON_ReplaceItemInObject()
1818 CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object, const char *string, … in cJSON_ReplaceItemInObjectCaseSensitive() argument
1820 return replace_item_in_object(object, string, newitem, true); in cJSON_ReplaceItemInObjectCaseSensitive()
2378 CJSON_PUBLIC(void) cJSON_free(void *object) in cJSON_free() argument
2380 global_hooks.deallocate(object); in cJSON_free()