Plasma Engine  2.0
Loading...
Searching...
No Matches
plPathPatternFilter Struct Reference

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< plPathPatternm_ExcludePatterns
 
plDynamicArray< plPathPatternm_IncludePatterns
 

Detailed Description

A collection of plPathPatterns.

Member Function Documentation

◆ PassesFilters()

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.

◆ ReadConfigFile()

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.


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