16#include "ws_symbol_export.h"
38WS_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:27
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:188
WS_DLL_PUBLIC bool json_strip_jsonc_comments(char *text)
Strip the comments from a JSONC (jsonc.org) string in place, so that it can be parsed with json_parse...
Definition wsjson.c:370
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:168
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:88
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:266
WS_DLL_PUBLIC int json_get_array_len(jsmntok_t *array)
Get the number of elements of an array.
Definition wsjson.c:148
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:97
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:114
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:228
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:105
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:131
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:155