38 #ifndef Foam_wordRes_H 39 #define Foam_wordRes_H 60 inline static label first_match
63 const std::string& text,
64 const bool literal=
false 75 const std::string& text
111 inline bool match(
const std::string& text,
bool literal=
false)
const;
126 template<
class StringType>
137 inline bool operator()(
const std::string& text)
const;
153 inline bool operator()(
const std::string& text)
const;
187 inline bool operator()(
const std::string& text)
const;
filter(const UList< wordRe > &allow, const UList< wordRe > &deny)
Construct with 'allow' and 'deny' matchers.
labelList matching(const UList< StringType > &input, const bool invert=false) const
Return list indices for all matches.
wordRe::compOption matched(const std::string &text) const
Smart match in the list of matchers, returning the match type.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
matcher(const UList< wordRe > &allow)
Construct with 'allow' matcher.
compOption
Enumeration with compile options.
Functor wrapper of allow/deny lists of wordRe for filtering.
static const wordRes & null()
Return a null wordRes - a reference to the NullObject.
static Istream & input(Istream &is, IntRange< T > &range)
A List of wordRe with additional matching capabilities.
bool empty() const noexcept
Nothing defined.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
bool operator()(const std::string &text) const
True if text matches ANY of the entries.
bool match(const std::string &text, bool literal=false) const
Smart match as literal or regex, stopping on the first match.
Functor wrapper of a list of wordRe for matching.
~wordRes()=default
Destructor.
void uniq()
Filter out duplicate entries (inplace).
bool operator()(const std::string &text) const
Identical to match(), for use as a predicate.
bool operator()(const std::string &text) const
True if matched but not blocked.
bool empty() const noexcept
Nothing defined.