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, skip_separators(), and split.

◆ const_iterator() [2/2]

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

End iterator.

◆ ~const_iterator()

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

Member Function Documentation

◆ operator!=()

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

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

◆ operator*()

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

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

◆ operator->()

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

◆ operator==()

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

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

◆ remainder()

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

◆ skip_separators()

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

◆ cur

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

Current token.

◆ end

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

Position of the first character of the next token.

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

◆ split

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

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