![]() |
XII Release 0.1.0
|
A collection of xiiPathPatterns. More...
#include <PathPatternFilter.h>
Public Member Functions | |
xiiResult | ReadConfigFile (xiiStringView sFile, const xiiDynamicArray< xiiString > &preprocessorDefines) |
Reads all patterns from the given file. | |
void | AddFilter (xiiStringView sText, bool bIncludeFilter) |
Adds a pattern. | |
bool | PassesFilters (xiiStringView sText, xiiStringBuilder *pMatchingFilter=nullptr) const |
Determines whether the given text matches the filter patterns. | |
Public Attributes | |
xiiDynamicArray< xiiPathPattern > | m_ExcludePatterns |
xiiDynamicArray< xiiPathPattern > | m_IncludePatterns |
A collection of xiiPathPatterns.
bool xiiPathPatternFilter::PassesFilters | ( | xiiStringView | sText, |
xiiStringBuilder * | pMatchingFilter = nullptr ) const |
Determines whether the given text matches the filter patterns.
Include patterns take precedence over exclude patterns. If the text matches any include pattern, it passes the filter. Otherwise, if it matches any exclude pattern, it does not pass the filter. Otherwise, if it doesn't match any include or exclude pattern, it passes the filter, since it isn't explicitely ruled out.
xiiResult xiiPathPatternFilter::ReadConfigFile | ( | xiiStringView | sFile, |
const xiiDynamicArray< xiiString > & | preprocessorDefines ) |
Reads all patterns from the given file.
The file is parsed with a xiiPreprocessor, so may contain #include statements and such. Custom preprocessor definitions can be provided.
After preprocessing, every line represents a single pattern. Lines that contain '[INCLUDE]' or '[EXCLUDE]' are special and change whether the following lines are considered as include patterns or exclude patterns.