OpenMS  2.5.0
List of all members
StringListUtils Class Reference

Utilities operating on lists of Strings. More...

#include <OpenMS/DATASTRUCTURES/StringListUtils.h>

Type definitions

typedef std::vector< String >::iterator Iterator
 Mutable iterator. More...
 
typedef std::vector< String >::const_iterator ConstIterator
 Non-mutable iterator. More...
 
typedef std::vector< String >::reverse_iterator ReverseIterator
 Mutable reverse iterator. More...
 
typedef std::vector< String >::const_reverse_iterator ConstReverseIterator
 Non-mutable reverse iterator. More...
 
static StringList fromQStringList (const QStringList &rhs)
 Creates a StringList from a QStringList. More...
 

Search methods

static Iterator searchPrefix (const Iterator &start, const Iterator &end, const String &text, bool trim=false)
 Searches for the first line that starts with text beginning at line start. More...
 
static ConstIterator searchPrefix (const ConstIterator &start, const ConstIterator &end, const String &text, bool trim=false)
 Searches for the first line that starts with text beginning at line start. More...
 
static ConstIterator searchPrefix (const StringList &container, const String &text, bool trim=false)
 Searches for the first line that starts with text in the StringList container. More...
 
static Iterator searchPrefix (StringList &container, const String &text, bool trim=false)
 Searches for the first line that starts with text in the StringList container. More...
 
static Iterator searchSuffix (const Iterator &start, const Iterator &end, const String &text, bool trim=false)
 Searches for the first line that ends with text beginning at line start. More...
 
static ConstIterator searchSuffix (const ConstIterator &start, const ConstIterator &end, const String &text, bool trim=false)
 Searches for the first line that ends with text beginning at line start. More...
 
static ConstIterator searchSuffix (const StringList &container, const String &text, bool trim=false)
 Searches for the first line that ends with text in the StringList container. More...
 
static Iterator searchSuffix (StringList &container, const String &text, bool trim=false)
 Searches for the first line that ends with text in the StringList container. More...
 
static void toUpper (StringList &sl)
 Transforms all strings contained in the passed StringList to upper case. More...
 
static void toLower (StringList &sl)
 Transforms all strings contained in the passed StringList to lower case. More...
 
INTERNAL StringListUtils ()
 hide c'tors to avoid instantiation of utils class More...
 
 StringListUtils (const StringListUtils &)
 
StringListUtilsoperator= (StringListUtils &)
 

Detailed Description

Utilities operating on lists of Strings.

Member Typedef Documentation

◆ ConstIterator

typedef std::vector<String>::const_iterator ConstIterator

Non-mutable iterator.

◆ ConstReverseIterator

typedef std::vector<String>::const_reverse_iterator ConstReverseIterator

Non-mutable reverse iterator.

◆ Iterator

typedef std::vector<String>::iterator Iterator

Mutable iterator.

◆ ReverseIterator

typedef std::vector<String>::reverse_iterator ReverseIterator

Mutable reverse iterator.

Constructor & Destructor Documentation

◆ StringListUtils() [1/2]

INTERNAL StringListUtils ( )
inlineprivate

hide c'tors to avoid instantiation of utils class

◆ StringListUtils() [2/2]

StringListUtils ( const StringListUtils )
inlineprivate

Member Function Documentation

◆ fromQStringList()

static StringList fromQStringList ( const QStringList &  rhs)
static

Creates a StringList from a QStringList.

◆ operator=()

StringListUtils& operator= ( StringListUtils )
inlineprivate

◆ searchPrefix() [1/4]

static ConstIterator searchPrefix ( const ConstIterator start,
const ConstIterator end,
const String text,
bool  trim = false 
)
static

Searches for the first line that starts with text beginning at line start.

Parameters
startIterator pointing to the initial position to search. (note: that this does not need to correspond to the beginning of the container.
endIterator pointing to the end final position of the sequence to search.
textThe text to find
trimWhether the line is trimmed before
Returns
Returns an iterator to the matching entry. If no line matches end is returned.

◆ searchPrefix() [2/4]

static Iterator searchPrefix ( const Iterator start,
const Iterator end,
const String text,
bool  trim = false 
)
static

Searches for the first line that starts with text beginning at line start.

Parameters
startIterator pointing to the initial position to search. (note: that this does not need to correspond to the beginning of the container.
endIterator pointing to the end final position of the sequence to search.
textThe text to find
trimWhether the line is trimmed before
Returns
Returns an iterator to the matching entry. If no line matches end is returned.

◆ searchPrefix() [3/4]

static ConstIterator searchPrefix ( const StringList container,
const String text,
bool  trim = false 
)
static

Searches for the first line that starts with text in the StringList container.

Parameters
containerThe StringList that should be searched.
textThe text to find
trimWhether the line is trimmed before
Returns
Returns an iterator to the matching entry. If no line matches end is returned.

◆ searchPrefix() [4/4]

static Iterator searchPrefix ( StringList container,
const String text,
bool  trim = false 
)
static

Searches for the first line that starts with text in the StringList container.

Parameters
containerThe StringList that should be searched.
textThe text to find
trimWhether the line is trimmed before
Returns
Returns an iterator to the matching entry. If no line matches end is returned.

◆ searchSuffix() [1/4]

static ConstIterator searchSuffix ( const ConstIterator start,
const ConstIterator end,
const String text,
bool  trim = false 
)
static

Searches for the first line that ends with text beginning at line start.

Parameters
startIterator pointing to the initial position to search. (note: that this does not need to correspond to the beginning of the container.
endIterator pointing to the end final position of the sequence to search.
textThe text to find
trimWhether the line is trimmed before
Returns
Returns an iterator to the matching entry. If no line matches end is returned.

◆ searchSuffix() [2/4]

static Iterator searchSuffix ( const Iterator start,
const Iterator end,
const String text,
bool  trim = false 
)
static

Searches for the first line that ends with text beginning at line start.

Parameters
startIterator pointing to the initial position to search. (note: that this does not need to correspond to the beginning of the container.
endIterator pointing to the end final position of the sequence to search.
textThe text to find
trimWhether the line is trimmed before
Returns
Returns an iterator to the matching entry. If no line matches end is returned.

◆ searchSuffix() [3/4]

static ConstIterator searchSuffix ( const StringList container,
const String text,
bool  trim = false 
)
static

Searches for the first line that ends with text in the StringList container.

Parameters
containerThe StringList that should be searched.
textThe text to find
trimWhether the line is trimmed before
Returns
Returns an iterator to the matching entry. If no line matches end is returned.

◆ searchSuffix() [4/4]

static Iterator searchSuffix ( StringList container,
const String text,
bool  trim = false 
)
static

Searches for the first line that ends with text in the StringList container.

Parameters
containerThe StringList that should be searched.
textThe text to find
trimWhether the line is trimmed before
Returns
Returns an iterator to the matching entry. If no line matches end is returned.

◆ toLower()

static void toLower ( StringList sl)
static

Transforms all strings contained in the passed StringList to lower case.

Parameters
TheStringList to convert to lower case.

◆ toUpper()

static void toUpper ( StringList sl)
static

Transforms all strings contained in the passed StringList to upper case.

Parameters
slThe StringList to convert to upper case.