wordRes::filter Struct Reference

Functor wrapper of allow/deny lists of wordRe for filtering. More...

Public Member Functions

 filter (const UList< wordRe > &allow, const UList< wordRe > &deny)
 Construct with 'allow' and 'deny' matchers. More...
 
bool empty () const noexcept
 Nothing defined. More...
 
bool operator() (const std::string &text) const
 True if matched but not blocked. More...
 

Detailed Description

Functor wrapper of allow/deny lists of wordRe for filtering.

An empty 'allow' accepts everything not in 'deny'. A literal 'allow' match has higher priority than any 'deny'. A regex 'allow' match has lower priority than any 'deny'.

Example (when applied to a list of words),

   input:  ( abc apple test other val val1 val2 wall wall1 wall2 )
   allow:  ( abc def "t.*" other val val1 "wall.*" )
   deny:   ( "[ab].*" "t.*" other "val[0-9]" wall )

   result:  (abc other val val1 wall1 wall2)

Definition at line 173 of file wordRes.H.

Constructor & Destructor Documentation

◆ filter()

filter ( const UList< wordRe > &  allow,
const UList< wordRe > &  deny 
)
inline

Construct with 'allow' and 'deny' matchers.

Definition at line 149 of file wordResI.H.

Member Function Documentation

◆ empty()

bool empty ( ) const
inlinenoexcept

Nothing defined.

Definition at line 165 of file wordResI.H.

◆ operator()()

bool operator() ( const std::string &  text) const
inline

True if matched but not blocked.

Definition at line 177 of file wordResI.H.

References wordRe::LITERAL, and wordRe::REGEX.


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