Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Files | Data Structures | Functions

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_tafw_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_tafw_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_tafw_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_tafw_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_tafw_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_tafw_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...
 

Detailed Description

Provide adaptive object path support.

Function Documentation

◆ afw_object_path_are_equivalent()

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.

Parameters
path1parsed path.
path2parsed path.
current_pathused for resolving asterisks in path1 and path2 or NULL.
pto use while determining equivalence.
xctxof caller
Returns
boolean result of equivalent test.

Definition at line 888 of file afw_object_path.c.

◆ afw_object_path_make()

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.

Parameters
adaptor_idAdaptor id.
object_type_idObject type id.
object_idObject id.
pPool return value will be placed in.
xctxof caller
Returns
pointer to object path.

Definition at line 906 of file afw_object_path.c.

◆ afw_object_path_make_for_embedded()

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.

Parameters
embedded_objectobject.
pPool return value will be placed in.
xctxof caller
Returns
path or NULL.

If entity path is NULL or contains asterisks, NULL is returned.

Definition at line 951 of file afw_object_path.c.

◆ afw_object_path_make_property_name_expression()

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.

Parameters
firstproperty name entry.
pPool return value will be placed in.
xctxof caller
Returns
pointer to object path.
Todo:
FIXME: Improve to generate ['name'] when needed.

Definition at line 1001 of file afw_object_path.c.

◆ afw_object_path_parse()

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.

Parameters
pathto parse.
current_pathused for resolving asterisks in path or NULL.
default_optionsor NULL.
pto use for result.
xctxof caller
Returns
Parsed path or NULL if path is invalid.

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.

◆ afw_object_path_parse_simple()

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.

Parameters
pathto parse.
adaptor_idreturn location.
object_type_idreturn location.
object_idreturn location.
pto use for result.
xctxof 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_object_path_parsed_are_equivalent()

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.

Parameters
parsed1parsed path.
parsed2parsed path.
xctxof caller
Returns
boolean result of equivalent test.

Definition at line 829 of file afw_object_path.c.

◆ afw_object_path_parsed_to_object()

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.

Parameters
parsedpath.
pto use for result.
xctxof caller
Returns
AdaptiveParsedURI representation of parsed path.

Definition at line 725 of file afw_object_path.c.

◆ afw_object_path_property_name_list_get_property()

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.

Parameters
objectcontaining first property.
first_property_nameis first of list of names.
xctxof caller
Returns
value or NULL if not found.

Definition at line 630 of file afw_object_path.c.