Nyx Node
Loading...
Searching...
No Matches
Collaboration diagram for JSON String Object:

Data Structures

struct  nyx_string_t
 Struct describing a JSON string object. More...
 

Functions

nyx_string_tnyx_string_t::nyx_string_new (void)
 Allocates a new JSON string object.
 
void nyx_string_t::nyx_string_free (nyx_string_t *object)
 Frees memory of the provided JSON string object.
 
STR_t nyx_string_t::nyx_string_get (const nyx_string_t *object)
 Get the value of the provided JSON string object.
 
bool nyx_string_t::nyx_string_set (nyx_string_t *object, STR_t value, bool managed)
 Set the value of the provided JSON string object.
 
bool nyx_string_t::nyx_string_set_buff (nyx_string_t *object, size_t size, BUFF_t buff, bool managed)
 Set the value of the provided JSON string object.
 
size_t nyx_string_t::nyx_string_length (const nyx_string_t *object)
 Returns the length of the provided JSON string object.
 
str_t nyx_string_t::nyx_string_to_string (const nyx_string_t *object)
 Returns a C string, with special character escaping, representing the provided JSON string object.
 
str_t nyx_string_t::nyx_string_to_cstring (const nyx_string_t *object)
 Returns a C string, without special character escaping, representing the provided JSON string object.
 
__NYX_INLINE__ nyx_string_tnyx_string_t::nyx_string_from_dup (STR_t value)
 Returns a JSON string object holding the value of the provided string (managed duplication).
 
__NYX_INLINE__ nyx_string_tnyx_string_t::nyx_string_from_managed (STR_t value)
 Returns a JSON string object holding the value of the provided string (managed reference).
 
__NYX_INLINE__ nyx_string_tnyx_string_t::nyx_string_from_unmanaged (STR_t value)
 Returns a JSON string object holding the value of the provided string (unmanaged reference).
 
__NYX_INLINE__ nyx_string_tnyx_string_t::nyx_string_from_buff_managed (size_t size, BUFF_t buff)
 Returns a JSON string object holding the value of the provided buffer (managed reference).
 
__NYX_INLINE__ nyx_string_tnyx_string_t::nyx_string_from_buff_unmanaged (size_t size, BUFF_t buff)
 Returns a JSON string object holding the value of the provided buffer (unmanaged reference).
 

Detailed Description

JSON String Object.

Function Documentation

◆ nyx_string_new()

nyx_string_t * nyx_string_new ( void  )

Allocates a new JSON string object.

Returns
The new JSON string object.

Definition at line 14 of file json_string.c.

◆ nyx_string_free()

void nyx_string_free ( nyx_string_t object)

Frees memory of the provided JSON string object.

Parameters
objectJSON string object.

Definition at line 38 of file json_string.c.

◆ nyx_string_get()

STR_t nyx_string_get ( const nyx_string_t object)

Get the value of the provided JSON string object.

Parameters
objectJSON string object.
Returns
The value of the provided JSON string object.

Definition at line 50 of file json_string.c.

◆ nyx_string_set()

bool nyx_string_set ( nyx_string_t object,
STR_t  value,
bool  managed 
)

Set the value of the provided JSON string object.

Parameters
objectJSON string object.
valueValue for the provided JSON string object.
managedIf true, the provided buffer is freed with this object.
Returns
true if the value was modified, false otherwise.

Definition at line 70 of file json_string.c.

◆ nyx_string_set_buff()

bool nyx_string_set_buff ( nyx_string_t object,
size_t  size,
BUFF_t  buff,
bool  managed 
)

Set the value of the provided JSON string object.

Parameters
objectJSON string object.
sizeValue size for the provided JSON string object.
buffValue buffer for the provided JSON string object.
managedIf true, the provided buffer is freed with this object.
Returns
true if the value was modified, false otherwise.

Definition at line 106 of file json_string.c.

◆ nyx_string_length()

size_t nyx_string_length ( const nyx_string_t object)

Returns the length of the provided JSON string object.

Parameters
objectJSON string object.
Returns
The length of the provided JSON string object.

Definition at line 142 of file json_string.c.

◆ nyx_string_to_string()

str_t nyx_string_to_string ( const nyx_string_t object)

Returns a C string, with special character escaping, representing the provided JSON string object.

Parameters
objectJSON string object.
Returns
A newly allocated string that represents the provided JSON string object.
Note
Must be freed.

Definition at line 149 of file json_string.c.

◆ nyx_string_to_cstring()

str_t nyx_string_to_cstring ( const nyx_string_t object)

Returns a C string, without special character escaping, representing the provided JSON string object.

Parameters
objectJSON string object.
Returns
A newly allocated string that represents the provided JSON string object.
Note
Must be freed.

Definition at line 166 of file json_string.c.

◆ nyx_string_from_dup()

__NYX_INLINE__ nyx_string_t * nyx_string_from_dup ( STR_t  value)

Returns a JSON string object holding the value of the provided string (managed duplication).

Parameters
valueValue for the new JSON string object.
Returns
The new JSON string object.
Note
The duplicated C string is freed with this object.

Definition at line 1043 of file nyx_node.h.

◆ nyx_string_from_managed()

__NYX_INLINE__ nyx_string_t * nyx_string_from_managed ( STR_t  value)

Returns a JSON string object holding the value of the provided string (managed reference).

Parameters
valueValue for the new JSON string object.
Returns
The new JSON string object.
Note
The provided C string is freed with this object.

Definition at line 1062 of file nyx_node.h.

◆ nyx_string_from_unmanaged()

__NYX_INLINE__ nyx_string_t * nyx_string_from_unmanaged ( STR_t  value)

Returns a JSON string object holding the value of the provided string (unmanaged reference).

Parameters
valueValue for the new JSON string object.
Returns
The new JSON string object.
Note
The provided C string is not freed with this object.

Definition at line 1081 of file nyx_node.h.

◆ nyx_string_from_buff_managed()

__NYX_INLINE__ nyx_string_t * nyx_string_from_buff_managed ( size_t  size,
BUFF_t  buff 
)

Returns a JSON string object holding the value of the provided buffer (managed reference).

Parameters
sizeBuffer size for the new JSON string object.
buffBuffer pointer for the new JSON string object.
Returns
The new JSON string object.
Note
The provided buffer is freed with this object.

Definition at line 1101 of file nyx_node.h.

◆ nyx_string_from_buff_unmanaged()

__NYX_INLINE__ nyx_string_t * nyx_string_from_buff_unmanaged ( size_t  size,
BUFF_t  buff 
)

Returns a JSON string object holding the value of the provided buffer (unmanaged reference).

Parameters
sizeBuffer size for the new JSON string object.
buffBuffer pointer for the new JSON string object.
Returns
The new JSON string object.
Note
The provided buffer is not freed with this object.

Definition at line 1121 of file nyx_node.h.