Lite³
A JSON-Compatible Zero-Copy Serialization Format
Loading...
Searching...
No Matches
lite3_val functions

Functions to deal with opaque values. More...

Functions

static enum lite3_type lite3_val_type (lite3_val *val)
 Returns the value type of *val
 
static size_t lite3_val_type_size (lite3_val *val)
 Returns the size of the value type.
 
static bool lite3_val_is_null (lite3_val *val)
 
static bool lite3_val_is_bool (lite3_val *val)
 
static bool lite3_val_is_i64 (lite3_val *val)
 
static bool lite3_val_is_f64 (lite3_val *val)
 
static bool lite3_val_is_bytes (lite3_val *val)
 
static bool lite3_val_is_str (lite3_val *val)
 
static bool lite3_val_is_obj (lite3_val *val)
 
static bool lite3_val_is_arr (lite3_val *val)
 
static bool lite3_val_bool (lite3_val *val)
 
static int64_t lite3_val_i64 (lite3_val *val)
 
static double lite3_val_f64 (lite3_val *val)
 
static const char * lite3_val_str (lite3_val *val)
 
static const char * lite3_val_str_n (lite3_val *val, size_t *out_len)
 
static const unsigned char * lite3_val_bytes (lite3_val *val, size_t *out_len)
 

Detailed Description

Functions to deal with opaque values.

The lite3_val struct represents a value inside a Lite³ buffer.

Function Documentation

◆ lite3_val_bool()

static bool lite3_val_bool ( lite3_val val)
inlinestatic

Definition at line 2729 of file lite3.h.

◆ lite3_val_bytes()

static const unsigned char * lite3_val_bytes ( lite3_val val,
size_t *  out_len 
)
inlinestatic

Definition at line 2765 of file lite3.h.

◆ lite3_val_f64()

static double lite3_val_f64 ( lite3_val val)
inlinestatic

Definition at line 2741 of file lite3.h.

◆ lite3_val_i64()

static int64_t lite3_val_i64 ( lite3_val val)
inlinestatic

Definition at line 2734 of file lite3.h.

◆ lite3_val_is_arr()

static bool lite3_val_is_arr ( lite3_val val)
inlinestatic

Definition at line 2727 of file lite3.h.

◆ lite3_val_is_bool()

static bool lite3_val_is_bool ( lite3_val val)
inlinestatic

Definition at line 2721 of file lite3.h.

◆ lite3_val_is_bytes()

static bool lite3_val_is_bytes ( lite3_val val)
inlinestatic

Definition at line 2724 of file lite3.h.

◆ lite3_val_is_f64()

static bool lite3_val_is_f64 ( lite3_val val)
inlinestatic

Definition at line 2723 of file lite3.h.

◆ lite3_val_is_i64()

static bool lite3_val_is_i64 ( lite3_val val)
inlinestatic

Definition at line 2722 of file lite3.h.

◆ lite3_val_is_null()

static bool lite3_val_is_null ( lite3_val val)
inlinestatic

Definition at line 2720 of file lite3.h.

◆ lite3_val_is_obj()

static bool lite3_val_is_obj ( lite3_val val)
inlinestatic

Definition at line 2726 of file lite3.h.

◆ lite3_val_is_str()

static bool lite3_val_is_str ( lite3_val val)
inlinestatic

Definition at line 2725 of file lite3.h.

◆ lite3_val_str()

static const char * lite3_val_str ( lite3_val val)
inlinestatic

Definition at line 2748 of file lite3.h.

◆ lite3_val_str_n()

static const char * lite3_val_str_n ( lite3_val val,
size_t *  out_len 
)
inlinestatic
Warning
*out_len is exclusive of the NULL-terminator.

Definition at line 2757 of file lite3.h.

◆ lite3_val_type()

static enum lite3_type lite3_val_type ( lite3_val val)
inlinestatic

Returns the value type of *val

Definition at line 2694 of file lite3.h.

◆ lite3_val_type_size()

static size_t lite3_val_type_size ( lite3_val val)
inlinestatic

Returns the size of the value type.

Note
For variable sized types like LITE3_TYPE_BYTES or LITE3_TYPE_STRING, the number of bytes (including NULL-terminator for string) are written back.
Warning
This function assumes you have a valid lite3_val. Passing an invalid value will return an invalid size.

Definition at line 2709 of file lite3.h.