CsString  1.3.2
CsString::CsStringIterator< E, A > Class Template Reference

Iterator class for CsBasicString. More...

Public Typedefs

using size_type = std::ptrdiff_t
 

Public Member Functions

 CsStringIterator () = default
 
bool operator!= (const CsStringIterator< E, A > &other) const
 
CsString::CsChar operator* () const
 
CsStringIterator< E, A > operator+ (size_type n) const
 
CsStringIterator< E, A > & operator++ ()
 
CsStringIterator< E, A > operator++ (int)
 
CsStringIterator< E, A > & operator+= (size_type n)
 
size_type operator- (CsStringIterator< E, A > other) const
 
CsStringIterator< E, A > operator- (size_type n) const
 
CsStringIterator< E, A > & operator-- ()
 
CsStringIterator< E, A > operator-- (int)
 
CsStringIterator< E, A > & operator-= (size_type n)
 
CsString::CsCharArrow operator-> () const
 
bool operator< (const CsStringIterator< E, A > &other) const
 
bool operator<= (const CsStringIterator< E, A > &other) const
 
bool operator== (const CsStringIterator< E, A > &other) const
 
bool operator> (const CsStringIterator< E, A > &other) const
 
bool operator>= (const CsStringIterator< E, A > &other) const
 
CsString::CsChar operator[] (size_type n) const
 

Detailed Description

template<typename E, typename A>
class CsString::CsStringIterator< E, A >

This class implements a random access iterator for CsBasicString. All CsStringIterators are const.

Member Typedef Documentation

template<typename E, typename A>
CsStringIterator::size_type

Typedef for an integer type representing sizes in a iterator.

Constructor & Destructor Documentation

template<typename E, typename A>
CsString::CsStringIterator< E, A >::CsStringIterator ( )
inlinedefault

Constructs an uninitialized CsStringIterator.

Member Function Documentation

template<typename E, typename A>
bool CsString::CsStringIterator< E, A >::operator!= ( const CsStringIterator<E, A> &  other) const

Returns true if other points to a different code point than this iterator, otherwise returns false.

See also
operator==().
template<typename E, typename A>
CsString::CsChar CsString::CsStringIterator< E, A >::operator* ( ) const

Returns the current code point.

template<typename E, typename A>
CsStringIterator CsString::CsStringIterator< E, A >::operator+ ( size_type  n) const

Returns an iterator to the code point n positions after this iterator. If n is negative, the iterator goes backward.

See also
operator-() and operator+=().
template<typename E, typename A>
CsStringIterator & CsString::CsStringIterator< E, A >::operator++ ( )

The prefix ++ operator advances the iterator to the next code point in the string and returns the new iterator.

Calling this function on the end() iterator leads to undefined results.

See also
operator--().
template<typename E, typename A>
CsStringIterator CsString::CsStringIterator< E, A >::operator++ ( int  )

The postfix ++ operator advances the iterator to the next code point in the string and returns the old iterator.

template<typename E, typename A>
CsStringIterator & CsString::CsStringIterator< E, A >::operator+= ( size_type  n)

Advances the iterator by n code points. If n is negative, the iterator goes backward.

See also
operator-=() and operator+().
template<typename E, typename A>
size_type CsString::CsStringIterator< E, A >::operator- ( CsStringIterator<E, A>  other) const

Returns the number of code points between the code point pointed to by other and the code point pointed to by this iterator.

template<typename E, typename A>
CsStringIterator CsString::CsStringIterator< E, A >::operator- ( size_type  n) const

Returns an iterator to the code point at n positions backward from this iterator. If n is negative, the iterator goes forward.

See also
operator+() and operator-=().
template<typename E, typename A>
CsStringIterator & CsString::CsStringIterator< E, A >::operator-- ( )

The prefix – operator decrements the iterator to the previous code point in the string and returns the new iterator.

Calling this method on begin() leads to undefined results.

See also
operator++().
template<typename E, typename A>
CsStringIterator CsString::CsStringIterator< E, A >::operator-- ( int  )

The postfix – operator decrements the iterator to the previous code point in the string and returns the old iterator.

template<typename E, typename A>
CsStringIterator & CsString::CsStringIterator< E, A >::operator-= ( size_type  n)

Returns an iterator to the code point at n positions backward from this iterator. If n is negative the iterator goes forward.

See also
operator+() and operator-=().
template<typename E, typename A>
CsString::CsCharArrow CsString::CsStringIterator< E, A >::operator-> ( ) const

Returns the current code point.

template<typename E, typename A>
bool CsString::CsStringIterator< E, A >::operator< ( const CsStringIterator<E, A> &  other) const

Returns true if this iterator is closer to the beginning of the string than the other iterator.

template<typename E, typename A>
bool CsString::CsStringIterator< E, A >::operator<= ( const CsStringIterator<E, A> &  other) const

Returns true if this iterator is equal to or closer to the beginning of the string than the other iterator.

template<typename E, typename A>
bool CsString::CsStringIterator< E, A >::operator== ( const CsStringIterator<E, A> &  other) const

Returns true if other points to the same code point as this iterator, otherwise returns false.

See also
operator!=().
template<typename E, typename A>
bool CsString::CsStringIterator< E, A >::operator> ( const CsStringIterator<E, A> &  other) const

Returns true if this iterator is further from the beginning of the string than the other iterator.

template<typename E, typename A>
bool CsString::CsStringIterator< E, A >::operator>= ( const CsStringIterator<E, A> &  other) const

Returns true if this iterator is equal to or further from the beginning of the string than the other iterator.

template<typename E, typename A>
CsString::CsChar CsString::CsStringIterator< E, A >::operator[] ( size_type  n) const

Returns the code point at position this + n.

See also
operator+().