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)
76 output[
count] = input[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)
103 input[
count] = std::move(input[i]);
List< label > labelList
A List of labels.
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.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
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 findMatchingStrings(const UnaryMatchPredicate &matcher, const UList< StringType > &input, const bool invert=false)
Extract list indices for all matches.