const nx_json * nx_json_item(const nx_json *json, int idx)
Gets an array element by index This function never returns NULL or fails for any reason.
void nx_json_free(const nx_json *js)
Frees a nx_json struct parsed by nx_json_parse()
nx_json_type
This enum is used in nx_json to discribe what type a given json entry has.
Definition nxjson.h:35
const nx_json * nx_json_get(const nx_json *json, const char *key)
Gets object's property or child by key.
const nx_json * nx_json_parse_utf8(char *text)
This is shortcut for nx_json_parse(text, nx_json_unicode_to_utf8) where nx_json_unicode_to_utf8 is un...
const nx_json * nx_json_parse(char *text, nx_json_unicode_encoder encoder)
This struct discribes a parsed entry or file.
int(* nx_json_unicode_encoder)(unsigned int codepoint, char *p, char **endp)
this typdef descibes a function that takes a Unicode codepoint and writes corresponding encoded value...
Definition nxjson.h:64
@ NX_JSON_NULL
this is null value
Definition nxjson.h:36
@ NX_JSON_STRING
this is a string; value can be found in text_value field
Definition nxjson.h:39
@ NX_JSON_OBJECT
this is an object; properties can be found in child nodes
Definition nxjson.h:37
@ NX_JSON_DOUBLE
this is a double; value can be found in dbl_value field
Definition nxjson.h:41
@ NX_JSON_INTEGER
this is an integer; value can be found in int_value field
Definition nxjson.h:40
@ NX_JSON_ARRAY
this is an array; items can be found in child nodes
Definition nxjson.h:38
@ NX_JSON_BOOL
this is a boolean; value can be found in int_value field
Definition nxjson.h:42
This struct discribes a parsed entry or file.
Definition nxjson.h:48
int length
number of children of OBJECT or ARRAY
Definition nxjson.h:54
const char * text_value
text value of STRING node
Definition nxjson.h:51
nx_json_type type
type of json node, see above
Definition nxjson.h:49
long long int_value
the value of INTEGER or BOOL node
Definition nxjson.h:52
struct nx_json * next
points to next child
Definition nxjson.h:56
struct nx_json * child
points to first child
Definition nxjson.h:55
const char * key
key of the property; for object's children only
Definition nxjson.h:50
double dbl_value
the value of DOUBLE node
Definition nxjson.h:53