Lite³
A JSON-Compatible Zero-Copy Serialization Format
Loading...
Searching...
No Matches
Object / Array Initialization

Object / array initialization. More...

Functions

static int lite3_ctx_init_obj (lite3_ctx *ctx)
 Initialize a Lite³ context as an object.
 
static int lite3_ctx_init_arr (lite3_ctx *ctx)
 Initialize a Lite³ context as an array.
 

Detailed Description

Object / array initialization.

The JSON standard requires that the root-level type always be an 'object' or 'array'. This also applies to Lite³.

Before data can be inserted into an empty buffer, it must first be initialized as object or array.

Function Documentation

◆ lite3_ctx_init_arr()

static int lite3_ctx_init_arr ( lite3_ctx ctx)
inlinestatic

Initialize a Lite³ context as an array.

Returns
0 on success
< 0 on error
Note
This function can also be used to reset an existing Lite³ message; the root node is simply replaced with an empty array.

Definition at line 287 of file lite3_context_api.h.

◆ lite3_ctx_init_obj()

static int lite3_ctx_init_obj ( lite3_ctx ctx)
inlinestatic

Initialize a Lite³ context as an object.

Returns
0 on success
< 0 on error
Note
This function can also be used to reset an existing Lite³ message; the root node is simply replaced with an empty object.

Definition at line 273 of file lite3_context_api.h.