Nyx Node
Loading...
Searching...
No Matches
JSON serialization / deserialization
Collaboration diagram for JSON serialization / deserialization:

Topics

 JSON Null Object
 
 JSON Number Object
 
 JSON Boolean Object
 
 JSON String Object
 
 JSON Dict Object
 
 JSON List Object
 

Classes

struct  nyx_object_s
 
struct  nyx_object_t
 

Macros

#define NYX_OBJECT_MAGIC   0x65656565U
 Magic number for identifying JSON objects.
 
#define NYX_FLAGS_DISABLED   ((uint64_t) 0x0000000000000001U)
 Flag indicating that the object is disabled.
 
#define NYX_FLAGS_BLOB_MASK   ((uint64_t) 0x00000001FFFFFFFCU)
 Mask indicating the Nyx blob emission per client.
 
#define NYX_FLAGS_STREAM_MASK   ((uint64_t) 0xFFFFFFFE00000000U)
 Mask indicating the Nyx stream emission per client.
 

Typedefs

typedef struct nyx_object_s nyx_object_t
 

Enumerations

enum  nyx_type_t {
  NYX_TYPE_NULL = 100 ,
  NYX_TYPE_BOOLEAN = 101 ,
  NYX_TYPE_NUMBER = 102 ,
  NYX_TYPE_STRING = 103 ,
  NYX_TYPE_DICT = 104 ,
  NYX_TYPE_LIST = 105
}
 JSON object types. More...
 

Functions

nyx_object_tnyx_object_t::nyx_object_parse_buff (__ZEROABLE__ size_t size, __NULLABLE__ BUFF_t buff)
 Parses a JSON object from a string buffer.
 
__NULLABLE__ nyx_object_tnyx_object_t::nyx_object_parse (__NULLABLE__ STR_t text)
 Parses a JSON object from a string.
 
void nyx_object_t::nyx_object_free (__NULLABLE__ nyx_object_t *object)
 Frees memory of the provided JSON object.
 
bool nyx_object_t::nyx_object_equal (__NULLABLE__ const nyx_object_t *object1, __NULLABLE__ const nyx_object_t *object2)
 Compares two JSON objects.
 
str_t nyx_object_t::nyx_object_to_string (__NULLABLE__ const nyx_object_t *object)
 Returns a string representing the provided object.
 
str_t nyx_object_t::nyx_object_to_cstring (__NULLABLE__ const nyx_object_t *object)
 Returns a C/C++ string representing the provided object.
 

Detailed Description

JSON serialization / deserialization.

Enumeration Type Documentation

◆ nyx_type_t

enum nyx_type_t

JSON object types.

Enumerator
NYX_TYPE_NULL 

Null object.

NYX_TYPE_BOOLEAN 

Boolean object.

NYX_TYPE_NUMBER 

Number object.

NYX_TYPE_STRING 

String object.

NYX_TYPE_DICT 

Dict object.

NYX_TYPE_LIST 

List object.

Function Documentation

◆ nyx_object_parse_buff()

nyx_object_t * nyx_object_parse_buff ( __ZEROABLE__ size_t size,
__NULLABLE__ BUFF_t buff )

Parses a JSON object from a string buffer.

Parameters
sizeThe string size.
buffThe string pointer.
Returns
The new JSON object.

◆ nyx_object_parse()

__NULLABLE__ nyx_object_t * nyx_object_parse ( __NULLABLE__ STR_t text)

Parses a JSON object from a string.

Parameters
textThe string.
Returns
The new JSON object.

◆ nyx_object_free()

void nyx_object_free ( __NULLABLE__ nyx_object_t * object)

Frees memory of the provided JSON object.

Parameters
objectThe provided JSON document.

◆ nyx_object_equal()

bool nyx_object_equal ( __NULLABLE__ const nyx_object_t * object1,
__NULLABLE__ const nyx_object_t * object2 )

Compares two JSON objects.

Parameters
object1The first JSON object.
object2The second JSON object.
Returns
true if the objects are equal, and false if not.

◆ nyx_object_to_string()

str_t nyx_object_to_string ( __NULLABLE__ const nyx_object_t * object)

Returns a string representing the provided object.

Parameters
objectThe provided object.
Returns
The string representing the provided object.

◆ nyx_object_to_cstring()

str_t nyx_object_to_cstring ( __NULLABLE__ const nyx_object_t * object)

Returns a C/C++ string representing the provided object.

Parameters
objectThe provided object.
Returns
The string representing the provided object.