XII Release 0.1.0
Loading...
Searching...
No Matches
xiiPathPatternFilter Struct Reference

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< xiiPathPatternm_ExcludePatterns
 
xiiDynamicArray< xiiPathPatternm_IncludePatterns
 

Detailed Description

A collection of xiiPathPatterns.

Member Function Documentation

◆ PassesFilters()

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.

◆ ReadConfigFile()

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.


The documentation for this struct was generated from the following files: