libdonut  2.3.2
Application framework for cross-platform game development in C++20
Public Types | Public Member Functions | List of all members
donut::unicode::UTF8Iterator< It, Sentinel > Class Template Reference

Iterator type for decoding Unicode code points from a UTF-8 string, wrapping an existing iterator for UTF-8 code units. More...

#include <donut/unicode.hpp>

Public Types

using difference_type = std::ptrdiff_t
 
using value_type = char32_t
 
using reference = const value_type &
 
using pointer = const value_type *
 
using iterator_category = std::forward_iterator_tag
 
using sentinel = UTF8Sentinel
 

Public Member Functions

constexpr UTF8Iterator ()=default
 
constexpr UTF8Iterator (It it, Sentinel end)
 
constexpr bool operator== (const UTF8Iterator &other) const
 
constexpr bool operator== (const UTF8Sentinel &) const
 
constexpr reference operator* () const
 
constexpr pointer operator-> () const
 
constexpr UTF8Iteratoroperator++ ()
 
constexpr UTF8Iterator operator++ (int)
 
constexpr It base () const
 

Detailed Description

template<typename It, typename Sentinel = It>
class donut::unicode::UTF8Iterator< It, Sentinel >

Iterator type for decoding Unicode code points from a UTF-8 string, wrapping an existing iterator for UTF-8 code units.

Template Parameters
Itunderlying UTF-8 code unit iterator type to wrap.
Sentinelsentinel type for It.

Member Typedef Documentation

◆ difference_type

template<typename It , typename Sentinel = It>
using donut::unicode::UTF8Iterator< It, Sentinel >::difference_type = std::ptrdiff_t

◆ value_type

template<typename It , typename Sentinel = It>
using donut::unicode::UTF8Iterator< It, Sentinel >::value_type = char32_t

◆ reference

template<typename It , typename Sentinel = It>
using donut::unicode::UTF8Iterator< It, Sentinel >::reference = const value_type&

◆ pointer

template<typename It , typename Sentinel = It>
using donut::unicode::UTF8Iterator< It, Sentinel >::pointer = const value_type*

◆ iterator_category

template<typename It , typename Sentinel = It>
using donut::unicode::UTF8Iterator< It, Sentinel >::iterator_category = std::forward_iterator_tag

◆ sentinel

template<typename It , typename Sentinel = It>
using donut::unicode::UTF8Iterator< It, Sentinel >::sentinel = UTF8Sentinel

Constructor & Destructor Documentation

◆ UTF8Iterator() [1/2]

template<typename It , typename Sentinel = It>
constexpr donut::unicode::UTF8Iterator< It, Sentinel >::UTF8Iterator ( )
constexprdefault

◆ UTF8Iterator() [2/2]

template<typename It , typename Sentinel = It>
constexpr donut::unicode::UTF8Iterator< It, Sentinel >::UTF8Iterator ( It  it,
Sentinel  end 
)
inlineconstexpr

Member Function Documentation

◆ operator==() [1/2]

template<typename It , typename Sentinel = It>
constexpr bool donut::unicode::UTF8Iterator< It, Sentinel >::operator== ( const UTF8Iterator< It, Sentinel > &  other) const
inlineconstexpr

◆ operator==() [2/2]

template<typename It , typename Sentinel = It>
constexpr bool donut::unicode::UTF8Iterator< It, Sentinel >::operator== ( const UTF8Sentinel ) const
inlineconstexpr

◆ operator*()

template<typename It , typename Sentinel = It>
constexpr reference donut::unicode::UTF8Iterator< It, Sentinel >::operator* ( ) const
inlineconstexpr

◆ operator->()

template<typename It , typename Sentinel = It>
constexpr pointer donut::unicode::UTF8Iterator< It, Sentinel >::operator-> ( ) const
inlineconstexpr

◆ operator++() [1/2]

template<typename It , typename Sentinel = It>
constexpr UTF8Iterator& donut::unicode::UTF8Iterator< It, Sentinel >::operator++ ( )
inlineconstexpr

◆ operator++() [2/2]

template<typename It , typename Sentinel = It>
constexpr UTF8Iterator donut::unicode::UTF8Iterator< It, Sentinel >::operator++ ( int  )
inlineconstexpr

◆ base()

template<typename It , typename Sentinel = It>
constexpr It donut::unicode::UTF8Iterator< It, Sentinel >::base ( ) const
inlineconstexpr

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