Bayonne2 / Common C++ 2 Framework
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | Friends
StringTokenizer::iterator Class Reference

The input forward iterator for tokens. More...

#include <tokenizer.h>

Collaboration diagram for StringTokenizer::iterator:
Collaboration graph
[legend]

Public Member Functions

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

Private Member Functions

 iterator (const StringTokenizer &tok, const char *end)
 
 iterator (const StringTokenizer &tok)
 

Private Attributes

const StringTokenizermyTok
 
const char * start
 
const char * tokEnd
 
const char * endp
 
char * token
 

Friends

class StringTokenizer
 

Detailed Description

The input forward iterator for tokens.

Author
Henner Zeller

Definition at line 127 of file tokenizer.h.

Constructor & Destructor Documentation

StringTokenizer::iterator::iterator ( const StringTokenizer tok,
const char *  end 
)
inlineprivate

Definition at line 137 of file tokenizer.h.

StringTokenizer::iterator::iterator ( const StringTokenizer tok)
inlineprivate

Definition at line 140 of file tokenizer.h.

StringTokenizer::iterator::iterator ( )
inline

Definition at line 146 of file tokenizer.h.

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

Definition at line 149 of file tokenizer.h.

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

copy constructor.

Definition at line 156 of file tokenizer.h.

Member Function Documentation

char 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 195 of file tokenizer.h.

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

compares to other iterator.

Usually used to compare against the end() iterator.

Definition at line 211 of file tokenizer.h.

const char* StringTokenizer::iterator::operator* ( )

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());

iterator& StringTokenizer::iterator::operator++ ( )

shifts this iterator to the next token in the string.

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

assignment operator.

Definition at line 164 of file tokenizer.h.

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

compares to other iterator.

Usually used to compare against the end() iterator.

Definition at line 203 of file tokenizer.h.

Friends And Related Function Documentation

friend class StringTokenizer
friend

Definition at line 128 of file tokenizer.h.

Field Documentation

const char* StringTokenizer::iterator::endp
private

Definition at line 133 of file tokenizer.h.

const StringTokenizer* StringTokenizer::iterator::myTok
private

Definition at line 130 of file tokenizer.h.

const char* StringTokenizer::iterator::start
private

Definition at line 131 of file tokenizer.h.

char* StringTokenizer::iterator::token
private

Definition at line 134 of file tokenizer.h.

const char* StringTokenizer::iterator::tokEnd
private

Definition at line 132 of file tokenizer.h.


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