Adaptive Framework
0.9.0
|
Files | |
file | afw_ubjson.h |
Header file for Adaptive Framework UBJSON. | |
Macros | |
#define | AFW_ERROR_RV_SOURCE_ID_Z_ubjson_marker "ubjson_marker" |
#define | AFW_UBJSON_Q_CONTENT_TYPE "application/ubjson" |
#define | AFW_UBJSON_S_CONTENT_TYPE afw_s_a_application_ubjson |
#define | AFW_UBJSON_Q_CONTENT_TYPE_SHORT "ubjson" |
#define | AFW_UBJSON_S_CONTENT_TYPE_SHORT afw_s_ubjson |
#define | AFW_UBJSON_MARKER_NULL 'Z' |
#define | AFW_UBJSON_MARKER_NOOP 'N' |
#define | AFW_UBJSON_MARKER_TRUE 'T' |
#define | AFW_UBJSON_MARKER_FALSE 'F' |
#define | AFW_UBJSON_MARKER_INT8 'i' |
#define | AFW_UBJSON_MARKER_UINT8 'U' |
#define | AFW_UBJSON_MARKER_INT16 'I' |
#define | AFW_UBJSON_MARKER_INT32 'l' |
#define | AFW_UBJSON_MARKER_INT64 'L' |
#define | AFW_UBJSON_MARKER_FLOAT32 'd' |
#define | AFW_UBJSON_MARKER_FLOAT64 'D' |
#define | AFW_UBJSON_MARKER_HIGH_PRECISION 'H' |
#define | AFW_UBJSON_MARKER_CHAR 'C' |
#define | AFW_UBJSON_MARKER_STRING 'S' |
#define | AFW_UBJSON_MARKER_ARRAY '[' |
#define | AFW_UBJSON_MARKER_ARRAY_ ']' |
#define | AFW_UBJSON_MARKER_OBJECT '{' |
#define | AFW_UBJSON_MARKER_OBJECT_ '}' |
#define | AFW_UBJSON_MARKER_TYPE '$' |
#define | AFW_UBJSON_MARKER_COUNT '#' |
#define | AFW_UBJSON_BYTES_CHAR 1 |
#define | AFW_UBJSON_BYTES_INT8 1 |
#define | AFW_UBJSON_BYTES_UINT8 1 |
#define | AFW_UBJSON_BYTES_INT16 2 |
#define | AFW_UBJSON_BYTES_INT32 4 |
#define | AFW_UBJSON_BYTES_INT64 8 |
#define | AFW_UBJSON_BYTES_FLOAT32 4 |
#define | AFW_UBJSON_BYTES_FLOAT64 8 |
Functions | |
const afw_utf8_t * | afw_ubjson_from_error (afw_xctx_t *xctx) |
Convert error from xctx to a UBJSON object. More... | |
const afw_memory_t * | afw_ubjson_from_value (const afw_value_t *value, const afw_pool_t *pool, afw_xctx_t *xctx) |
Convert an adaptive value to UBJSON. More... | |
const afw_value_t * | afw_ubjson_to_value (const afw_memory_t *ubjson, const afw_utf8_t *path, const afw_pool_t *pool, afw_xctx_t *xctx) |
Convert UBJSON to an adaptive value. More... | |
const afw_object_t * | afw_ubjson_to_object (const afw_memory_t *ubjson, const afw_utf8_t *source_location, const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, afw_boolean_t cede_p, const afw_pool_t *p, afw_xctx_t *xctx) |
Convert from UBJSON to adaptive object. More... | |
Variables | |
const int | AFW_UBJSON_SIZE [] |
Adaptive Framework UBJSON support.
#define AFW_ERROR_RV_SOURCE_ID_Z_ubjson_marker "ubjson_marker" |
ubjson_marker rv source id
Definition at line 31 of file afw_ubjson.h.
const afw_utf8_t* afw_ubjson_from_error | ( | afw_xctx_t * | xctx | ) |
Convert error from xctx to a UBJSON object.
xctx | of caller. |
const afw_memory_t* afw_ubjson_from_value | ( | const afw_value_t * | value, |
const afw_pool_t * | pool, | ||
afw_xctx_t * | xctx | ||
) |
Convert an adaptive value to UBJSON.
value | |
xctx | of caller. |
This function can be used for callbacks of type afw_utf8_from_value_t.
Definition at line 483 of file afw_ubjson_from_value.c.
const afw_object_t* afw_ubjson_to_object | ( | const afw_memory_t * | ubjson, |
const afw_utf8_t * | source_location, | ||
const afw_utf8_t * | adaptor_id, | ||
const afw_utf8_t * | object_type_id, | ||
const afw_utf8_t * | object_id, | ||
afw_boolean_t | cede_p, | ||
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Convert from UBJSON to adaptive object.
raw | UBJSON to convert. |
source_location | or NULL. |
adaptor_id | to use for created object. |
object_type_id | to use for created object. |
object_id | to use for created object. |
cede_p | if true, cede control of p to the created object. |
p | to use. |
xctx | of caller. |
Definition at line 483 of file afw_ubjson_to_value.c.
const afw_value_t* afw_ubjson_to_value | ( | const afw_memory_t * | ubjson, |
const afw_utf8_t * | path, | ||
const afw_pool_t * | pool, | ||
afw_xctx_t * | xctx | ||
) |
Convert UBJSON to an adaptive value.
ubjson | UBJSON. |
path | Object path or NULL. |
object_id | Optional id of object if value is object or NULL. |
pool | to use for memory allocation. |
xctx | of caller. |
This function can be used for callbacks of type afw_utf8_to_value_t.
The path parameter is only used if the UBJSON being parsed is an object entity.
The path must be of the form /<adaptor id>/<object type>/<id>
. This path is parsed to provide return values for the object's afw_object_meta_get_object_id(), afw_object_meta_get_path(), and afw_object_get_object_type() methods.
Definition at line 455 of file afw_ubjson_to_value.c.