Image Component Library (ICL)
|
String Tokenizer Utility class. More...
#include <StrTok.h>
Public Types | |
typedef std::vector< std::string >::reverse_iterator | reverse_iterator |
reverse iterator type More... | |
typedef std::vector< std::string >::const_reverse_iterator | const_reverse_iterator |
constant reverse iterator type More... | |
typedef std::vector< std::string >::iterator | iterator |
iterator type More... | |
typedef std::vector< std::string >::const_iterator | const_iterator |
constant iterator type More... | |
Public Member Functions | |
StrTok (const std::string &s, const std::string &delims, bool singleCharDelims=true, char escapeChar='\0') | |
Constructor. More... | |
bool | hasMoreTokens () const |
Returns whether more tokens are available using nextToken() More... | |
const std::string & | nextToken () |
Returns the next token (unsafe -> check with hasMoreTokens before) More... | |
unsigned int | nTokens () const |
returns the internal token count More... | |
const std::vector< std::string > & | allTokens () const |
returns a vector More... | |
void | reset () |
resets internal position indicator More... | |
iterator | begin () |
returns begin-iterator More... | |
const_iterator | begin () const |
returns const begin-iterator More... | |
reverse_iterator | rbegin () |
returns reverse begin-iterator More... | |
const_reverse_iterator | rbegin () const |
returns const reverse begin-iterator More... | |
iterator | end () |
returns end-iterator More... | |
const_iterator | end () const |
returns const end-iterator More... | |
reverse_iterator | rend () |
returns reverse end-iterator More... | |
const_reverse_iterator | rend () const |
returns const reverse end-iterator More... | |
Private Attributes | |
std::vector< std::string > | m_oTokens |
internal data storage More... | |
unsigned int | m_uiPos |
current position indicator More... | |
String Tokenizer Utility class.
typedef std::vector<std::string>::const_iterator icl::utils::StrTok::const_iterator |
constant iterator type
typedef std::vector<std::string>::const_reverse_iterator icl::utils::StrTok::const_reverse_iterator |
constant reverse iterator type
typedef std::vector<std::string>::iterator icl::utils::StrTok::iterator |
iterator type
typedef std::vector<std::string>::reverse_iterator icl::utils::StrTok::reverse_iterator |
reverse iterator type
icl::utils::StrTok::StrTok | ( | const std::string & | s, |
const std::string & | delims, | ||
bool | singleCharDelims = true , |
||
char | escapeChar = '\0' |
||
) |
Constructor.
s | string to be tokenized |
delims | delimiter string: meaning depends on singleCharDelims |
singleCharDelims | if this is true (default), each character of delims is treated a single possible delimiter. Otherwise, the delims string is used as a delimiter sequence |
escapeChar | if this char is not '\0', delimiter occurences are skipped, if this char is found directly before the delimiter. (Often the '\' char is used here) |
const std::vector<std::string>& icl::utils::StrTok::allTokens | ( | ) | const |
returns a vector
|
inline |
returns begin-iterator
|
inline |
returns const begin-iterator
|
inline |
returns end-iterator
|
inline |
returns const end-iterator
bool icl::utils::StrTok::hasMoreTokens | ( | ) | const |
Returns whether more tokens are available using nextToken()
note: nextToken is not safe; it must be checked with hasMoreTokens
const std::string& icl::utils::StrTok::nextToken | ( | ) |
Returns the next token (unsafe -> check with hasMoreTokens before)
unsigned int icl::utils::StrTok::nTokens | ( | ) | const |
returns the internal token count
|
inline |
returns reverse begin-iterator
|
inline |
returns const reverse begin-iterator
|
inline |
returns reverse end-iterator
|
inline |
returns const reverse end-iterator
|
inline |
resets internal position indicator
|
private |
internal data storage
|
private |
current position indicator