MCPcopy Create free account
hub / github.com/Tencent/Hardcoder / cJSON_AddStringToObject

Function cJSON_AddStringToObject

libapp2sys/src/main/cpp/cjson/cJSON.c:2031–2041  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2029}
2030
2031CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string)
2032{
2033 cJSON *string_item = cJSON_CreateString(string);
2034 if (add_item_to_object(object, name, string_item, &global_hooks, false))
2035 {
2036 return string_item;
2037 }
2038
2039 cJSON_Delete(string_item);
2040 return NULL;
2041}
2042
2043CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw)
2044{

Callers 1

checkPermissionMethod · 0.85

Calls 3

cJSON_CreateStringFunction · 0.85
add_item_to_objectFunction · 0.85
cJSON_DeleteFunction · 0.85

Tested by

no test coverage detected