MCPcopy Create free account
hub / github.com/ByConity/ByConity / cJSON_AddNumberToObject

Function cJSON_AddNumberToObject

contrib/cJSON/cJSON.cpp:2027–2037  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2025}
2026
2027CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number)
2028{
2029 cJSON *number_item = cJSON_CreateNumber(number);
2030 if (add_item_to_object(object, name, number_item, &global_hooks, false))
2031 {
2032 return number_item;
2033 }
2034
2035 cJSON_Delete(number_item);
2036 return NULL;
2037}
2038
2039CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string)
2040{

Callers

nothing calls this directly

Calls 3

cJSON_CreateNumberFunction · 0.85
add_item_to_objectFunction · 0.85
cJSON_DeleteFunction · 0.85

Tested by

no test coverage detected