json: Add a new function to cJSON.
* src/cJSON.c (cJSON_CreateStringConvey): New.
This commit is contained in:
parent
e14f1f687f
commit
6525d78d0a
12
src/cJSON.c
12
src/cJSON.c
@ -1199,6 +1199,18 @@ cJSON_CreateString (const char *string)
|
||||
return item;
|
||||
}
|
||||
|
||||
cJSON *
|
||||
cJSON_CreateStringConvey (char *string)
|
||||
{
|
||||
cJSON *item = cJSON_New_Item ();
|
||||
if (item)
|
||||
{
|
||||
item->type = cJSON_String;
|
||||
item->valuestring = string;
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
cJSON *
|
||||
cJSON_CreateArray (void)
|
||||
{
|
||||
|
@ -113,6 +113,7 @@ extern cJSON *cJSON_CreateFalse(void);
|
||||
extern cJSON *cJSON_CreateBool(int b);
|
||||
extern cJSON *cJSON_CreateNumber(double num);
|
||||
extern cJSON *cJSON_CreateString(const char *string);
|
||||
extern cJSON *cJSON_CreateStringConvey (char *string);
|
||||
extern cJSON *cJSON_CreateArray(void);
|
||||
extern cJSON *cJSON_CreateObject(void);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user