![]() |
Lumiera 0.pre.04
»edit your freedom«
|
Namespaces | |
| namespace | anonymous_namespace{query-util.cpp} |
| namespace | test |
Functions | |
| void | normaliseID (string &id) |
| ensure standard format for a given id string. | |
| string | extractID (Symbol sym, const string &termString) |
| (preliminary) helper: instead of really parsing and evaluating the terms, just do a regular expression match to extract the literal argument behind the given predicate symbol. | |
| string | removeTerm (Symbol sym, string &queryString) |
| (preliminary) helper: cut a term with the given symbol. | |
| bool | hasTerm (Symbol sym, string const &queryString) |
| uint | countPred (const string &) |
| count the top-level predicates in the query string. | |
| string | appendTerms (string const &pred1, string const &pred2) |
| template<typename TY > | |
| const string | buildTypeID () |
| void normaliseID | ( | string & | id | ) |
ensure standard format for a given id string.
Trim, sanitise and ensure the first letter is lower case.
Definition at line 52 of file query-util.cpp.
References normaliseID(), and util::sanitise().
Referenced by buildTypeID(), QueryUtils_test::check_normaliseID(), and normaliseID().
Here is the call graph for this function:
Here is the caller graph for this function:| string extractID | ( | Symbol | sym, |
| const string & | termString | ||
| ) |
(preliminary) helper: instead of really parsing and evaluating the terms, just do a regular expression match to extract the literal argument behind the given predicate symbol.
e.g calling extractID ("stream", "id(abc), stream(mpeg)") yields "mpeg"
Definition at line 92 of file query-util.cpp.
References extractID().
Referenced by QueryUtils_test::check_extractID(), Query< RES >::Builder::extractID(), and extractID().
Here is the call graph for this function:
Here is the caller graph for this function:| string removeTerm | ( | Symbol | sym, |
| string & | queryString | ||
| ) |
(preliminary) helper: cut a term with the given symbol.
The term is matched, removed from the original string and returned
Definition at line 109 of file query-util.cpp.
References removeTerm().
Referenced by QueryUtils_test::CHECK_removeTerm(), removeTerm(), and Query< RES >::Builder::removeTerm().
Here is the call graph for this function:
Here is the caller graph for this function:| bool hasTerm | ( | Symbol | sym, |
| string const & | queryString | ||
| ) |
Definition at line 124 of file query-util.cpp.
Referenced by Query< RES >::usesPredicate().
Here is the caller graph for this function:| uint countPred | ( | const string & | q | ) |
count the top-level predicates in the query string.
usable for ordering queries, as more predicates usually mean more conditions, i.e. more constriction
Definition at line 137 of file query-util.cpp.
Referenced by QueryUtils_test::check_countPred(), and QueryText::degree_of_constriction().
Here is the caller graph for this function:| string appendTerms | ( | string const & | pred1, |
| string const & | pred2 | ||
| ) |
Definition at line 152 of file query-util.cpp.
Referenced by Query< RES >::Builder::prependConditions(), and Query< RES >::Builder::withConditions().
Here is the caller graph for this function:| const string buildTypeID | ( | ) |
Definition at line 68 of file query-util.hpp.
References normaliseID().
Here is the call graph for this function: