UCommon
ost::StringTokenizer::iterator Class Reference

The input forward iterator for tokens. More...

#include <tokenizer.h>

Public Member Functions

 iterator (const iterator &i)
 copy constructor.
 
char nextDelimiter () const
 returns the next delimiter after the current token or '\0', if there are no following delimiters.
 
bool operator!= (const iterator &other) const
 compares to other iterator.
 
const char * operator* () throw (NoSuchElementException)
 returns the immutable string this iterator points to or '0' if no token is available (i.e.
 
iteratoroperator++ () throw (NoSuchElementException)
 shifts this iterator to the next token in the string.
 
iteratoroperator= (const iterator &i)
 assignment operator.
 
bool operator== (const iterator &other) const
 compares to other iterator.
 

Friends

class StringTokenizer
 

Detailed Description

The input forward iterator for tokens.

Author
Henner Zeller

Definition at line 129 of file tokenizer.h.

Constructor & Destructor Documentation

◆ iterator() [1/2]

ost::StringTokenizer::iterator::iterator ( )
inline

Definition at line 148 of file tokenizer.h.

◆ ~iterator()

virtual ost::StringTokenizer::iterator::~iterator ( )
inlinevirtual

Definition at line 151 of file tokenizer.h.

◆ iterator() [2/2]

ost::StringTokenizer::iterator::iterator ( const iterator & i)
inline

copy constructor.

Definition at line 158 of file tokenizer.h.

Member Function Documentation

◆ nextDelimiter()

char ost::StringTokenizer::iterator::nextDelimiter ( ) const
inline

returns the next delimiter after the current token or '\0', if there are no following delimiters.

It returns the very next delimiter (even if skipAllDelim=true).

Definition at line 196 of file tokenizer.h.

◆ operator!=()

bool ost::StringTokenizer::iterator::operator!= ( const iterator & other) const
inline

compares to other iterator.

Usually used to compare against the end() iterator.

Definition at line 212 of file tokenizer.h.

◆ operator*()

const char * ost::StringTokenizer::iterator::operator* ( )
throw (NoSuchElementException )

returns the immutable string this iterator points to or '0' if no token is available (i.e.

i == end()). Do not store pointers to this token, since it is invalidated for each iteration. If you need the token, copy it (e.g. with strdup());

◆ operator=()

iterator & ost::StringTokenizer::iterator::operator= ( const iterator & i)
inline

assignment operator.

Definition at line 166 of file tokenizer.h.

◆ operator==()

bool ost::StringTokenizer::iterator::operator== ( const iterator & other) const
inline

compares to other iterator.

Usually used to compare against the end() iterator.

Definition at line 204 of file tokenizer.h.

Friends And Related Symbol Documentation

◆ StringTokenizer

friend class StringTokenizer
friend

Definition at line 130 of file tokenizer.h.


The documentation for this class was generated from the following file: