You.i Engine
CYIStringView::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 view are invalidated when any of the non-const members of that string view are called. This includes when non-const members that operate on iterators are called. The iterators are also invalidated when their underlying CYIStringView is deleted, or when the data that backs that string view is deleted.

#include <utility/YiStringView.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 (CYIStringView string, size_t charactersOffset)
 
 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 * GetRawData () const
 
ConstReverseIterator Reverse () const
 

Friends

class CYIStringView
 
class CYIString
 

Member Typedef Documentation

◆ difference_type

◆ iterator_category

typedef std::bidirectional_iterator_tag CYIStringView::ConstIterator::iterator_category

◆ pointer

typedef const char32_t* CYIStringView::ConstIterator::pointer

◆ reference

◆ value_type

Constructor & Destructor Documentation

◆ ConstIterator() [1/3]

CYIStringView::ConstIterator::ConstIterator ( )

◆ ConstIterator() [2/3]

CYIStringView::ConstIterator::ConstIterator ( CYIStringView  string,
size_t  charactersOffset 
)

◆ ConstIterator() [3/3]

CYIStringView::ConstIterator::ConstIterator ( const ConstIterator other)

◆ ~ConstIterator()

CYIStringView::ConstIterator::~ConstIterator ( )

Member Function Documentation

◆ GetRawData()

const char* CYIStringView::ConstIterator::GetRawData ( ) const

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

Warning
The returned character array is not null-terminated.

◆ operator!=()

bool CYIStringView::ConstIterator::operator!= ( const ConstIterator other) const

◆ operator*()

value_type CYIStringView::ConstIterator::operator* ( ) const

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

◆ operator++() [1/2]

ConstIterator& CYIStringView::ConstIterator::operator++ ( )

◆ operator++() [2/2]

ConstIterator CYIStringView::ConstIterator::operator++ ( int  )

◆ operator--() [1/2]

ConstIterator& CYIStringView::ConstIterator::operator-- ( )

◆ operator--() [2/2]

ConstIterator CYIStringView::ConstIterator::operator-- ( int  )

◆ operator=()

ConstIterator& CYIStringView::ConstIterator::operator= ( const ConstIterator other)

◆ operator==()

bool CYIStringView::ConstIterator::operator== ( const ConstIterator other) const

◆ Reverse()

ConstReverseIterator CYIStringView::ConstIterator::Reverse ( ) const

Friends And Related Function Documentation

◆ CYIString

friend class CYIString
friend

◆ CYIStringView

friend class CYIStringView
friend

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