![]() |
|
Structure for testing if a path matches a given sequence of path elements. More...
#include <ODIMPathMatcher.h>


Public Member Functions | |
| ODIMPathMatcher () | |
| Basic constructor. | |
| ODIMPathMatcher (const ODIMPathMatcher &matcher) | |
| Copy constructor. | |
| template<typename ... T> | |
| ODIMPathMatcher (const ODIMPathElem &elem, const T &... rest) | |
| ODIMPathMatcher (const std::string &path) | |
| Almost copy constructor. | |
| ODIMPathMatcher (const char *path) | |
| Almost copy constructor. | |
| bool | ensureLimitingSlash () |
| Resolves "where|where". | |
| bool | isLiteral () const |
| Checks if corresponds to a single path, implying that all the index ranges are singletons. | |
| void | extractPath (ODIMPath &path) const |
| Convert to a single path, assuming uniqueness. Future option: extract all the enumerated paths. | |
| bool | match (const rack::ODIMPath &path) const |
Match the leading part of path , if matcher starts with root. Else, match the trailing part. | |
| bool | matchHead (const rack::ODIMPath &path) const |
Match leading part of path. | |
| bool | matchTail (const rack::ODIMPath &path) const |
Match trailing part of path. | |
| bool | matchElem (const rack::ODIMPathElem &elem, bool defaultValue=true) const |
| Match single element. If matcher path does not contain it, return defaultValue. | |
Public Member Functions inherited from Path< ODIMPathElemMatcher > | |
| Path (const path_t &p) | |
| Copy constructor. | |
| Path (typename path_t::const_iterator it, typename path_t::const_iterator it2) | |
| Secondary copy constructor. Handy for creating a parent path, for example. | |
| Path (const path_t &arg, const TT &... args) | |
| Initialize with a path. | |
| Path (const std::string &arg, const TT &... args) | |
| Initialize with a path. | |
| Path (const char *arg, const TT &... args) | |
| Initialize with a path. | |
| virtual | ~Path () |
| Why the three above instead of this? | |
| void | set (const TT &... args) |
| void | append (const T2 &arg, const TT &... args) |
| Append path with element(s), path(s) or string(s). | |
| void | append (const path_t &p, const TT &... args) |
| void | append (char c, const TT &... args) |
| void | append (const char *arg, const TT &... args) |
| void | append (const std::string &arg, const TT &... args) |
| void | appendPath (const char *p) |
| Specialized handler for strings (note, possibly: elem_t==std:string) | |
| void | appendPath (const path_t &p) |
| void | appendElem (const elem_t &elem) |
| Main method for adding elements. | |
| bool | isRoot () const |
| Returns true, if the path as only one element which is empty. An empty path is not a root. | |
| bool | hasRoot () const |
| Returns true, if the path is not empty and the first element is empty. | |
| path_t & | ensureRoot () |
| Returns true, if the path is not empty and the first element is empty. | |
| void | trimHead (bool COMPLETE=false) |
| Removes leading empty elements. The resulting string presentation will not start with the separator. | |
| void | trimTail (bool COMPLETE=false) |
| Removes trailing empty elements. The resulting string presentation will not end with the separator. | |
| void | simplify () |
| ORIGINAL. Removes trailing empty elements, except for the root itself. | |
| void | simplifyHead () |
| Remove duplicates of empty elements from the start. | |
| void | simplifyTail () |
| Remove duplicates of empty elements from the end. | |
| path_t & | operator= (const path_t &p) |
| Assigns a path directly with std::list assignment. | |
| path_t & | operator= (const Path< T2 > &p) |
| Conversion from str path type. | |
| path_t & | operator= (const std::string &p) |
| path_t & | operator= (const char *p) |
| path_t & | operator<< (const elem_t &elem) |
| Append an element, unless empty string. | |
| path_t & | operator<< (const path_t &path) |
| path_t & | operator<< (const T2 &strlike) |
| path_t & | operator>> (elem_t &e) |
| Extract last element. | |
| virtual std::ostream & | toStream (std::ostream &ostr) const |
| Path is written like a list, adding the separator between items. Exception: root is displayed as separator. | |
| virtual std::string | str () const |
| virtual | operator std::string () const |
| std::ostream & | debug (std::ostream &ostr=std::cout) const |
Additional Inherited Members | |
Public Types inherited from Path< ODIMPathElemMatcher > | |
| typedef ODIMPathElemMatcher | elem_t |
| typedef Path< ODIMPathElemMatcher, '/', true, false, true > | path_t |
| typedef std::list< path_t > | list_t |
Public Attributes inherited from Path< ODIMPathElemMatcher > | |
| const PathSeparatorPolicy | separator |
Protected Member Functions inherited from Path< ODIMPathElemMatcher > | |
| void | append () |
| Terminal function for variadic templates. | |
| void | _appendPath (const std::string &p, size_t start=0) |
| "Default" append function. | |
Structure for testing if a path matches a given sequence of path elements.
Path will be matched from its start or end - not in the middle. Uses index range [index,indexMax] in testing path elements of same group.
| bool ensureLimitingSlash | ( | ) |
Resolves "where|where".
If neither end has an empty element (appearing as slash), add one, to root.
| void extractPath | ( | ODIMPath & | path | ) | const |
Convert to a single path, assuming uniqueness. Future option: extract all the enumerated paths.
Extracts a single, "deterministic" path only. TODO: enumerate, extract maximally N branches.
1.9.8