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();
41 for (label i=0; i < len; ++i)
53 template<
class UnaryMatchPredicate,
class StringType>
56 const UnaryMatchPredicate& matcher,
57 const UList<StringType>&
input,
61 const label len =
input.size();
66 for (label i=0; i < len; ++i)
74 indices.resize(
count);
80 template<
class UnaryMatchPredicate,
class StringListType>
83 const UnaryMatchPredicate& matcher,
84 const StringListType&
input,
88 const label len =
input.size();
90 StringListType
output(len);
94 for (label i=0; i < len; ++i)
108 template<
class UnaryMatchPredicate,
class StringListType>
111 const UnaryMatchPredicate& matcher,
112 StringListType&
input,
116 const label len =
input.size();
119 for (label i=0; i < len; ++i)
134 template<
class StringListType,
class AccessOp>
137 const StringListType&
input,
138 const wordRes& allow,
143 const label len =
input.size();
145 if (allow.empty() && deny.empty())
153 for (label i=0; i < len; ++i)
155 const std::string& text = aop(
input[i]);
161 const auto result = allow.matched(text);
165 result == wordRe::LITERAL
167 : (result == wordRe::REGEX && !deny.match(text))
172 accept = !deny.match(text);
181 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.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
label firstMatchingString(const UnaryMatchPredicate &matcher, const UList< StringType > &input, const bool invert=false)
Find first list item that matches, -1 on failure.
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.