libept
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ept::str::Split::const_iterator Class Reference

#include <string.h>

Inheritance diagram for ept::str::Split::const_iterator:

Public Member Functions

 const_iterator (const Split &split)
 Begin iterator. More...
 
 const_iterator ()
 End iterator. More...
 
 ~const_iterator ()
 
const_iteratoroperator++ ()
 
const std::string & operator* () const
 
const std::string * operator-> () const
 
std::string remainder () const
 
bool operator== (const const_iterator &ti) const
 
bool operator!= (const const_iterator &ti) const
 

Protected Member Functions

void skip_separators ()
 Move end past all the consecutive separators that start at its position. More...
 

Protected Attributes

const Splitsplit = nullptr
 
std::string cur
 Current token. More...
 
size_t end = 0
 Position of the first character of the next token. More...
 

Constructor & Destructor Documentation

ept::str::Split::const_iterator::const_iterator ( const Split split)

Begin iterator.

References ept::str::Split::skip_empty, and skip_separators().

ept::str::Split::const_iterator::const_iterator ( )
inline

End iterator.

ept::str::Split::const_iterator::~const_iterator ( )

Member Function Documentation

bool ept::str::Split::const_iterator::operator!= ( const const_iterator ti) const

References end, ept::str::Split::end(), and split.

const std::string & ept::str::Split::const_iterator::operator* ( ) const
Split::const_iterator & ept::str::Split::const_iterator::operator++ ( )

Convert into an end iterator

The string ended with an iterator, and we do not skip empty tokens: return it

Position of the first character past the token that starts at 'end'

If separator is empty, advance one character at a time

The token ends at the next separator

No more separators found, return from end to the end of the string

We have the boundaries of the current token

Skip the separator

Skip all the following separators if skip_empty is true

References ept::str::Split::end(), ept::str::Split::sep, ept::str::Split::skip_empty, and ept::str::Split::str.

const std::string * ept::str::Split::const_iterator::operator-> ( ) const
bool ept::str::Split::const_iterator::operator== ( const const_iterator ti) const

References end, ept::str::Split::end(), and split.

std::string ept::str::Split::const_iterator::remainder ( ) const
void ept::str::Split::const_iterator::skip_separators ( )
protected

Move end past all the consecutive separators that start at its position.

References ept::str::Split::end(), ept::str::Split::sep, and ept::str::Split::str.

Referenced by const_iterator().

Member Data Documentation

std::string ept::str::Split::const_iterator::cur
protected

Current token.

size_t ept::str::Split::const_iterator::end = 0
protected

Position of the first character of the next token.

Referenced by operator!=(), and operator==().

const Split* ept::str::Split::const_iterator::split = nullptr
protected

Referenced by operator!=(), and operator==().


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