44#ifndef Foam_stringListOps_H
45#define Foam_stringListOps_H
57 template<
class UnaryMatchPredicate,
class StringType>
60 const UnaryMatchPredicate& matcher,
74 template<
class UnaryMatchPredicate,
class StringType>
77 const UnaryMatchPredicate& matcher,
85 template<
class StringType>
99 template<
class StringType>
102 const keyType& matcher,
103 const UList<StringType>& input,
118 template<
class StringType>
121 const wordRe& matcher,
122 const UList<StringType>& input,
132 template<
class StringType>
145 template<
class StringType>
166 template<
class UnaryMatchPredicate,
class StringListType>
169 const UnaryMatchPredicate& matcher,
170 const StringListType& input,
177 template<
class StringListType>
181 const StringListType& input,
191 template<
class StringListType>
195 const StringListType& input,
209 template<
class StringListType>
212 const wordRe& matcher,
213 const StringListType& input,
222 template<
class StringListType>
225 const wordRes& matcher,
226 const StringListType& input,
236 template<
class StringListType>
240 const StringListType& input,
252 template<
class UnaryMatchPredicate,
class StringListType>
255 const UnaryMatchPredicate& matcher,
256 StringListType& input,
262 template<
class StringListType>
266 StringListType& input,
275 template<
class StringListType>
279 StringListType& input,
293 template<
class StringListType>
297 StringListType& input,
306 template<
class StringListType>
310 StringListType& input,
319 template<
class StringListType>
323 StringListType& input,
335namespace stringListOps
339template<
class StringType>
349 bool operator()(
const std::string& text)
const
360template<
class StringListType,
class AccessOp =
identityOp>
363 const StringListType& input,
385template<
class StringListType,
class AccessOp =
identityOp>
388 const StringListType& input,
411 template<
class StringType>
414 const char* disallowed,
423 template<
class StringType>
426 const std::string& disallowed,
435 template<
class StringListType>
438 const char* disallowed,
439 const StringListType& input,
447 template<
class StringListType>
450 const std::string& disallowed,
451 const StringListType& input,
459 template<
class StringListType>
462 const char* disallowed,
463 StringListType& input,
471 template<
class StringListType>
474 const std::string& disallowed,
475 StringListType& input,
484 #include "stringListOps.txx"
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
bool contains(const T &val) const
True if the value is contained in the list.
A class for handling keywords in dictionaries.
bool isPattern() const noexcept
The keyType is treated as a pattern, not as literal string.
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
A List of wordRe with additional matching capabilities.
static const wordRes & null() noexcept
Return a null wordRes (reference to a nullObject). Behaves like a empty wordRes.
labelList findMatching(const StringListType &input, const wordRes::filter &pred, AccessOp aop=identityOp())
Return ids for items with matching names.
void inplaceSubsetStrings(const regExp &matcher, StringListType &input, const bool invert=false)
Inplace extract elements of StringList when regular expression matches.
List< label > labelList
A List of labels.
label firstMatchingString(const UnaryMatchPredicate &matcher, const UList< StringType > &input, const bool invert=false)
Find first list item that matches, -1 on failure.
StringListType subsetStrings(const regExp &matcher, const StringListType &input, const bool invert=false)
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.
regExpCxx regExp
Selection of preferred regular expression implementation.
void inplaceSubsetMatchingStrings(const UnaryMatchPredicate &matcher, StringListType &input, const bool invert=false)
Inplace extract elements of StringList when regular expression matches.
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 findStrings(const regExp &matcher, const UList< StringType > &input, const bool invert=false)
Return list indices for strings matching the regular expression.
Various functors for unary and binary operations. Can be used for parallel combine-reduce operations ...
A functor that returns its argument unchanged (cf. C++20 std::identity) Should never be specialized.
const UList< StringType > & values
bool operator()(const std::string &text) const
foundOp(const UList< StringType > &list) noexcept
Functor wrapper of allow/deny lists of wordRe for filtering.
Functor wrapper of a list of wordRe for matching.