cJSON.h
Go to the documentation of this file.
46 struct cJSON *next,*prev; /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */
47 struct cJSON *child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */
55 char *string; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */
67 /* Supply a block of JSON, and this returns a cJSON object you can interrogate. Call cJSON_Delete when finished. */
71 /* Render a cJSON entity to text for transfer/storage without any formatting. Free the char* when finished. */
83 /* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */
105 /* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */
121 /* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will
125 /* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */
126 extern cJSON *cJSON_ParseWithOpts(const char *value,const char **return_parse_end,int require_null_terminated);
129 #define cJSON_AddNullToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateNull())
130 #define cJSON_AddTrueToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue())
131 #define cJSON_AddFalseToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateFalse())
132 #define cJSON_AddBoolToObject(object,name,b) cJSON_AddItemToObject(object, name, cJSON_CreateBool(b))
133 #define cJSON_AddNumberToObject(object,name,n) cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n))
134 #define cJSON_AddStringToObject(object,name,s) cJSON_AddItemToObject(object, name, cJSON_CreateString(s))
137 #define cJSON_SetIntValue(object,val) ((object)?(object)->valueint=(object)->valuedouble=(val):(val))
void cJSON_AddItemToArray(cJSON *array, cJSON *item) void cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item) char * cJSON_Print(cJSON *item) Definition: cJSON.h:45 void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item) cJSON * cJSON_CreateIntArray(int *numbers, int count) int cJSON_GetArraySize(cJSON *array) cJSON * cJSON_CreateNumber(double num) cJSON * cJSON_CreateObject(void) Definition: cJSON.h:58 void cJSON_InitHooks(cJSON_Hooks *hooks) cJSON * cJSON_CreateTrue(void) cJSON * cJSON_Parse(const char *value) void cJSON_DeleteItemFromObject(cJSON *object, const char *string) cJSON * cJSON_CreateFalse(void) void cJSON_Delete(cJSON *c) cJSON * cJSON_Duplicate(cJSON *item, int recurse) void cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem) cJSON * cJSON_CreateArray(void) cJSON * cJSON_CreateNull(void) cJSON * cJSON_ParseWithOpts(const char *value, const char **return_parse_end, int require_null_terminated) cJSON * cJSON_CreateFloatArray(float *numbers, int count) void cJSON_ReplaceItemInObject(cJSON *object, const char *string, cJSON *newitem) void cJSON_DeleteItemFromArray(cJSON *array, int which) void cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item) cJSON * cJSON_CreateString(const char *string) const char * cJSON_GetErrorPtr(void) char * cJSON_PrintUnformatted(cJSON *item) cJSON * cJSON_GetObjectItem(cJSON *object, const char *string) struct cJSON_Hooks cJSON_Hooks cJSON * cJSON_CreateBool(int b) cJSON * cJSON_CreateStringArray(const char **strings, int count) cJSON * cJSON_DetachItemFromArray(cJSON *array, int which) cJSON * cJSON_CreateDoubleArray(double *numbers, int count) cJSON * cJSON_GetArrayItem(cJSON *array, int item) cJSON * cJSON_DetachItemFromObject(cJSON *object, const char *string) struct cJSON cJSON |