Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
afw_object_path.h
Go to the documentation of this file.
1 // See the 'COPYING' file in the project root for licensing information.
2 /*
3  * Adaptive Framework Adaptive Object Path
4  *
5  * Copyright (c) 2010-2023 Clemson University
6  *
7  */
8 
9 #ifndef __AFW_OBJECT_PATH_H
10 #define __AFW_OBJECT_PATH_H
11 
12 #include "afw_interface.h"
13 
28 
32  afw_utf8_t property_name;
33 };
34 
35 
43 
44  /* @brief Copy of path passed to afw_object_path_parse(). */
45  afw_utf8_t original_path;
46 
47  /* @brief Normalized path. */
48  afw_utf8_t normalized_path;
49 
50  /* @brief Entity part of normalized path. */
51  afw_utf8_t entity_path;
52 
53  /* @brief `<adaptor_id>` */
54  afw_utf8_t adaptor_id;
55 
56  /* @brief `<object_type_id>` */
57  afw_utf8_t object_type_id;
58 
59  /* @brief `<object_id>` */
60  afw_utf8_t entity_object_id;
61 
62  /* @brief `<object_id>` plus any dotted property names. NOT URI DECODED. */
63  afw_utf8_t undecoded_object_id;
64 
65  /* @brief List of `<property_name>` if uri has dotted property names. */
66  const afw_object_path_property_name_entry_t *first_property_name;
67 
68  /* @brief Options object or NULL. See afw_object_options.h. */
69  const afw_object_t *options_object;
70 
71  /* @brief Options based on options_object or NULL. */
72  const afw_object_options_t *options;
73 
74  /* @brief Current path was used for substitutions. */
75  afw_boolean_t substitution_occurred;
76 
77  /* @brief Adaptor id was substituted from current path. */
78  afw_boolean_t substituted_adaptor_id;
79 
80  /* @brief Object type id was substituted from current path. */
81  afw_boolean_t substituted_object_type_id;
82 
83  /* @brief Entire object id was substituted from current path. */
84  afw_boolean_t substituted_entire_object_id;
85 
86  /* @brief Entity object id was substituted from current path. */
87  afw_boolean_t substituted_entity_object_id;
88 
89  /* @brief At least one property name was substituted from current path. */
90  afw_boolean_t substituted_property_name;
91 
92  /* @brief At least one property name was substituted from current path. */
93  afw_boolean_t contains_unresolved_substitutions;
94 };
95 
96 
104 AFW_DECLARE(const afw_value_t *)
106  const afw_object_t *object,
107  const afw_object_path_property_name_entry_t *first_property_name,
108  afw_xctx_t *xctx);
109 
110 
120 AFW_DECLARE(const afw_utf8_t *)
122  const afw_utf8_t *adaptor_id,
123  const afw_utf8_t *object_type_id,
124  const afw_utf8_t *object_id,
125  const afw_pool_t *p,
126  afw_xctx_t *xctx);
127 
128 
138 AFW_DECLARE(const afw_utf8_t *)
140  const afw_object_t *embedded_object,
141  const afw_pool_t *p,
142  afw_xctx_t *xctx);
143 
144 
152 AFW_DECLARE(const afw_utf8_t *)
155  const afw_pool_t *p,
156  afw_xctx_t *xctx);
157 
158 
199  const afw_utf8_t *path,
200  const afw_utf8_t *current_path,
201  const afw_object_options_t *default_options,
202  const afw_pool_t *p,
203  afw_xctx_t *xctx);
204 
205 
223 AFW_DECLARE(void)
225  const afw_utf8_t *path,
226  const afw_utf8_t * *adaptor_id,
227  const afw_utf8_t * *object_type_id,
228  const afw_utf8_t * *object_id,
229  const afw_pool_t *p,
230  afw_xctx_t *xctx);
231 
232 
240 AFW_DECLARE(const afw_object_t *)
242  const afw_object_path_parsed_t *parsed,
243  const afw_pool_t *p,
244  afw_xctx_t *xctx);
245 
246 
256  const afw_object_path_parsed_t *parsed1,
257  const afw_object_path_parsed_t *parsed2,
258  afw_xctx_t *xctx);
259 
260 
272  const afw_utf8_t *path1,
273  const afw_utf8_t *path2,
274  const afw_utf8_t *current_path,
275  const afw_pool_t *p,
276  afw_xctx_t *xctx);
277 
278 
279 AFW_END_DECLARES
280 
283 #endif /* __AFW_OBJECT_PATH_H */
#define AFW_BEGIN_DECLARES
#define AFW_DECLARE(type)
Declare a public afw function.
Interfaceafw_interface header.
_Bool afw_boolean_t
Definition: afw_common.h:373
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.
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.
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.
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.
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.
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.
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.
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.
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.
Struct for object processing options.
Typedef for parsed object path.
Property name path struct.
Interface afw_object public struct.
Interface afw_pool public struct.
NFC normalized UTF-8 string.
Definition: afw_common.h:545
Interface afw_value public struct.
Interface afw_xctx public struct.