17#include "ws_symbol_export.h"
39WS_DLL_PUBLIC
bool json_validate(
const uint8_t *buf,
const size_t len);
WS_DLL_PUBLIC bool json_validate(const uint8_t *buf, const size_t len)
Check if a buffer is valid JSON.
Definition wsjson.c:26
WS_DLL_PUBLIC bool json_get_double(char *buf, jsmntok_t *parent, const char *name, double *val)
Get the value of a number object belonging to the parent object and named as the name variable.
Definition wsjson.c:189
WS_DLL_PUBLIC char * json_get_string(char *buf, jsmntok_t *parent, const char *name)
Get the unescaped value of a string object belonging to the parent object and named as the name varia...
Definition wsjson.c:169
WS_DLL_PUBLIC int json_parse(const char *buf, jsmntok_t *tokens, unsigned int max_tokens)
Parse a JSON string and write the token's addresses into the tokens array.
Definition wsjson.c:87
WS_DLL_PUBLIC bool json_decode_string_inplace(char *text)
Decode the contents of a JSON string value by overwriting the input data.
Definition wsjson.c:269
WS_DLL_PUBLIC int json_get_array_len(jsmntok_t *array)
Get the number of elements of an array.
Definition wsjson.c:149
WS_DLL_PUBLIC bool json_get_int(char *buf, jsmntok_t *parent, const char *name, int64_t *val)
Get the value of a number object belonging to the parent object and named as the name variable.
Definition wsjson.c:210
WS_DLL_PUBLIC int json_parse_len(const char *buf, size_t len, jsmntok_t *tokens, unsigned int max_tokens)
Parse a JSON buffer and write the token's addresses into the tokens array.
Definition wsjson.c:96
WS_DLL_PUBLIC jsmntok_t * json_get_object(const char *buf, jsmntok_t *parent, const char *name)
Get the pointer to an object belonging to the parent object and named as the name variable.
Definition wsjson.c:115
WS_DLL_PUBLIC bool json_get_boolean(char *buf, jsmntok_t *parent, const char *name, bool *val)
Get the value of a boolean belonging to the parent object and named as the name variable.
Definition wsjson.c:231
WS_DLL_PUBLIC jsmntok_t * json_get_next_object(jsmntok_t *cur)
Get the pointer to the next JSON element which is a sibling of cur.
Definition wsjson.c:104
WS_DLL_PUBLIC jsmntok_t * json_get_array(const char *buf, jsmntok_t *parent, const char *name)
Get the pointer to an array belonging to the parent object and named as the name variable.
Definition wsjson.c:132
WS_DLL_PUBLIC jsmntok_t * json_get_array_index(jsmntok_t *parent, int idx)
Get the pointer to idx element of an array.
Definition wsjson.c:156