Go to the documentation of this file.
44 #ifndef stringListOps_H
45 #define stringListOps_H
57 template<
class UnaryMatchPredicate,
class StringType>
60 const UnaryMatchPredicate& matcher,
61 const UList<StringType>&
input,
73 template<
class UnaryMatchPredicate,
class StringType>
76 const UnaryMatchPredicate& matcher,
77 const UList<StringType>&
input,
84 template<
class StringType>
98 template<
class StringType>
117 template<
class StringType>
131 template<
class StringType>
144 template<
class StringType>
164 template<
class UnaryMatchPredicate,
class StringListType>
167 const UnaryMatchPredicate& matcher,
168 const StringListType&
input,
175 template<
class StringListType>
179 const StringListType&
input,
189 template<
class StringListType>
193 const StringListType&
input,
207 template<
class StringListType>
211 const StringListType&
input,
220 template<
class StringListType>
224 const StringListType&
input,
234 template<
class StringListType>
238 const StringListType&
input,
250 template<
class UnaryMatchPredicate,
class StringListType>
253 const UnaryMatchPredicate& matcher,
254 StringListType&
input,
260 template<
class StringListType>
264 StringListType&
input,
273 template<
class StringListType>
277 StringListType&
input,
291 template<
class StringListType>
295 StringListType&
input,
304 template<
class StringListType>
308 StringListType&
input,
317 template<
class StringListType>
321 StringListType&
input,
335 namespace stringListOps
344 template<
class StringType>
377 template<
class StringListType,
class AccessOp = noOp>
380 const StringListType&
input,
383 AccessOp aop =
noOp()
403 template<
class StringType>
406 const char* disallowed,
407 const UList<StringType>&
input,
415 template<
class StringType>
418 const std::string& disallowed,
419 const UList<StringType>&
input,
427 template<
class StringListType>
430 const char* disallowed,
431 const StringListType&
input,
439 template<
class StringListType>
442 const std::string& disallowed,
443 const StringListType&
input,
451 template<
class StringListType>
454 const char* disallowed,
455 StringListType&
input,
463 template<
class StringListType>
466 const std::string& disallowed,
467 StringListType&
input,
List< label > labelList
A List of labels.
bool isPattern() const noexcept
The keyType is treated as a pattern, not as literal string.
Functor to determine if a string is exists in a list of strings.
void inplaceSubsetStrings(const regExp &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.
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
regExpCxx regExp
Selection of preferred regular expression implementation.
A class for handling keywords in dictionaries.
labelList findMatching(const StringListType &input, const wordRes &allow, const wordRes &deny=wordRes(), AccessOp aop=noOp())
Return ids for items with matching names.
Wrapper around C++11 regular expressions with some additional prefix-handling. The prefix-handling is...
StringListType subsetStrings(const regExp &matcher, const StringListType &input, const bool invert=false)
Extract elements of StringList when regular expression matches.
labelList findStrings(const regExp &matcher, const UList< StringType > &input, const bool invert=false)
Return list indices for strings matching the regular expression.
foundOp(const UList< StringType > &list)
Functor wrapper for matching against a List of wordRe.
void inplaceSubsetMatchingStrings(const UnaryMatchPredicate &matcher, StringListType &input, const bool invert=false)
Inplace extract elements of StringList when regular expression matches.
A List of wordRe with additional matching capabilities.
label firstMatchingString(const UnaryMatchPredicate &matcher, const UList< StringType > &input, const bool invert=false)
Find first list item that matches, -1 on failure.
const UList< StringType > & values
static Istream & input(Istream &is, IntRange< T > &range)
bool operator()(const std::string &text) const
bool found(const T &val, label pos=0) const
True if the value if found in the list.
labelList findMatchingStrings(const UnaryMatchPredicate &matcher, const UList< StringType > &input, const bool invert=false)
Extract list indices for all matches.
Pass through value. Should never be specialized.