MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / cJSON_CreateObject

Function cJSON_CreateObject

outofcore/src/cJSON.cpp:550–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

548cJSON *cJSON_CreateString(const char *string) {cJSON *item=cJSON_New_Item();if(item){item->type=cJSON_String;item->valuestring=cJSON_strdup(string);}return item;}
549cJSON *cJSON_CreateArray() {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_Array;return item;}
550cJSON *cJSON_CreateObject() {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_Object;return item;}
551
552/* Create Arrays: */
553cJSON *cJSON_CreateIntArray(int *numbers,int count) {cJSON *p=nullptr,*a=cJSON_CreateArray();for(int i=0;a && i<count;i++){cJSON *n=cJSON_CreateNumber(numbers[i]);if(!i)a->child=n;else suffix_object(p,n);p=n;}return a;}

Callers 3

cJSON.hFile · 0.85

Calls 1

cJSON_New_ItemFunction · 0.85

Tested by

no test coverage detected