|
Nyx Node
|

Data Structures | |
| struct | nyx_list_iter_t |
| Struct describing a JSON list iterator. More... | |
| struct | nyx_list_t |
| Struct describing a JSON list object. More... | |
Macros | |
| #define | NYX_LIST_ITER(list) ((nyx_list_iter_t) {.idx = 0, .head = ((nyx_list_t *) (list))->head}) |
| Initializes a JSON list iterator. | |
Typedefs | |
| typedef struct nyx_list_s | nyx_list_t |
Functions | |
| nyx_list_t * | nyx_list_t::nyx_list_new (void) |
| Allocates a new JSON list. | |
| void | nyx_list_t::nyx_list_free (nyx_list_t *object) |
| Frees memory of the provided JSON list object. | |
| void | nyx_list_t::nyx_list_clear (nyx_list_t *object) |
| Clears the content of the provided JSON list object. | |
| void | nyx_list_t::nyx_list_del (nyx_list_t *object, size_t idx) |
| Deletes the entry at the provided index. | |
| bool | nyx_list_t::nyx_list_iterate (nyx_list_iter_t *iter, size_t *idx, nyx_object_t **object) |
| Iterates over a JSON list object. | |
| nyx_object_t * | nyx_list_t::nyx_list_get (const nyx_list_t *object, size_t idx) |
| Gets the JSON object at the provided index. | |
| __NYX_INLINE__ bool | nyx_list_t::nyx_list_push (nyx_list_t *object, void *value) |
| Pushes a JSON object in the provided JSON list object. | |
| size_t | nyx_list_t::nyx_list_size (const nyx_list_t *object) |
| Gets the number of items in the provided JSON list object. | |
| str_t | nyx_list_t::nyx_list_to_string (const nyx_list_t *object) |
| Returns a string representing the provided JSON list object. | |
| __NYX_INLINE__ bool | nyx_list_t::nyx_list_get_boolean (const nyx_list_t *object, size_t idx) |
| Gets a boolean value at the provided index. | |
| __NYX_INLINE__ double | nyx_list_t::nyx_list_get_number (const nyx_list_t *object, size_t idx) |
| Gets a number value at the provided index. | |
| __NYX_INLINE__ STR_t | nyx_list_t::nyx_list_get_string (const nyx_list_t *object, size_t idx) |
| Gets a C string value at the provided index. | |
JSON List Object.
| #define NYX_LIST_ITER | ( | list | ) | ((nyx_list_iter_t) {.idx = 0, .head = ((nyx_list_t *) (list))->head}) |
Initializes a JSON list iterator.
| list | JSON list object. |
Definition at line 1416 of file nyx_node.h.
| nyx_list_t * nyx_list_new | ( | void | ) |
| void nyx_list_free | ( | nyx_list_t * | object | ) |
Frees memory of the provided JSON list object.
| object | JSON list object. |
Definition at line 50 of file json_list.c.
| void nyx_list_clear | ( | nyx_list_t * | object | ) |
Clears the content of the provided JSON list object.
| object | JSON list object. |
Definition at line 90 of file json_list.c.
| void nyx_list_del | ( | nyx_list_t * | object, |
| size_t | idx | ||
| ) |
Deletes the entry at the provided index.
| object | JSON list object. |
| idx | Index. |
Definition at line 97 of file json_list.c.
| bool nyx_list_iterate | ( | nyx_list_iter_t * | iter, |
| size_t * | idx, | ||
| nyx_object_t ** | object | ||
| ) |
Iterates over a JSON list object.
| iter | List iterator. |
| idx | Pointer to the current element index. |
| object | Pointer to the current JSON object. |
true while elements remain, false otherwise. Definition at line 133 of file json_list.c.
| nyx_object_t * nyx_list_get | ( | const nyx_list_t * | object, |
| size_t | idx | ||
| ) |
Gets the JSON object at the provided index.
| object | JSON list object. |
| idx | Index. |
NULL. Definition at line 156 of file json_list.c.
| __NYX_INLINE__ bool nyx_list_push | ( | nyx_list_t * | object, |
| void * | value | ||
| ) |
Pushes a JSON object in the provided JSON list object.
| object | JSON list object. |
| value | JSON object to be added. |
true if the value was modified, false otherwise. Definition at line 1531 of file nyx_node.h.
| size_t nyx_list_size | ( | const nyx_list_t * | object | ) |
Gets the number of items in the provided JSON list object.
| object | JSON list object. |
Definition at line 233 of file json_list.c.
| str_t nyx_list_to_string | ( | const nyx_list_t * | object | ) |
Returns a string representing the provided JSON list object.
| object | JSON list object. |
Definition at line 248 of file json_list.c.
| __NYX_INLINE__ bool nyx_list_get_boolean | ( | const nyx_list_t * | object, |
| size_t | idx | ||
| ) |
Gets a boolean value at the provided index.
| object | JSON list object. |
| idx | Index. |
false if absent or wrong type. Definition at line 1573 of file nyx_node.h.
| __NYX_INLINE__ double nyx_list_get_number | ( | const nyx_list_t * | object, |
| size_t | idx | ||
| ) |
Gets a number value at the provided index.
| object | JSON list object. |
| idx | Index. |
NaN if absent or wrong type. Definition at line 1592 of file nyx_node.h.
| __NYX_INLINE__ STR_t nyx_list_get_string | ( | const nyx_list_t * | object, |
| size_t | idx | ||
| ) |
Gets a C string value at the provided index.
| object | JSON list object. |
| idx | Index. |
NULL if absent or wrong type. Definition at line 1611 of file nyx_node.h.