Loading...
Searching...
No Matches
wordRes::filter Struct Reference

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

#include <wordRes.H>

Public Member Functions

 filter (const UList< wordRe > &allow, const UList< wordRe > &deny) noexcept
 Construct with allow and deny matchers.
bool empty () const noexcept
 No filtering defined.
 operator bool () const noexcept
 True if filtering is defined.
bool operator() (const std::string &text) const
 Apply filter against specified text.

Detailed Description

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

An empty filter accepts everything. 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 274 of file wordRes.H.

Constructor & Destructor Documentation

◆ filter()

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

Construct with allow and deny matchers.

Definition at line 205 of file wordResI.H.

References Foam::noexcept.

Member Function Documentation

◆ empty()

bool empty ( ) const
inlinenoexcept

No filtering defined.

Definition at line 222 of file wordResI.H.

References Foam::noexcept.

Referenced by operator bool().

Here is the caller graph for this function:

◆ operator bool()

operator bool ( ) const
inlineexplicitnoexcept

True if filtering is defined.

Definition at line 293 of file wordRes.H.

References empty(), and Foam::noexcept.

Here is the call graph for this function:

◆ operator()()

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

Apply filter against specified text.

Returns
true if no filtering has been defined
true if matched but not blocked

Definition at line 234 of file wordResI.H.

References wordRe::LITERAL, wordRes::match(), wordRes::matched(), and wordRe::REGEX.

Here is the call graph for this function:

The documentation for this struct was generated from the following files:
  • src/OpenFOAM/primitives/strings/wordRes/wordRes.H
  • src/OpenFOAM/primitives/strings/wordRes/wordResI.H