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

◆ const_iterator() [1/2]

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

Begin iterator.

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

◆ const_iterator() [2/2]

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

◆ ~const_iterator()

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

Referenced by const_iterator().

Member Function Documentation

◆ operator!=()

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

References end, and split.

Referenced by const_iterator().

◆ operator*()

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

References cur.

Referenced by const_iterator().

◆ operator++()

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 cur, end, ept::str::Split::sep, ept::str::Split::skip_empty, skip_separators(), split, and ept::str::Split::str.

Referenced by const_iterator().

◆ operator->()

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

References cur.

Referenced by const_iterator().

◆ operator==()

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

References end, and split.

Referenced by const_iterator().

◆ remainder()

std::string ept::str::Split::const_iterator::remainder ( ) const

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

Referenced by const_iterator().

◆ skip_separators()

void ept::str::Split::const_iterator::skip_separators ( )
protected

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

References end, ept::str::Split::sep, split, and ept::str::Split::str.

Referenced by const_iterator(), and operator++().

Member Data Documentation

◆ cur

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

Current token.

Referenced by operator*(), operator++(), and operator->().

◆ end

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

Position of the first character of the next token.

Referenced by operator!=(), operator++(), operator==(), remainder(), and skip_separators().

◆ split

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

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