 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
18 #ifndef StringTokenizer_h
19 #define StringTokenizer_h
91 StringTokenizer(std::string tosplit, std::string token,
bool splitAtAllChars =
false);
122 std::string
get(
int pos)
const;
129 void prepare(
const std::string& tosplit,
const std::string& token,
bool splitAtAllChars);
bool hasNext()
returns the information whether further substrings exist
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
void prepare(const std::string &tosplit, const std::string &token, bool splitAtAllChars)
splits the first string at all occurences of the second. If the third parameter is true split at all ...
~StringTokenizer()
destructor
static const int WHITECHARS
identifier for splitting the given string at all whitespace characters
std::string myTosplit
the string to split
StringTokenizer()
default constructor
std::string get(int pos) const
returns the item at the given position
static const int NEWLINE
identifier for splitting the given string at all newline characters
SizeVector myLengths
the list of substring lengths
int size() const
returns the number of existing substrings
static const int SPACE
the ascii index of the highest whitespace character
static const int TAB
the ascii index of the tab character
std::vector< int > SizeVector
a list of positions/lengths
SizeVector myStarts
the list of substring starts
std::string front()
returns the first substring without moving the iterator
int myPos
the current position in the list of substrings
std::vector< std::string > getVector()
return vector of strings
void prepareWhitechar(const std::string &tosplit)
splits the first string at all occurences of whitechars
void reinit()
reinitialises the internal iterator