32 return NullObjectRef<wordRes>();
36inline Foam::label Foam::wordRes::first_match
39 const std::string& text,
44 for (
const wordRe& select : selectors)
46 if (select.match(text, literal))
59 const UList<wordRe>& selectors,
60 const std::string& text
65 for (
const wordRe& select : selectors)
69 if (
select.match(text,
true))
78 &&
select.match(text,
false)
93 return (first_match(*
this, text, literal) >= 0);
100 return found_matched(*
this, text);
104template<
class StringType>
111 const label len =
input.size();
116 for (label i=0; i < len; ++i)
134 return (wordRes::first_match(*
this, text) >= 0);
162 return allow_.empty();
167 return (allow_.empty() && deny_.empty());
173 return (wordRes::first_match(allow_, text) >= 0);
182 return (deny_.empty() || (wordRes::first_match(deny_, text) < 0));
184 else if (deny_.empty())
187 return (wordRes::first_match(allow_, text) >= 0);
192 const auto result = wordRes::found_matched(allow_, text);
201 && (wordRes::first_match(deny_, text) < 0)
void resize(const label len)
Adjust allocated size of list.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Ostream & operator()() const
Output stream (master only).
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
compOption
Enumeration with compile options.
@ REGEX
Regular expression.
@ UNKNOWN
Unknown content (for return value).
A List of wordRe with additional matching capabilities.
wordRe::compOption matched(const std::string &text) const
Smart match in the list of matchers, returning the match type.
labelList matching(const UList< StringType > &input, const bool invert=false) const
Return list indices for all matches.
static const wordRes & null()
Return a null wordRes - a reference to the NullObject.
bool match(const std::string &text, bool literal=false) const
Smart match as literal or regex, stopping on the first match.
List< bool > select(const label n, const labelUList &locations)
static Istream & input(Istream &is, IntRange< T > &range)
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
Functor wrapper of allow/deny lists of wordRe for filtering.
bool empty() const noexcept
Nothing defined.
Functor wrapper of a list of wordRe for matching.
bool empty() const noexcept
Nothing defined.