Get value from array by index.
More...
|
| static int | lite3_ctx_arr_get_bool (lite3_ctx *ctx, size_t ofs, uint32_t index, bool *out) |
| | Get boolean value by index.
|
| |
| static int | lite3_ctx_arr_get_i64 (lite3_ctx *ctx, size_t ofs, uint32_t index, int64_t *out) |
| | Get integer value by index.
|
| |
| static int | lite3_ctx_arr_get_f64 (lite3_ctx *ctx, size_t ofs, uint32_t index, double *out) |
| | Get floating point value by index.
|
| |
| static int | lite3_ctx_arr_get_bytes (lite3_ctx *ctx, size_t ofs, uint32_t index, lite3_bytes *out) |
| | Get bytes value by index.
|
| |
| static int | lite3_ctx_arr_get_str (lite3_ctx *ctx, size_t ofs, uint32_t index, lite3_str *out) |
| | Get string value by index.
|
| |
| static int | lite3_ctx_arr_get_obj (lite3_ctx *ctx, size_t ofs, uint32_t index, size_t *__restrict out_ofs) |
| | Get object by index.
|
| |
| static int | lite3_ctx_arr_get_arr (lite3_ctx *ctx, size_t ofs, uint32_t index, size_t *__restrict out_ofs) |
| | Get array by index.
|
| |
Get value from array by index.
The ofs (offset) field is used to target an object or array inside the Lite³ buffer. To target the root-level object/array, use ofs == 0.
- Returns
- Returns 0 on success
- Returns < 0 on error
- Warning
- Read-only operations are thread-safe. This includes all
lite3_arr_get_xxx() funtions. Mixing reads and writes however is not thread-safe.
◆ lite3_ctx_arr_get_arr()
| static int lite3_ctx_arr_get_arr |
( |
lite3_ctx * |
ctx, |
|
|
size_t |
ofs, |
|
|
uint32_t |
index, |
|
|
size_t *__restrict |
out_ofs |
|
) |
| |
|
inlinestatic |
Get array by index.
- Returns
- 0 on success
-
< 0 on error
- Parameters
-
| [in] | ctx | context pointer |
| [in] | ofs | start offset (0 == root) |
| [in] | index | array index |
| [out] | out_ofs | array offset |
Definition at line 2008 of file lite3_context_api.h.
◆ lite3_ctx_arr_get_bool()
| static int lite3_ctx_arr_get_bool |
( |
lite3_ctx * |
ctx, |
|
|
size_t |
ofs, |
|
|
uint32_t |
index, |
|
|
bool * |
out |
|
) |
| |
|
inlinestatic |
Get boolean value by index.
- Returns
- 0 on success
-
< 0 on error
- Parameters
-
| [in] | ctx | context pointer |
| [in] | ofs | start offset (0 == root) |
| [in] | index | array index |
| [out] | out | boolean value |
Definition at line 1847 of file lite3_context_api.h.
◆ lite3_ctx_arr_get_bytes()
| static int lite3_ctx_arr_get_bytes |
( |
lite3_ctx * |
ctx, |
|
|
size_t |
ofs, |
|
|
uint32_t |
index, |
|
|
lite3_bytes * |
out |
|
) |
| |
|
inlinestatic |
Get bytes value by index.
- Returns
- 0 on success
-
< 0 on error
- Parameters
-
| [in] | ctx | context pointer |
| [in] | ofs | start offset (0 == root) |
| [in] | index | array index |
| [out] | out | bytes value |
Definition at line 1922 of file lite3_context_api.h.
◆ lite3_ctx_arr_get_f64()
| static int lite3_ctx_arr_get_f64 |
( |
lite3_ctx * |
ctx, |
|
|
size_t |
ofs, |
|
|
uint32_t |
index, |
|
|
double * |
out |
|
) |
| |
|
inlinestatic |
Get floating point value by index.
- Returns
- 0 on success
-
< 0 on error
- Parameters
-
| [in] | ctx | context pointer |
| [in] | ofs | start offset (0 == root) |
| [in] | index | array index |
| [out] | out | floating point value |
Definition at line 1897 of file lite3_context_api.h.
◆ lite3_ctx_arr_get_i64()
| static int lite3_ctx_arr_get_i64 |
( |
lite3_ctx * |
ctx, |
|
|
size_t |
ofs, |
|
|
uint32_t |
index, |
|
|
int64_t * |
out |
|
) |
| |
|
inlinestatic |
Get integer value by index.
- Returns
- 0 on success
-
< 0 on error
- Parameters
-
| [in] | ctx | context pointer |
| [in] | ofs | start offset (0 == root) |
| [in] | index | array index |
| [out] | out | integer value |
Definition at line 1872 of file lite3_context_api.h.
◆ lite3_ctx_arr_get_obj()
| static int lite3_ctx_arr_get_obj |
( |
lite3_ctx * |
ctx, |
|
|
size_t |
ofs, |
|
|
uint32_t |
index, |
|
|
size_t *__restrict |
out_ofs |
|
) |
| |
|
inlinestatic |
Get object by index.
- Returns
- 0 on success
-
< 0 on error
- Parameters
-
| [in] | ctx | context pointer |
| [in] | ofs | start offset (0 == root) |
| [in] | index | array index |
| [out] | out_ofs | object offset |
Definition at line 1983 of file lite3_context_api.h.
◆ lite3_ctx_arr_get_str()
| static int lite3_ctx_arr_get_str |
( |
lite3_ctx * |
ctx, |
|
|
size_t |
ofs, |
|
|
uint32_t |
index, |
|
|
lite3_str * |
out |
|
) |
| |
|
inlinestatic |
Get string value by index.
- Returns
- 0 on success
-
< 0 on error
- Parameters
-
| [in] | ctx | context pointer |
| [in] | ofs | start offset (0 == root) |
| [in] | index | array index |
| [out] | out | string value |
Definition at line 1952 of file lite3_context_api.h.