Adaptive Framework
0.9.0
|
Files | |
file | afw_yaml.h |
Header file for Adaptive Framework YAML. | |
Macros | |
#define | AFW_ERROR_RV_SOURCE_ID_Z_yaml_parser "yaml_parser" |
#define | AFW_ERROR_RV_SOURCE_ID_Z_yaml_token_type "yaml_token_type" |
#define | AFW_YAML_Q_CONTENT_TYPE "application/x-yaml" |
#define | AFW_YAML_S_CONTENT_TYPE afw_s_a_application_yaml |
#define | AFW_YAML_Q_CONTENT_TYPE_SHORT "yaml" |
#define | AFW_YAML_S_CONTENT_TYPE_SHORT afw_s_yaml |
Functions | |
void | afw_yaml_register (afw_xctx_t *xctx) |
Register YAML support. More... | |
const afw_utf8_t * | afw_yaml_from_error (afw_xctx_t *xctx) |
Convert error from xctx to a YAML object. More... | |
const afw_utf8_t * | afw_yaml_from_value (const afw_value_t *value, const afw_pool_t *p, afw_xctx_t *xctx) |
Convert an adaptive value to YAML. More... | |
const afw_value_t * | afw_yaml_to_value (const afw_memory_t *yaml, const afw_utf8_t *path, const afw_pool_t *p, afw_xctx_t *xctx) |
Convert YAML to an adaptive value. More... | |
const afw_object_t * | afw_yaml_to_object (const afw_memory_t *yaml, 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 YAML to adaptive object. More... | |
Adaptive Framework YAML support
#define AFW_ERROR_RV_SOURCE_ID_Z_yaml_parser "yaml_parser" |
yaml_parser rv source id
Definition at line 32 of file afw_yaml.h.
#define AFW_ERROR_RV_SOURCE_ID_Z_yaml_token_type "yaml_token_type" |
yaml_token_type rv source id
Definition at line 35 of file afw_yaml.h.
const afw_utf8_t* afw_yaml_from_error | ( | afw_xctx_t * | xctx | ) |
Convert error from xctx to a YAML object.
xctx | of caller. |
Definition at line 176 of file afw_yaml.c.
const afw_utf8_t* afw_yaml_from_value | ( | const afw_value_t * | value, |
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Convert an adaptive value to YAML.
value | |
p | to use. |
xctx | of caller. |
This function can be used for callbacks of type afw_utf8_from_value_t.
Definition at line 539 of file afw_yaml_from_value.c.
void afw_yaml_register | ( | afw_xctx_t * | xctx | ) |
Register YAML support.
xctx | of caller. |
This is called by afw_environment_register_core.c to register YAML support.
Definition at line 92 of file afw_yaml.c.
const afw_object_t* afw_yaml_to_object | ( | const afw_memory_t * | yaml, |
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 YAML to adaptive object.
raw | YAML 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 388 of file afw_yaml_to_value.c.
const afw_value_t* afw_yaml_to_value | ( | const afw_memory_t * | yaml, |
const afw_utf8_t * | path, | ||
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Convert YAML to an adaptive value.
yaml | YAML. |
path | Object path or NULL. |
object_id | Optional id of object if value is object or NULL. |
pool | to allocate memory on. |
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 YAML 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 338 of file afw_yaml_to_value.c.