Go to the documentation of this file.
31 template<
class UnaryMatchPredicate,
class StringType>
34 const UnaryMatchPredicate& matcher,
35 const UList<StringType>&
input,
39 const label len =
input.size();
44 for (label i=0; i < len; ++i)
52 indices.resize(
count);
58 template<
class UnaryMatchPredicate,
class StringListType>
61 const UnaryMatchPredicate& matcher,
62 const StringListType&
input,
66 const label len =
input.size();
68 StringListType
output(len);
72 for (label i=0; i < len; ++i)
86 template<
class UnaryMatchPredicate,
class StringListType>
89 const UnaryMatchPredicate& matcher,
90 StringListType&
input,
94 const label len =
input.size();
97 for (label i=0; i < len; ++i)
112 template<
class StringListType,
class AccessOp>
115 const StringListType&
input,
116 const wordRes& allow,
121 const label len =
input.size();
123 if (allow.empty() && deny.empty())
131 for (label i=0; i < len; ++i)
133 const std::string& text = aop(
input[i]);
139 const auto result = allow.matched(text);
143 result == wordRe::LITERAL
145 : (result == wordRe::REGEX && !deny.match(text))
150 accept = !deny.match(text);
159 indices.resize(
count);
List< label > labelList
A List of labels.
static Ostream & output(Ostream &os, const IntRange< T > &range)
StringListType subsetMatchingStrings(const UnaryMatchPredicate &matcher, const StringListType &input, const bool invert=false)
Extract elements of StringList when regular expression matches.
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
labelList findMatching(const StringListType &input, const wordRes &allow, const wordRes &deny=wordRes(), AccessOp aop=noOp())
Return ids for items with matching names.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
void inplaceSubsetMatchingStrings(const UnaryMatchPredicate &matcher, StringListType &input, const bool invert=false)
Inplace extract elements of StringList when regular expression matches.
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
static Istream & input(Istream &is, IntRange< T > &range)
labelList findMatchingStrings(const UnaryMatchPredicate &matcher, const UList< StringType > &input, const bool invert=false)
Extract list indices for all matches.