|
Nyx Node
|

Data Structures | |
| struct | nyx_dict_iter_t |
| Struct describing a JSON dict iterator. More... | |
| struct | nyx_dict_t |
| Struct describing a JSON dict object. More... | |
Macros | |
| #define | NYX_DICT_ITER(dict) ((nyx_dict_iter_t) {.idx = 0, .head = ((nyx_dict_t *) (dict))->head}) |
| Initializes a JSON dict iterator. | |
Typedefs | |
| typedef struct nyx_dict_s | nyx_dict_t |
Functions | |
| nyx_dict_t * | nyx_dict_t::nyx_dict_new (void) |
| Allocates a new JSON dict object. | |
| void | nyx_dict_t::nyx_dict_free (nyx_dict_t *object) |
| Frees memory of the provided JSON dict object. | |
| void | nyx_dict_t::nyx_dict_clear (nyx_dict_t *object) |
| Clears the content of the provided JSON dict object. | |
| void | nyx_dict_t::nyx_dict_del (nyx_dict_t *object, STR_t key) |
| Deletes the entry of the provided key. | |
| bool | nyx_dict_t::nyx_dict_iterate (nyx_dict_iter_t *iter, STR_t *key, nyx_object_t **object) |
| Iterates over a JSON dict object. | |
| nyx_object_t * | nyx_dict_t::nyx_dict_get (const nyx_dict_t *object, STR_t key) |
| Gets the JSON object of the provided key. | |
| bool | nyx_dict_t::nyx_dict_set (nyx_dict_t *object, STR_t key, void *value) |
| Sets a JSON object in the provided JSON dict object. | |
| size_t | nyx_dict_t::nyx_dict_size (const nyx_dict_t *object) |
| Gets the number of items in the provided JSON dict object. | |
| str_t | nyx_dict_t::nyx_dict_to_string (const nyx_dict_t *object) |
| Returns a string representing the provided JSON dict object. | |
| __NYX_INLINE__ bool | nyx_dict_t::nyx_dict_get_boolean (const nyx_dict_t *object, STR_t key) |
| Gets a boolean value of the provided key. | |
| __NYX_INLINE__ double | nyx_dict_t::nyx_dict_get_number (const nyx_dict_t *object, STR_t key) |
| Gets a number value of the provided key. | |
| __NYX_INLINE__ STR_t | nyx_dict_t::nyx_dict_get_string (const nyx_dict_t *object, STR_t key) |
| Gets a C string value of the provided key. | |
JSON Dict Object.
| #define NYX_DICT_ITER | ( | dict | ) | ((nyx_dict_iter_t) {.idx = 0, .head = ((nyx_dict_t *) (dict))->head}) |
Initializes a JSON dict iterator.
| dict | JSON dict. |
Definition at line 1176 of file nyx_node.h.
| nyx_dict_t * nyx_dict_new | ( | void | ) |
Allocates a new JSON dict object.
Definition at line 32 of file json_dict.c.
| void nyx_dict_free | ( | nyx_dict_t * | object | ) |
Frees memory of the provided JSON dict object.
| object | JSON dict object. |
Definition at line 54 of file json_dict.c.
| void nyx_dict_clear | ( | nyx_dict_t * | object | ) |
Clears the content of the provided JSON dict object.
| object | JSON dict object. |
Definition at line 94 of file json_dict.c.
| void nyx_dict_del | ( | nyx_dict_t * | object, |
| STR_t | key | ||
| ) |
Deletes the entry of the provided key.
| object | JSON dict object. |
| key | Key. |
Definition at line 101 of file json_dict.c.
| bool nyx_dict_iterate | ( | nyx_dict_iter_t * | iter, |
| STR_t * | key, | ||
| nyx_object_t ** | object | ||
| ) |
Iterates over a JSON dict object.
| iter | List iterator. |
| key | Pointer to the current element key. |
| object | Pointer to the current JSON object. |
true while elements remain, false otherwise. Definition at line 137 of file json_dict.c.
| nyx_object_t * nyx_dict_get | ( | const nyx_dict_t * | object, |
| STR_t | key | ||
| ) |
Gets the JSON object of the provided key.
| object | JSON dict object. |
| key | Key. |
NULL. Definition at line 160 of file json_dict.c.
| bool nyx_dict_set | ( | nyx_dict_t * | object, |
| STR_t | key, | ||
| void * | value | ||
| ) |
Sets a JSON object in the provided JSON dict object.
| object | JSON dict object. |
| key | Key. |
| value | JSON object to be added. |
true if the value was modified, false otherwise. Definition at line 179 of file json_dict.c.
| size_t nyx_dict_size | ( | const nyx_dict_t * | object | ) |
Gets the number of items in the provided JSON dict object.
| object | JSON dict object. |
Definition at line 239 of file json_dict.c.
| str_t nyx_dict_to_string | ( | const nyx_dict_t * | object | ) |
Returns a string representing the provided JSON dict object.
| object | JSON dict object. |
Definition at line 254 of file json_dict.c.
| __NYX_INLINE__ bool nyx_dict_get_boolean | ( | const nyx_dict_t * | object, |
| STR_t | key | ||
| ) |
Gets a boolean value of the provided key.
| object | JSON dict object. |
| key | Key. |
false if absent or wrong type. Definition at line 1323 of file nyx_node.h.
| __NYX_INLINE__ double nyx_dict_get_number | ( | const nyx_dict_t * | object, |
| STR_t | key | ||
| ) |
Gets a number value of the provided key.
| object | JSON dict object. |
| key | Key. |
NaN if absent or wrong type. Definition at line 1342 of file nyx_node.h.
| __NYX_INLINE__ STR_t nyx_dict_get_string | ( | const nyx_dict_t * | object, |
| STR_t | key | ||
| ) |
Gets a C string value of the provided key.
| object | JSON dict object. |
| key | Key. |
NULL if absent or wrong type. Definition at line 1361 of file nyx_node.h.