![]() |
Plasma Engine
2.0
|
A collection of plPathPatterns. More...
#include <PathPatternFilter.h>
Public Member Functions | |
plResult | ReadConfigFile (plStringView sFile, const plDynamicArray< plString > &preprocessorDefines) |
Reads all patterns from the given file. | |
void | AddFilter (plStringView sText, bool bIncludeFilter) |
Adds a pattern. | |
bool | PassesFilters (plStringView sText) const |
Determines whether the given text matches the filter patterns. | |
Public Attributes | |
plDynamicArray< plPathPattern > | m_ExcludePatterns |
plDynamicArray< plPathPattern > | m_IncludePatterns |
A collection of plPathPatterns.
bool plPathPatternFilter::PassesFilters | ( | plStringView | sText | ) | 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.
plResult plPathPatternFilter::ReadConfigFile | ( | plStringView | sFile, |
const plDynamicArray< plString > & | preprocessorDefines ) |
Reads all patterns from the given file.
The file is parsed with an plPreprocessor, 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.