You.i Engine
CYIString::ConstIterator Class Reference

Detailed Description

A bi-directional Iterator type that allow iteration over Unicode characters (rather than bytes). STL-compatible.

Warning
All iterators created from a specific string are invalidated when any of the non-const members of that string are called. This includes when non-const members that operate on iterators are called. The iterators are invalidated when their underlying CYIString is deleted.

#include <utility/YiString.h>

Public Types

typedef std::bidirectional_iterator_tag iterator_category
 
typedef char32_t value_type
 
typedef ptrdiff_t difference_type
 
typedef const char32_t * pointer
 
typedef char32_t reference
 

Public Member Functions

 ConstIterator ()
 
 ConstIterator (const CYIString &string, uint32_t uCharactersOffset)
 
 ConstIterator (const ConstIterator &other)
 
 ~ConstIterator ()
 
ConstIteratoroperator= (const ConstIterator &other)
 
value_type operator* () const
 
bool operator== (const ConstIterator &other) const
 
bool operator!= (const ConstIterator &other) const
 
ConstIteratoroperator++ ()
 
ConstIterator operator++ (int)
 
ConstIteratoroperator-- ()
 
ConstIterator operator-- (int)
 
const char * GetData () const
 
ConstReverseIterator Reverse () const
 

Friends

class CYIString
 

Member Typedef Documentation

typedef std::bidirectional_iterator_tag CYIString::ConstIterator::iterator_category
typedef const char32_t* CYIString::ConstIterator::pointer

Constructor & Destructor Documentation

CYIString::ConstIterator::ConstIterator ( )
CYIString::ConstIterator::ConstIterator ( const CYIString string,
uint32_t  uCharactersOffset 
)
CYIString::ConstIterator::ConstIterator ( const ConstIterator other)
CYIString::ConstIterator::~ConstIterator ( )

Member Function Documentation

const char* CYIString::ConstIterator::GetData ( ) const

Returns the address to the raw UTF-8 data pointed to by this iterator.

bool CYIString::ConstIterator::operator!= ( const ConstIterator other) const
value_type CYIString::ConstIterator::operator* ( ) const

Returns the 32-bit Unicode value pointed to by this iterator. Returns 0 when the 'end' iterator is dereferenced.

ConstIterator& CYIString::ConstIterator::operator++ ( )
ConstIterator CYIString::ConstIterator::operator++ ( int  )
ConstIterator& CYIString::ConstIterator::operator-- ( )
ConstIterator CYIString::ConstIterator::operator-- ( int  )
ConstIterator& CYIString::ConstIterator::operator= ( const ConstIterator other)
bool CYIString::ConstIterator::operator== ( const ConstIterator other) const
ConstReverseIterator CYIString::ConstIterator::Reverse ( ) const

Friends And Related Function Documentation

friend class CYIString
friend

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