|
Nyx Node
|

Classes | |
| 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) |
| Initializes a JSON dict iterator. | |
Functions | |
| nyx_dict_t * | nyx_dict_t::nyx_dict_new (void) |
| Allocates a new 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 *dict, 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 *dict, STR_t key) |
| Gets a text value of the provided key. | |
| __NYX_INLINE__ void | nyx_dict_t::nyx_dict_get_buff (const nyx_dict_t *dict, STR_t key, __NYX_NULLABLE__ size_t *result_size, __NYX_NULLABLE__ buff_t *result_buff) |
| Gets the content of the provided key as a byte buffer. | |
| __NYX_INLINE__ bool | nyx_dict_t::nyx_dict_set_boolean (const nyx_dict_t *dict, STR_t key, bool value) |
| Sets a boolean value of an existing key holding a boolean. | |
| __NYX_INLINE__ bool | nyx_dict_t::nyx_dict_set_number (const nyx_dict_t *dict, STR_t key, double value) |
| Sets a number value of an existing key holding a number. | |
| __NYX_INLINE__ bool | nyx_dict_t::nyx_dict_set_string (const nyx_dict_t *dict, STR_t key, STR_t value, bool managed) |
| Sets a text value of an existing key holding a string. | |
| __NYX_INLINE__ bool | nyx_dict_t::nyx_dict_set_buff (const nyx_dict_t *dict, STR_t key, size_t size, BUFF_t buff, bool managed) |
| Sets the content of an existing key holding a string from a byte buffer. | |
JSON Dict Object.
| struct nyx_dict_iter_t |
Struct describing a JSON dict iterator.
Definition at line 1111 of file nyx_node.h.
Public Attributes | |
| size_t | idx |
| Current zero-based iteration index. | |
| struct nyx_dict_node_s * | head |
| Next JSON object to visit. | |
| struct nyx_dict_t |
Struct describing a JSON dict object.
Public Member Functions | |
| nyx_dict_t * | nyx_dict_new (void) |
| Allocates a new JSON dict object. | |
| void | nyx_dict_clear (nyx_dict_t *object) |
| Clears the content of the provided JSON dict object. | |
| void | nyx_dict_del (nyx_dict_t *object, STR_t key) |
| Deletes the entry of the provided key. | |
| bool | 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_get (const nyx_dict_t *object, STR_t key) |
| Gets the JSON object of the provided key. | |
| bool | 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_size (const nyx_dict_t *object) |
| Gets the number of items in the provided JSON dict object. | |
| str_t | nyx_dict_to_string (const nyx_dict_t *object) |
| Returns a string representing the provided JSON dict object. | |
| __NYX_INLINE__ bool | 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_get_number (const nyx_dict_t *dict, STR_t key) |
| Gets a number value of the provided key. | |
| __NYX_INLINE__ STR_t | nyx_dict_get_string (const nyx_dict_t *dict, STR_t key) |
| Gets a text value of the provided key. | |
| __NYX_INLINE__ void | nyx_dict_get_buff (const nyx_dict_t *dict, STR_t key, __NYX_NULLABLE__ size_t *result_size, __NYX_NULLABLE__ buff_t *result_buff) |
| Gets the content of the provided key as a byte buffer. | |
| __NYX_INLINE__ bool | nyx_dict_set_boolean (const nyx_dict_t *dict, STR_t key, bool value) |
| Sets a boolean value of an existing key holding a boolean. | |
| __NYX_INLINE__ bool | nyx_dict_set_number (const nyx_dict_t *dict, STR_t key, double value) |
| Sets a number value of an existing key holding a number. | |
| __NYX_INLINE__ bool | nyx_dict_set_string (const nyx_dict_t *dict, STR_t key, STR_t value, bool managed) |
| Sets a text value of an existing key holding a string. | |
| __NYX_INLINE__ bool | nyx_dict_set_buff (const nyx_dict_t *dict, STR_t key, size_t size, BUFF_t buff, bool managed) |
| Sets the content of an existing key holding a string from a byte buffer. | |
| #define NYX_DICT_ITER | ( | dict | ) |
Initializes a JSON dict iterator.
| dict | JSON dict. |
Definition at line 1126 of file nyx_node.h.
| nyx_dict_t * nyx_dict_new | ( | void | ) |
Allocates a new JSON dict object.
Definition at line 20 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 84 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 91 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 | Dict iterator. |
| key | Pointer to the current element key. |
| object | Pointer to the current JSON object. |
Definition at line 136 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. |
Definition at line 159 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. |
Definition at line 178 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 260 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 275 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. |
Definition at line 1261 of file nyx_node.h.
| __NYX_INLINE__ double nyx_dict_get_number | ( | const nyx_dict_t * | dict, |
| STR_t | key ) |
Gets a number value of the provided key.
| dict | JSON dict object. |
| key | Key. |
Definition at line 1280 of file nyx_node.h.
| __NYX_INLINE__ STR_t nyx_dict_get_string | ( | const nyx_dict_t * | dict, |
| STR_t | key ) |
Gets a text value of the provided key.
| dict | JSON dict object. |
| key | Key. |
Definition at line 1300 of file nyx_node.h.
| __NYX_INLINE__ void nyx_dict_get_buff | ( | const nyx_dict_t * | dict, |
| STR_t | key, | ||
| __NYX_NULLABLE__ size_t * | result_size, | ||
| __NYX_NULLABLE__ buff_t * | result_buff ) |
Gets the content of the provided key as a byte buffer.
| dict | JSON dict object. |
| key | Key. |
| result_size | Pointer receiving the number of content bytes. |
| result_buff | Pointer receiving the content buffer. |
Definition at line 1321 of file nyx_node.h.
| __NYX_INLINE__ bool nyx_dict_set_boolean | ( | const nyx_dict_t * | dict, |
| STR_t | key, | ||
| bool | value ) |
Sets a boolean value of an existing key holding a boolean.
| dict | JSON dict object. |
| key | Key. |
| value | Boolean value to set. |
Definition at line 1339 of file nyx_node.h.
| __NYX_INLINE__ bool nyx_dict_set_number | ( | const nyx_dict_t * | dict, |
| STR_t | key, | ||
| double | value ) |
Sets a number value of an existing key holding a number.
| dict | JSON dict object. |
| key | Key. |
| value | Number value to set. |
Definition at line 1359 of file nyx_node.h.
| __NYX_INLINE__ bool nyx_dict_set_string | ( | const nyx_dict_t * | dict, |
| STR_t | key, | ||
| STR_t | value, | ||
| bool | managed ) |
Sets a text value of an existing key holding a string.
| dict | JSON dict object. |
| key | Key. |
| value | Text value to set. |
| managed | If true, ownership of the provided value is transferred to the object. |
Definition at line 1380 of file nyx_node.h.
| __NYX_INLINE__ bool nyx_dict_set_buff | ( | const nyx_dict_t * | dict, |
| STR_t | key, | ||
| size_t | size, | ||
| BUFF_t | buff, | ||
| bool | managed ) |
Sets the content of an existing key holding a string from a byte buffer.
| dict | JSON dict object. |
| key | Key. |
| size | Number of content bytes. |
| buff | Content buffer. |
| managed | If true, ownership of the provided buffer is transferred to the object. |
Definition at line 1402 of file nyx_node.h.