Functions | |
void | cy_p64_cJSON_InitHooks (cy_p64_cJSON_Hooks *hooks) |
This function supply malloc and free functions to cy_p64_cJSON. More... | |
cy_p64_cJSON * | cy_p64_cJSON_Parse (const char *value) |
Supplies a block of JSON, and this returns a cy_p64_cJSON object you can interrogate. More... | |
char * | cy_p64_cJSON_Print (const cy_p64_cJSON *item) |
Renders a cy_p64_cJSON entity to text for transfer/storage. More... | |
char * | cy_p64_cJSON_PrintUnformatted (const cy_p64_cJSON *item) |
Renders a cy_p64_cJSON entity to text for transfer/storage without any formatting. More... | |
char * | cy_p64_cJSON_PrintBuffered (const cy_p64_cJSON *item, int prebuffer, int fmt) |
Renders a cy_p64_cJSON entity to text using a buffered strategy. More... | |
int | cy_p64_cJSON_PrintPreallocated (cy_p64_cJSON *item, char *buf, const int len, const int fmt) |
Renders a cy_p64_cJSON entity to text using a buffer already allocated in memory with length len. More... | |
void | cy_p64_cJSON_Delete (cy_p64_cJSON *c) |
Deletes a cy_p64_cJSON entity and all sub-entities. More... | |
int | cy_p64_cJSON_GetArraySize (const cy_p64_cJSON *array) |
Returns the number of items in an array (or object). More... | |
cy_p64_cJSON * | cy_p64_cJSON_GetArrayItem (const cy_p64_cJSON *array, int item) |
This function retrieves item number "item" from array "array". More... | |
cy_p64_cJSON * | cy_p64_cJSON_GetObjectItem (const cy_p64_cJSON *object, const char *string) |
Gets item "string" from the object. More... | |
int | cy_p64_cJSON_HasObjectItem (const cy_p64_cJSON *object, const char *string) |
Returns "true" if it possible to get an item from the object. More... | |
const char * | cy_p64_cJSON_GetErrorPtr (void) |
Analyses failed parses. More... | |
cy_p64_cJSON * | cy_p64_cJSON_CreateNull (void) |
Creates a cy_p64_cJSON item of the "null" type. More... | |
cy_p64_cJSON * | cy_p64_cJSON_CreateTrue (void) |
Creates a cy_p64_cJSON item of the "true" type. More... | |
cy_p64_cJSON * | cy_p64_cJSON_CreateFalse (void) |
Creates a cy_p64_cJSON item of the "false" type. More... | |
cy_p64_cJSON * | cy_p64_cJSON_CreateBool (int b) |
Creates a cy_p64_cJSON item of the "bool" type. More... | |
cy_p64_cJSON * | cy_p64_cJSON_CreateNumber (uint32_t num) |
This function create a cy_p64_cJSON item of the uint type. More... | |
cy_p64_cJSON * | cy_p64_cJSON_CreateString (const char *string) |
Creates a cy_p64_cJSON item of the "string" type. More... | |
cy_p64_cJSON * | cy_p64_cJSON_CreateRaw (const char *raw) |
Creates a cy_p64_cJSON item of the "raw" type. More... | |
cy_p64_cJSON * | cy_p64_cJSON_CreateArray (void) |
Creates a cy_p64_cJSON item of the raw "Array" type. More... | |
cy_p64_cJSON * | cy_p64_cJSON_CreateObject (void) |
Creates a cy_p64_cJSON item of the "object" type. More... | |
cy_p64_cJSON * | cy_p64_cJSON_CreateIntArray (const int *numbers, int count) |
Creates an array of count items. More... | |
cy_p64_cJSON * | cy_p64_cJSON_CreateStringArray (const char **strings, int count) |
Creates an array of string items. More... | |
void | cy_p64_cJSON_AddItemToArray (cy_p64_cJSON *array, cy_p64_cJSON *item) |
Appends an item to the specified array. More... | |
void | cy_p64_cJSON_AddItemToObject (cy_p64_cJSON *object, const char *string, cy_p64_cJSON *item) |
Appends an item to the specified object. More... | |
void | cy_p64_cJSON_AddItemToObjectCS (cy_p64_cJSON *object, const char *string, cy_p64_cJSON *item) |
Use this function when string is definitely const (i.e. More... | |
void | cy_p64_cJSON_AddItemReferenceToArray (cy_p64_cJSON *array, cy_p64_cJSON *item) |
Appends reference to an item to the specified array. More... | |
void | cy_p64_cJSON_AddItemReferenceToObject (cy_p64_cJSON *object, const char *string, cy_p64_cJSON *item) |
This function append reference to item to the specified object. More... | |
cy_p64_cJSON * | cy_p64_cJSON_DetachItemFromArray (cy_p64_cJSON *array, int which) |
Detaches items from an array. More... | |
void | cy_p64_cJSON_DeleteItemFromArray (cy_p64_cJSON *array, int which) |
Removes items from an array. More... | |
cy_p64_cJSON * | cy_p64_cJSON_DetachItemFromObject (cy_p64_cJSON *object, const char *string) |
Detaches items from an object. More... | |
void | cy_p64_cJSON_DeleteItemFromObject (cy_p64_cJSON *object, const char *string) |
Removes items from an object. More... | |
void | cy_p64_cJSON_InsertItemInArray (cy_p64_cJSON *array, int which, cy_p64_cJSON *newitem) |
Inserts items in an array. More... | |
void | cy_p64_cJSON_ReplaceItemInArray (cy_p64_cJSON *array, int which, cy_p64_cJSON *newitem) |
Replaces items in an array. More... | |
void | cy_p64_cJSON_ReplaceItemInObject (cy_p64_cJSON *object, const char *string, cy_p64_cJSON *newitem) |
Replaces items in an object. More... | |
cy_p64_cJSON * | cy_p64_cJSON_Duplicate (const cy_p64_cJSON *item, int recurse) |
Duplicates a cy_p64_cJSON item. More... | |
cy_p64_cJSON * | cy_p64_cJSON_ParseWithOpts (const char *value, const char **return_parse_end, int require_null_terminated) |
Allows you to require (and check) that the JSON is null- terminated, and to retrieve the pointer to the final byte parsed. More... | |
void | cy_p64_cJSON_Minify (char *json) |
Removes not required characters from a string like whitespace characters. More... | |
void cy_p64_cJSON_InitHooks | ( | cy_p64_cJSON_Hooks * | hooks | ) |
This function supply malloc and free functions to cy_p64_cJSON.
hooks | The pointer to the structure with alternative malloc and free functions. |
cy_p64_cJSON* cy_p64_cJSON_Parse | ( | const char * | value | ) |
Supplies a block of JSON, and this returns a cy_p64_cJSON object you can interrogate.
Call cy_p64_cJSON_Delete() when finished.
value | The pointer to a block of JSON. |
char* cy_p64_cJSON_Print | ( | const cy_p64_cJSON * | item | ) |
Renders a cy_p64_cJSON entity to text for transfer/storage.
Free the char* when finished.
item | The pointer to the cy_p64_cJSON object |
char* cy_p64_cJSON_PrintUnformatted | ( | const cy_p64_cJSON * | item | ) |
Renders a cy_p64_cJSON entity to text for transfer/storage without any formatting.
Free the char* when finished.
item | The pointer to the cy_p64_cJSON object. |
char* cy_p64_cJSON_PrintBuffered | ( | const cy_p64_cJSON * | item, |
int | prebuffer, | ||
int | fmt | ||
) |
Renders a cy_p64_cJSON entity to text using a buffered strategy.
item | The pointer to the cy_p64_cJSON object. |
prebuffer | Guess at the final size. Guessing well reduces the reallocation. |
fmt | 0 gives unformatted, 1 gives formatted. |
int cy_p64_cJSON_PrintPreallocated | ( | cy_p64_cJSON * | item, |
char * | buf, | ||
const int | len, | ||
const int | fmt | ||
) |
Renders a cy_p64_cJSON entity to text using a buffer already allocated in memory with length len.
Returns 1 on success and 0 on a failure.
item | The pointer to the cy_p64_cJSON object. |
buf | The pointer to the allocated buffer. |
len | The buffer length. |
fmt | 0 gives unformatted, 1 gives formatted. |
void cy_p64_cJSON_Delete | ( | cy_p64_cJSON * | c | ) |
Deletes a cy_p64_cJSON entity and all sub-entities.
c | The pointer to the cy_p64_cJSON object. |
int cy_p64_cJSON_GetArraySize | ( | const cy_p64_cJSON * | array | ) |
Returns the number of items in an array (or object).
array | The pointer to the cy_p64_cJSON object |
cy_p64_cJSON* cy_p64_cJSON_GetArrayItem | ( | const cy_p64_cJSON * | array, |
int | item | ||
) |
This function retrieves item number "item" from array "array".
Returns NULL if fails.
array | The pointer to the cy_p64_cJSON object. |
item | The item number. |
cy_p64_cJSON* cy_p64_cJSON_GetObjectItem | ( | const cy_p64_cJSON * | object, |
const char * | string | ||
) |
Gets item "string" from the object.
Case-insensitive.
object | The pointer to the cy_p64_cJSON object. |
string | The pointer to the string to find. |
int cy_p64_cJSON_HasObjectItem | ( | const cy_p64_cJSON * | object, |
const char * | string | ||
) |
Returns "true" if it possible to get an item from the object.
Case-insensitive.
object | The pointer to the cy_p64_cJSON object. |
string | The pointer to the string to find. |
const char* cy_p64_cJSON_GetErrorPtr | ( | void | ) |
Analyses failed parses.
This returns a pointer to the parse error. Look a few chars back if you need to understand. Defined when cy_p64_cJSON_Parse() returns 0. 0 when cy_p64_cJSON_Parse() succeeds.
cy_p64_cJSON* cy_p64_cJSON_CreateNull | ( | void | ) |
Creates a cy_p64_cJSON item of the "null" type.
cy_p64_cJSON* cy_p64_cJSON_CreateTrue | ( | void | ) |
Creates a cy_p64_cJSON item of the "true" type.
cy_p64_cJSON* cy_p64_cJSON_CreateFalse | ( | void | ) |
Creates a cy_p64_cJSON item of the "false" type.
cy_p64_cJSON* cy_p64_cJSON_CreateBool | ( | int | b | ) |
Creates a cy_p64_cJSON item of the "bool" type.
b | The value for This function ccreated cy_p64_cJSON object. |
cy_p64_cJSON* cy_p64_cJSON_CreateNumber | ( | uint32_t | num | ) |
This function create a cy_p64_cJSON item of the uint type.
num | The value for the created cy_p64_cJSON object. |
cy_p64_cJSON* cy_p64_cJSON_CreateString | ( | const char * | string | ) |
Creates a cy_p64_cJSON item of the "string" type.
string | The value for the created cy_p64_cJSON object. |
cy_p64_cJSON* cy_p64_cJSON_CreateRaw | ( | const char * | raw | ) |
Creates a cy_p64_cJSON item of the "raw" type.
raw | The value for the created cy_p64_cJSON object. |
cy_p64_cJSON* cy_p64_cJSON_CreateArray | ( | void | ) |
Creates a cy_p64_cJSON item of the raw "Array" type.
cy_p64_cJSON* cy_p64_cJSON_CreateObject | ( | void | ) |
Creates a cy_p64_cJSON item of the "object" type.
cy_p64_cJSON* cy_p64_cJSON_CreateIntArray | ( | const int * | numbers, |
int | count | ||
) |
Creates an array of count items.
numbers | The pointer to values for the created cy_p64_cJSON object. |
count | The count of the values. |
cy_p64_cJSON* cy_p64_cJSON_CreateStringArray | ( | const char ** | strings, |
int | count | ||
) |
Creates an array of string items.
strings | The pointer to values for the created cy_p64_cJSON object. |
count | The count of the values. |
void cy_p64_cJSON_AddItemToArray | ( | cy_p64_cJSON * | array, |
cy_p64_cJSON * | item | ||
) |
Appends an item to the specified array.
array | : The pointer to the array object. |
item | : The pointer to the item object. |
void cy_p64_cJSON_AddItemToObject | ( | cy_p64_cJSON * | object, |
const char * | string, | ||
cy_p64_cJSON * | item | ||
) |
Appends an item to the specified object.
object | : The pointer to the cy_p64_cJSON object. |
string | : The pointer to the string with a name of the cy_p64_cJSON object. |
item | : The pointer to the item object. |
void cy_p64_cJSON_AddItemToObjectCS | ( | cy_p64_cJSON * | object, |
const char * | string, | ||
cy_p64_cJSON * | item | ||
) |
Use this function when string is definitely const (i.e.
a literal, or as good as), and will definitely survive the cy_p64_cJSON object.
item->string
object | : The pointer to cy_p64_cJSON object |
string | : The pointer to string with a name of cy_p64_cJSON object |
item | : The pointer to item object |
void cy_p64_cJSON_AddItemReferenceToArray | ( | cy_p64_cJSON * | array, |
cy_p64_cJSON * | item | ||
) |
Appends reference to an item to the specified array.
Use this to add an existing cy_p64_cJSON to a new cy_p64_cJSON and not corrupt your existing cy_p64_cJSON.
array | : The pointer to the cy_p64_cJSON object. |
item | : The pointer to the item object. |
void cy_p64_cJSON_AddItemReferenceToObject | ( | cy_p64_cJSON * | object, |
const char * | string, | ||
cy_p64_cJSON * | item | ||
) |
This function append reference to item to the specified object.
Use this when you want to add an existing cy_p64_cJSON to a new cy_p64_cJSON, but don't want to corrupt your existing cy_p64_cJSON.
object | : The pointer to cy_p64_cJSON object |
string | : The pointer to string with a name of cy_p64_cJSON object |
item | : The pointer to item object |
cy_p64_cJSON* cy_p64_cJSON_DetachItemFromArray | ( | cy_p64_cJSON * | array, |
int | which | ||
) |
Detaches items from an array.
array | : The pointer to the cy_p64_cJSON object. |
which | : The number of the object to detach. |
void cy_p64_cJSON_DeleteItemFromArray | ( | cy_p64_cJSON * | array, |
int | which | ||
) |
Removes items from an array.
array | : The pointer to the cy_p64_cJSON object |
which | : The number of the object to delete. |
cy_p64_cJSON* cy_p64_cJSON_DetachItemFromObject | ( | cy_p64_cJSON * | object, |
const char * | string | ||
) |
Detaches items from an object.
object | : The pointer to the cy_p64_cJSON object. |
string | : The name of the object to detach. |
void cy_p64_cJSON_DeleteItemFromObject | ( | cy_p64_cJSON * | object, |
const char * | string | ||
) |
Removes items from an object.
object | : The pointer to the cy_p64_cJSON object. |
string | : The name of the object to delete. |
void cy_p64_cJSON_InsertItemInArray | ( | cy_p64_cJSON * | array, |
int | which, | ||
cy_p64_cJSON * | newitem | ||
) |
Inserts items in an array.
Shifts pre-existing items to the right.
array | : The pointer to cy_p64_cJSON object |
which | : The number of the item. |
newitem | : The pointer to a new object. |
void cy_p64_cJSON_ReplaceItemInArray | ( | cy_p64_cJSON * | array, |
int | which, | ||
cy_p64_cJSON * | newitem | ||
) |
Replaces items in an array.
array | : The pointer to the cy_p64_cJSON object. |
which | : The number of an item. |
newitem | : The pointer to a new object. |
void cy_p64_cJSON_ReplaceItemInObject | ( | cy_p64_cJSON * | object, |
const char * | string, | ||
cy_p64_cJSON * | newitem | ||
) |
Replaces items in an object.
object | : The pointer to the cy_p64_cJSON object. |
string | : The name of an item. |
newitem | : The pointer to a new object. |
cy_p64_cJSON* cy_p64_cJSON_Duplicate | ( | const cy_p64_cJSON * | item, |
int | recurse | ||
) |
Duplicates a cy_p64_cJSON item.
item | : Pointer to cy_p64_cJSON object |
recurse | : 0-duplicate without children object, other- with children |
cy_p64_cJSON* cy_p64_cJSON_ParseWithOpts | ( | const char * | value, |
const char ** | return_parse_end, | ||
int | require_null_terminated | ||
) |
Allows you to require (and check) that the JSON is null- terminated, and to retrieve the pointer to the final byte parsed.
value | : The pointer to the value for parsing. |
return_parse_end | : The pointer to an output error or NUL.L |
require_null_terminated | : "true" to require (and check) that the JSON is null- terminated, "false" otherwise. |
void cy_p64_cJSON_Minify | ( | char * | json | ) |
Removes not required characters from a string like whitespace characters.
json | : The pointer to a JSON string. |