Adaptive Framework
0.9.0
|
Files | |
file | afw_query_criteria.h |
AFW query criteria header. | |
Data Structures | |
struct | afw_query_criteria_sort_entry_s |
struct | afw_query_criteria_filter_entry_s |
Parsed filter entry from query string. More... | |
struct | afw_query_criteria_s |
Parsed query criteria. More... | |
Macros | |
#define | AFW_QUERY_CRITERIA_TRUE ((void *) 1) |
#define | AFW_QUERY_CRITERIA_FALSE ((void *) 0) |
Typedefs | |
typedef struct afw_query_criteria_sort_entry_s | afw_query_criteria_sort_entry_t |
Enumerations | |
enum | afw_query_criteria_style_t { afw_query_criteria_style_operator = 0 , afw_query_criteria_style_operator_long = 1 , afw_query_criteria_style_semicolon_comma = 2 , afw_query_criteria_style_function = 3 , afw_query_criteria_style_max = 3 } |
Query string style. More... | |
enum | afw_query_criteria_filter_op_id_t { afw_query_criteria_filter_op_id_na , afw_query_criteria_filter_op_id_eq , afw_query_criteria_filter_op_id_lt , afw_query_criteria_filter_op_id_le , afw_query_criteria_filter_op_id_match , afw_query_criteria_filter_op_id_contains , afw_query_criteria_filter_op_id_in , afw_query_criteria_filter_op_id_ne , afw_query_criteria_filter_op_id_ge , afw_query_criteria_filter_op_id_gt , afw_query_criteria_filter_op_id_differ , afw_query_criteria_filter_op_id_excludes , afw_query_criteria_filter_op_id_out , afw_query_criteria_filter_op_id_and , afw_query_criteria_filter_op_id_or } |
All property_name parameters can use dotted notation to refer to properties of embedded objects.
#define AFW_QUERY_CRITERIA_FALSE ((void *) 0) |
afw_query_criteria_filter_entry_t * of 1 indicates fail.
Definition at line 130 of file afw_query_criteria.h.
#define AFW_QUERY_CRITERIA_TRUE ((void *) 1) |
afw_query_criteria_filter_entry_t * of 1 indicates success.
Definition at line 127 of file afw_query_criteria.h.
typedef struct afw_query_criteria_sort_entry_s afw_query_criteria_sort_entry_t |
Typedef for a query criteria sort entry.
Definition at line 1 of file afw_query_criteria.h.
Enum for query criteria operators.
Definition at line 70 of file afw_query_criteria.h.
Query string style.
The style of the query string produced. All of the styles are appropriately url encoded.
0 - "name=op=value" where "=op=" will be "==", "!=", "=ge=", etc. with conjunctions "&" (and) and "|" (or). Parentheses are placed around each group of like conjunctions except for outer "&". (default)
1 - the same as 1 with "=gte=" instead of "=ge=", "=lte=" instead of "=le=", "=eq=" instead of "=", and "=ne=" instead of '!='.
2 - similar to 1 with ';' for '&' and ',' for '|'.
3 - comparisons "op(name,value)" where "op" will be "eq", "ne", "ge", ..., plus conjunctions "and(list)" and "or(list)" where "list" is a comma separated list of any comparison or conjunction.
Definition at line 52 of file afw_query_criteria.h.
const afw_query_criteria_t* afw_query_criteria_parse_AdaptiveQueryCriteria_object | ( | const afw_object_t * | query_object, |
const afw_object_type_t * | object_type, | ||
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Parse URI encoded query string.
query_object | is an AdaptiveQueryCriteria object. |
object_type | to use for adapting values or NULL. |
p | to use for result. |
xctx | of caller. |
FIXME these comments are incorrect. Inspiration came from here.
Query string is parsed based on: Resource Query Language (RQL)
which is a superset of: FIQL: The Feed Item Query Language draft-nottingham-atompub-fiql-00
to produce a afw_query_criteria_filter_entry_t.
Definition at line 1975 of file afw_query_criteria.c.
const afw_query_criteria_t* afw_query_criteria_parse_url_encoded_rql_string | ( | const afw_utf8_t * | url_encoded_rql_string, |
const afw_object_type_t * | object_type, | ||
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Parse URI encoded RQL query string.
url_encoded_rql_string | URL encoded RQL string. |
object_type | to use for adapting values or NULL. |
p | to use for result. |
xctx | of caller. |
FIXME these comments are incorrect. Inspiration came from here.
Query string is parsed based on: Resource Query Language (RQL)
which is a superset of: FIQL: The Feed Item Query Language draft-nottingham-atompub-fiql-00
to produce a afw_query_criteria_filter_entry_t.
Definition at line 1863 of file afw_query_criteria.c.
afw_boolean_t afw_query_criteria_test_object | ( | const afw_object_t * | obj, |
const afw_query_criteria_t * | criteria, | ||
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Test object against query criteria.
obj | Object to be tested. |
criteria | Parsed query criteria. |
p | to use. |
xctx | of caller. |
Definition at line 2072 of file afw_query_criteria.c.
const afw_object_t* afw_query_criteria_to_AdaptiveQueryCriteria_object | ( | const afw_query_criteria_t * | criteria, |
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Convert query criteria to a AdaptiveQueryCriteria object.
criteria | produced by a afw_query_criteria_parse_*() functions. |
p | to use for result. |
xctx | of caller. |
Definition at line 2244 of file afw_query_criteria.c.
const afw_utf8_t* afw_query_criteria_to_query_string | ( | const afw_query_criteria_t * | criteria, |
afw_query_criteria_style_t | style, | ||
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Convert query criteria to query string.
criteria | produced by a afw_query_criteria_parse_*() functions. |
style | of query string to produce. |
p | to use for result. |
xctx | of caller. |
Definition at line 2492 of file afw_query_criteria.c.