![]() |
Kinetis Bootloader Host
2.0.0
Host Tools for Kinetis devices
|
Matches strings using a series of include and exclude glob patterns. More...
#include <ExcludesListMatcher.h>
Inheritance diagram for elftosb::ExcludesListMatcher:
Collaboration diagram for elftosb::ExcludesListMatcher:Classes | |
| struct | glob_list_item_t |
| Information about one glob pattern entry in a match list. More... | |
Public Member Functions | |
| ExcludesListMatcher () | |
| Default constructor. | |
| ~ExcludesListMatcher () | |
| Destructor. | |
| virtual bool | match (const std::string &testValue) |
| Performs a single string match test against testValue. More... | |
Pattern list | |
| void | addPattern (bool isInclude, const std::string &pattern) |
| Add one include or exclude pattern to the end of the match list. More... | |
Public Member Functions inherited from elftosb::GlobMatcher | |
| GlobMatcher (const std::string &pattern) | |
| Constructor. | |
Protected Types | |
| typedef std::vector< glob_list_item_t > | glob_list_t |
Protected Attributes | |
| glob_list_t | m_patterns |
| Ordered list of include and exclude patterns. | |
Protected Attributes inherited from elftosb::GlobMatcher | |
| std::string | m_pattern |
| The glob pattern to match against. | |
Additional Inherited Members | |
Protected Member Functions inherited from elftosb::GlobMatcher | |
| bool | globMatch (const char *str, const char *p) |
| Glob implementation. More... | |
Matches strings using a series of include and exclude glob patterns.
This string matcher class uses a sequential, ordered list of glob patterns to determine whether a string matches. Attached to each pattern is an include/exclude action. The patterns in the list effectively form a Boolean expression. Includes act as an OR operator while excludes act as an AND NOT operator.
Examples (plus prefix is include, minus prefix is exclude):
The only reason for inheriting from GlobMatcher is so we can access the protected globMatch() method.
| struct elftosb::ExcludesListMatcher::glob_list_item_t |
| void ExcludesListMatcher::addPattern | ( | bool | isInclude, |
| const std::string & | pattern | ||
| ) |
Add one include or exclude pattern to the end of the match list.
| isInclude | True if this pattern is an include, false if it is an exclude. |
| pattern | String containing the glob pattern. |
|
virtual |
Performs a single string match test against testValue.
If there are no entries in the match list, the match fails.
| testValue | The string to match against the pattern list. |
| true | The testValue argument matches. |
| false | No match was made against the argument. |
Reimplemented from elftosb::GlobMatcher.