cJSON.h File Reference
#include <stdlib.h>
Include dependency graph for cJSON.h:

Go to the source code of this file.

Classes

struct  cJSON
 
struct  cJSON_Hooks
 

Macros

#define cJSON_False   0
 
#define cJSON_True   1
 
#define cJSON_NULL   2
 
#define cJSON_Number   3
 
#define cJSON_String   4
 
#define cJSON_Array   5
 
#define cJSON_Object   6
 
#define cJSON_IsReference   256
 
#define cJSON_AddNullToObject(object, name)   cJSON_AddItemToObject(object, name, cJSON_CreateNull())
 
#define cJSON_AddTrueToObject(object, name)   cJSON_AddItemToObject(object, name, cJSON_CreateTrue())
 
#define cJSON_AddFalseToObject(object, name)   cJSON_AddItemToObject(object, name, cJSON_CreateFalse())
 
#define cJSON_AddBoolToObject(object, name, b)   cJSON_AddItemToObject(object, name, cJSON_CreateBool(b))
 
#define cJSON_AddNumberToObject(object, name, n)   cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n))
 
#define cJSON_AddStringToObject(object, name, s)   cJSON_AddItemToObject(object, name, cJSON_CreateString(s))
 
#define cJSON_SetIntValue(object, val)   ((object)?(object)->valueint=(object)->valuedouble=(val):(val))
 

Typedefs

typedef struct cJSON cJSON
 
typedef struct cJSON_Hooks cJSON_Hooks
 

Functions

void cJSON_InitHooks (cJSON_Hooks *hooks)
 
cJSONcJSON_Parse (const char *value)
 
char * cJSON_Print (cJSON *item)
 
char * cJSON_PrintUnformatted (cJSON *item)
 
void cJSON_Delete (cJSON *c)
 
int cJSON_GetArraySize (cJSON *array)
 
cJSONcJSON_GetArrayItem (cJSON *array, int item)
 
cJSONcJSON_GetObjectItem (cJSON *object, const char *string)
 
const char * cJSON_GetErrorPtr (void)
 
cJSONcJSON_CreateNull (void)
 
cJSONcJSON_CreateTrue (void)
 
cJSONcJSON_CreateFalse (void)
 
cJSONcJSON_CreateBool (int b)
 
cJSONcJSON_CreateNumber (double num)
 
cJSONcJSON_CreateString (const char *string)
 
cJSONcJSON_CreateArray (void)
 
cJSONcJSON_CreateObject (void)
 
cJSONcJSON_CreateIntArray (int *numbers, int count)
 
cJSONcJSON_CreateFloatArray (float *numbers, int count)
 
cJSONcJSON_CreateDoubleArray (double *numbers, int count)
 
cJSONcJSON_CreateStringArray (const char **strings, int count)
 
void cJSON_AddItemToArray (cJSON *array, cJSON *item)
 
void cJSON_AddItemToObject (cJSON *object, const char *string, cJSON *item)
 
void cJSON_AddItemReferenceToArray (cJSON *array, cJSON *item)
 
void cJSON_AddItemReferenceToObject (cJSON *object, const char *string, cJSON *item)
 
cJSONcJSON_DetachItemFromArray (cJSON *array, int which)
 
void cJSON_DeleteItemFromArray (cJSON *array, int which)
 
cJSONcJSON_DetachItemFromObject (cJSON *object, const char *string)
 
void cJSON_DeleteItemFromObject (cJSON *object, const char *string)
 
void cJSON_ReplaceItemInArray (cJSON *array, int which, cJSON *newitem)
 
void cJSON_ReplaceItemInObject (cJSON *object, const char *string, cJSON *newitem)
 
cJSONcJSON_Duplicate (cJSON *item, int recurse)
 
cJSONcJSON_ParseWithOpts (const char *value, const char **return_parse_end, int require_null_terminated)
 

Macro Definition Documentation

#define cJSON_AddBoolToObject (   object,
  name,
 
)    cJSON_AddItemToObject(object, name, cJSON_CreateBool(b))
#define cJSON_AddFalseToObject (   object,
  name 
)    cJSON_AddItemToObject(object, name, cJSON_CreateFalse())
#define cJSON_AddNullToObject (   object,
  name 
)    cJSON_AddItemToObject(object, name, cJSON_CreateNull())
#define cJSON_AddNumberToObject (   object,
  name,
 
)    cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n))
#define cJSON_AddStringToObject (   object,
  name,
 
)    cJSON_AddItemToObject(object, name, cJSON_CreateString(s))
#define cJSON_AddTrueToObject (   object,
  name 
)    cJSON_AddItemToObject(object, name, cJSON_CreateTrue())
#define cJSON_Array   5
#define cJSON_False   0
#define cJSON_IsReference   256
#define cJSON_NULL   2
#define cJSON_Number   3
#define cJSON_Object   6
#define cJSON_SetIntValue (   object,
  val 
)    ((object)?(object)->valueint=(object)->valuedouble=(val):(val))
#define cJSON_String   4
#define cJSON_True   1

Typedef Documentation

typedef struct cJSON cJSON
typedef struct cJSON_Hooks cJSON_Hooks

Function Documentation

void cJSON_AddItemReferenceToArray ( cJSON array,
cJSON item 
)
void cJSON_AddItemReferenceToObject ( cJSON object,
const char *  string,
cJSON item 
)
void cJSON_AddItemToArray ( cJSON array,
cJSON item 
)
void cJSON_AddItemToObject ( cJSON object,
const char *  string,
cJSON item 
)
cJSON* cJSON_CreateArray ( void  )
cJSON* cJSON_CreateBool ( int  b)
cJSON* cJSON_CreateDoubleArray ( double *  numbers,
int  count 
)
cJSON* cJSON_CreateFalse ( void  )
cJSON* cJSON_CreateFloatArray ( float *  numbers,
int  count 
)
cJSON* cJSON_CreateIntArray ( int *  numbers,
int  count 
)
cJSON* cJSON_CreateNull ( void  )
cJSON* cJSON_CreateNumber ( double  num)
cJSON* cJSON_CreateObject ( void  )
cJSON* cJSON_CreateString ( const char *  string)
cJSON* cJSON_CreateStringArray ( const char **  strings,
int  count 
)
cJSON* cJSON_CreateTrue ( void  )
void cJSON_Delete ( cJSON c)
void cJSON_DeleteItemFromArray ( cJSON array,
int  which 
)
void cJSON_DeleteItemFromObject ( cJSON object,
const char *  string 
)
cJSON* cJSON_DetachItemFromArray ( cJSON array,
int  which 
)
cJSON* cJSON_DetachItemFromObject ( cJSON object,
const char *  string 
)
cJSON* cJSON_Duplicate ( cJSON item,
int  recurse 
)
cJSON* cJSON_GetArrayItem ( cJSON array,
int  item 
)
int cJSON_GetArraySize ( cJSON array)
const char* cJSON_GetErrorPtr ( void  )
cJSON* cJSON_GetObjectItem ( cJSON object,
const char *  string 
)
void cJSON_InitHooks ( cJSON_Hooks hooks)
cJSON* cJSON_Parse ( const char *  value)
cJSON* cJSON_ParseWithOpts ( const char *  value,
const char **  return_parse_end,
int  require_null_terminated 
)
char* cJSON_Print ( cJSON item)
char* cJSON_PrintUnformatted ( cJSON item)
void cJSON_ReplaceItemInArray ( cJSON array,
int  which,
cJSON newitem 
)
void cJSON_ReplaceItemInObject ( cJSON object,
const char *  string,
cJSON newitem 
)