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

Function cJSON_CreateBool

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

Source from the content-addressed store, hash-verified

544cJSON *cJSON_CreateTrue() {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_True;return item;}
545cJSON *cJSON_CreateFalse() {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_False;return item;}
546cJSON *cJSON_CreateBool(int b) {cJSON *item=cJSON_New_Item();if(item)item->type=b?cJSON_True:cJSON_False;return item;}
547cJSON *cJSON_CreateNumber(double num) {cJSON *item=cJSON_New_Item();if(item){item->type=cJSON_Number;item->valuedouble=num;item->valueint=static_cast<int>(num);}return item;}
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;}

Callers

nothing calls this directly

Calls 1

cJSON_New_ItemFunction · 0.85

Tested by

no test coverage detected