Adaptive Framework
0.9.0
|
Files | |
file | afw_object_path.h |
Header for Adaptive Object Path. | |
Data Structures | |
struct | afw_object_path_property_name_entry_s |
Property name path struct. More... | |
struct | afw_object_path_parsed_s |
Typedef for parsed object path. More... | |
Functions | |
const afw_value_t * | afw_object_path_property_name_list_get_property (const afw_object_t *object, const afw_object_path_property_name_entry_t *first_property_name, afw_xctx_t *xctx) |
Get object property value using property names. More... | |
const afw_utf8_t * | afw_object_path_make (const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, const afw_pool_t *p, afw_xctx_t *xctx) |
Construct an object path in a specified pool. More... | |
const afw_utf8_t * | afw_object_path_make_for_embedded (const afw_object_t *embedded_object, const afw_pool_t *p, afw_xctx_t *xctx) |
Construct the path for an embedded object. More... | |
const afw_utf8_t * | afw_object_path_make_property_name_expression (const afw_object_path_property_name_entry_t *first, const afw_pool_t *p, afw_xctx_t *xctx) |
Construct a property name expression from property name list. More... | |
const afw_object_path_parsed_t * | afw_object_path_parse (const afw_utf8_t *path, const afw_utf8_t *current_path, const afw_object_options_t *default_options, const afw_pool_t *p, afw_xctx_t *xctx) |
Parse an object value path in specific pool. More... | |
void | afw_object_path_parse_simple (const afw_utf8_t *path, const afw_utf8_t **adaptor_id, const afw_utf8_t **object_type_id, const afw_utf8_t **object_id, const afw_pool_t *p, afw_xctx_t *xctx) |
Parse simple path into ids. More... | |
const afw_object_t * | afw_object_path_parsed_to_object (const afw_object_path_parsed_t *parsed, const afw_pool_t *p, afw_xctx_t *xctx) |
Turn a parsed path into an object representation. More... | |
afw_boolean_t | afw_object_path_parsed_are_equivalent (const afw_object_path_parsed_t *parsed1, const afw_object_path_parsed_t *parsed2, afw_xctx_t *xctx) |
Determine if two parsed paths are equivalent. More... | |
afw_boolean_t | afw_object_path_are_equivalent (const afw_utf8_t *path1, const afw_utf8_t *path2, const afw_utf8_t *current_path, const afw_pool_t *p, afw_xctx_t *xctx) |
Determine if two paths are equivalent. More... | |
Provide adaptive object path support.
afw_boolean_t afw_object_path_are_equivalent | ( | const afw_utf8_t * | path1, |
const afw_utf8_t * | path2, | ||
const afw_utf8_t * | current_path, | ||
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Determine if two paths are equivalent.
path1 | parsed path. |
path2 | parsed path. |
current_path | used for resolving asterisks in path1 and path2 or NULL. |
p | to use while determining equivalence. |
xctx | of caller |
Definition at line 888 of file afw_object_path.c.
const afw_utf8_t* afw_object_path_make | ( | const afw_utf8_t * | adaptor_id, |
const afw_utf8_t * | object_type_id, | ||
const afw_utf8_t * | object_id, | ||
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Construct an object path in a specified pool.
adaptor_id | Adaptor id. |
object_type_id | Object type id. |
object_id | Object id. |
p | Pool return value will be placed in. |
xctx | of caller |
Definition at line 906 of file afw_object_path.c.
const afw_utf8_t* afw_object_path_make_for_embedded | ( | const afw_object_t * | embedded_object, |
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Construct the path for an embedded object.
embedded_object | object. |
p | Pool return value will be placed in. |
xctx | of caller |
If entity path is NULL or contains asterisks, NULL is returned.
Definition at line 951 of file afw_object_path.c.
const afw_utf8_t* afw_object_path_make_property_name_expression | ( | const afw_object_path_property_name_entry_t * | first, |
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Construct a property name expression from property name list.
first | property name entry. |
p | Pool return value will be placed in. |
xctx | of caller |
Definition at line 1001 of file afw_object_path.c.
const afw_object_path_parsed_t* afw_object_path_parse | ( | const afw_utf8_t * | path, |
const afw_utf8_t * | current_path, | ||
const afw_object_options_t * | default_options, | ||
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Parse an object value path in specific pool.
path | to parse. |
current_path | used for resolving asterisks in path or NULL. |
default_options | or NULL. |
p | to use for result. |
xctx | of caller |
Parse an local path.
Generally, a path is of the form:
/<adaptorId>/<objectType>/<objectId>
where <adaptorId>
is an adaptor id of the running instance, <objectType>
if the object type at path /<adaptorId>/_AdaptiveObjectType_/<objectType>
, and <objectId>
is the entity object id <entityObjectId>
followed by zero or more period "." <propertyName>
.
<objectType>
can also have an options part where the object type id is followed by a semicolon ";" and one or more <name>
with optional equal "=" <value>
separated with an ampersand "&". See afw_object_options.h for more information on options.
Local paths can be data type anyURI values. See data type anyURI for more information.
If current_path is specified, the path parameter can include asterisks that are replaced with corresponding parts of current_path. In this case, <adaptorId>
, <objectType>
, <entityObjectId>
, and <propertyName>
can be an asterisk "*" to use the corresponding part from the current_path, plus double asterisk "**" can be specified for the entire <objectId>
to use the entire <objectId>
from the current path. Also, <objectId>
can be specified alone without a preceding slash "/" when the <adaptorId>
and <objectType>
are the same as in the current path. No substitution occurs in the options part of <objectType>
.
Definition at line 655 of file afw_object_path.c.
void afw_object_path_parse_simple | ( | const afw_utf8_t * | path, |
const afw_utf8_t ** | adaptor_id, | ||
const afw_utf8_t ** | object_type_id, | ||
const afw_utf8_t ** | object_id, | ||
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Parse simple path into ids.
path | to parse. |
adaptor_id | return location. |
object_type_id | return location. |
object_id | return location. |
p | to use for result. |
xctx | of caller. |
This is a lightweight path parse that breaks the path into up into 3 parts that are separated by '/'. Each part will be uri decoded. This is not appropriate if parts contain multiple segments, so this should only be used for simple paths. Use afw_object_path_parse() for relative paths, object options, normalization, and to break apart dotted property names.
The returned values may point to locations in the path passed.
Definition at line 669 of file afw_object_path.c.
afw_boolean_t afw_object_path_parsed_are_equivalent | ( | const afw_object_path_parsed_t * | parsed1, |
const afw_object_path_parsed_t * | parsed2, | ||
afw_xctx_t * | xctx | ||
) |
Determine if two parsed paths are equivalent.
parsed1 | parsed path. |
parsed2 | parsed path. |
xctx | of caller |
Definition at line 829 of file afw_object_path.c.
const afw_object_t* afw_object_path_parsed_to_object | ( | const afw_object_path_parsed_t * | parsed, |
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Turn a parsed path into an object representation.
parsed | path. |
p | to use for result. |
xctx | of caller |
Definition at line 725 of file afw_object_path.c.
const afw_value_t* afw_object_path_property_name_list_get_property | ( | const afw_object_t * | object, |
const afw_object_path_property_name_entry_t * | first_property_name, | ||
afw_xctx_t * | xctx | ||
) |
Get object property value using property names.
object | containing first property. |
first_property_name | is first of list of names. |
xctx | of caller |
Definition at line 630 of file afw_object_path.c.