35 #ifndef OPENMS_DATASTRUCTURES_STRINGLISTUTILS_H 36 #define OPENMS_DATASTRUCTURES_STRINGLISTUTILS_H 40 #include <OpenMS/OpenMSConfig.h> 58 typedef std::vector<String>::iterator
Iterator;
69 static StringList fromQStringList(
const QStringList& rhs);
82 static Iterator searchPrefix(
const Iterator& start,
const Iterator& end,
const String& text,
bool trim =
false);
93 static ConstIterator searchPrefix(
const ConstIterator& start,
const ConstIterator& end,
const String& text,
bool trim =
false);
103 static ConstIterator searchPrefix(
const StringList& container,
const String& text,
bool trim =
false);
113 static Iterator searchPrefix(
StringList& container,
const String& text,
bool trim =
false);
124 static Iterator searchSuffix(
const Iterator& start,
const Iterator& end,
const String& text,
bool trim =
false);
135 static ConstIterator searchSuffix(
const ConstIterator& start,
const ConstIterator& end,
const String& text,
bool trim =
false);
145 static ConstIterator searchSuffix(
const StringList& container,
const String& text,
bool trim =
false);
155 static Iterator searchSuffix(
StringList& container,
const String& text,
bool trim =
false);
176 struct TrimmableStringPredicate_
178 TrimmableStringPredicate_(
const String& target,
const bool trim) :
182 if (trim_) target_.trim();
207 struct PrefixPredicate_ :
208 TrimmableStringPredicate_
210 PrefixPredicate_(
const String& target,
const bool trim) :
211 TrimmableStringPredicate_(target, trim)
220 inline bool operator()(
const String& value)
222 return getValue(value).hasPrefix(target_);
228 struct SuffixPredicate_ :
229 TrimmableStringPredicate_
231 SuffixPredicate_(
const String& target,
const bool trim) :
232 TrimmableStringPredicate_(target, trim)
241 inline bool operator()(
const String& value)
243 return getValue(value).hasSuffix(target_);
257 #endif // OPENMS_DATASTRUCTURES_STRINGLISTUTILS_H
A more convenient string class.
Definition: String.h:57
StringListUtils(const StringListUtils &)
Definition: StringListUtils.h:251
std::vector< String >::iterator Iterator
Mutable iterator.
Definition: StringListUtils.h:59
std::vector< String >::const_iterator ConstIterator
Non-mutable iterator.
Definition: StringListUtils.h:61
std::vector< String >::reverse_iterator ReverseIterator
Mutable reverse iterator.
Definition: StringListUtils.h:63
Utilities operating on lists of Strings.
Definition: StringListUtils.h:52
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
String & trim()
removes whitespaces (space, tab, line feed, carriage return) at the beginning and the end of the stri...
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:74
StringListUtils & operator=(StringListUtils &)
Definition: StringListUtils.h:252
INTERNAL StringListUtils()
hide c'tors to avoid instantiation of utils class
Definition: StringListUtils.h:250
std::vector< String >::const_reverse_iterator ConstReverseIterator
Non-mutable reverse iterator.
Definition: StringListUtils.h:65