ICU 78.1  78.1
Public Member Functions
U_HEADER_ONLY_NAMESPACE::UnsafeCodeUnits< CP32, UnitIter, typename > Class Template Reference

Result of decoding a code unit sequence for one code point. More...

#include <utfiterator.h>

Inheritance diagram for U_HEADER_ONLY_NAMESPACE::UnsafeCodeUnits< CP32, UnitIter, typename >:
U_HEADER_ONLY_NAMESPACE::CodeUnits< CP32, UnitIter, typename >

Public Member Functions

 UnsafeCodeUnits (CP32 codePoint, uint8_t length, UnitIter start, UnitIter limit)
 
 UnsafeCodeUnits (const UnsafeCodeUnits &other)=default
 Copy constructor. More...
 
UnsafeCodeUnitsoperator= (const UnsafeCodeUnits &other)=default
 Copy assignment operator. More...
 
CP32 codePoint () const
 
UnitIter begin () const
 
UnitIter end () const
 
uint8_t length () const
 
template<typename Iter = UnitIter, typename Unit = typename std::iterator_traits<Iter>::value_type>
std::enable_if_t< std::is_pointer_v< Iter >||std::is_same_v< Iter, typename std::basic_string< Unit >::iterator >||std::is_same_v< Iter, typename std::basic_string< Unit >::const_iterator >||std::is_same_v< Iter, typename std::basic_string_view< Unit >::iterator >||std::is_same_v< Iter, typename std::basic_string_view< Unit >::const_iterator >, std::basic_string_view< Unit > > stringView () const
 

Detailed Description

template<typename CP32, typename UnitIter, typename = void>
class U_HEADER_ONLY_NAMESPACE::UnsafeCodeUnits< CP32, UnitIter, typename >

Result of decoding a code unit sequence for one code point.

Returned from non-validating Unicode string code point iterators. Base class for class CodeUnits which is returned from validating iterators.

Template Parameters
CP32Code point type: UChar32 (=int32_t) or char32_t or uint32_t; should be signed if UTF_BEHAVIOR_NEGATIVE
UnitIterAn iterator (often a pointer) that returns a code unit type: UTF-8: char or char8_t or uint8_t; UTF-16: char16_t or uint16_t or (on Windows) wchar_t; UTF-32: char32_t or UChar32=int32_t or (on Linux) wchar_t
See also
UnsafeUTFIterator
UnsafeUTFStringCodePoints
Draft:
This API may be changed in the future versions and was introduced in ICU 78

Definition at line 357 of file utfiterator.h.

Constructor & Destructor Documentation

◆ UnsafeCodeUnits() [1/2]

template<typename CP32 , typename UnitIter , typename = void>
U_HEADER_ONLY_NAMESPACE::UnsafeCodeUnits< CP32, UnitIter, typename >::UnsafeCodeUnits ( CP32  codePoint,
uint8_t  length,
UnitIter  start,
UnitIter  limit 
)
inline
Internal:
Do not use.

This API is for internal use only.

Definition at line 362 of file utfiterator.h.

◆ UnsafeCodeUnits() [2/2]

template<typename CP32 , typename UnitIter , typename = void>
U_HEADER_ONLY_NAMESPACE::UnsafeCodeUnits< CP32, UnitIter, typename >::UnsafeCodeUnits ( const UnsafeCodeUnits< CP32, UnitIter, typename > &  other)
default

Copy constructor.

Draft:
This API may be changed in the future versions and was introduced in ICU 78

Member Function Documentation

◆ begin()

template<typename CP32 , typename UnitIter , typename = void>
UnitIter U_HEADER_ONLY_NAMESPACE::UnsafeCodeUnits< CP32, UnitIter, typename >::begin ( ) const
inline
Returns
the start of the code unit sequence for one code point. Only enabled if UnitIter is a (multi-pass) forward_iterator or better.
Draft:
This API may be changed in the future versions and was introduced in ICU 78

Definition at line 384 of file utfiterator.h.

◆ codePoint()

template<typename CP32 , typename UnitIter , typename = void>
CP32 U_HEADER_ONLY_NAMESPACE::UnsafeCodeUnits< CP32, UnitIter, typename >::codePoint ( ) const
inline
Returns
the Unicode code point decoded from the code unit sequence. If the sequence is ill-formed and the iterator validates, then this is a replacement value according to the iterator‘s UTFIllFormedBehavior template parameter.
Draft:
This API may be changed in the future versions and was introduced in ICU 78

Definition at line 377 of file utfiterator.h.

◆ end()

template<typename CP32 , typename UnitIter , typename = void>
UnitIter U_HEADER_ONLY_NAMESPACE::UnsafeCodeUnits< CP32, UnitIter, typename >::end ( ) const
inline
Returns
the limit (exclusive end) of the code unit sequence for one code point. Only enabled if UnitIter is a (multi-pass) forward_iterator or better.
Draft:
This API may be changed in the future versions and was introduced in ICU 78

Definition at line 391 of file utfiterator.h.

◆ length()

template<typename CP32 , typename UnitIter , typename = void>
uint8_t U_HEADER_ONLY_NAMESPACE::UnsafeCodeUnits< CP32, UnitIter, typename >::length ( ) const
inline
Returns
the length of the code unit sequence for one code point.
Draft:
This API may be changed in the future versions and was introduced in ICU 78

Definition at line 397 of file utfiterator.h.

◆ operator=()

template<typename CP32 , typename UnitIter , typename = void>
UnsafeCodeUnits& U_HEADER_ONLY_NAMESPACE::UnsafeCodeUnits< CP32, UnitIter, typename >::operator= ( const UnsafeCodeUnits< CP32, UnitIter, typename > &  other)
default

Copy assignment operator.

Draft:
This API may be changed in the future versions and was introduced in ICU 78

◆ stringView()

template<typename CP32 , typename UnitIter , typename = void>
template<typename Iter = UnitIter, typename Unit = typename std::iterator_traits<Iter>::value_type>
std::enable_if_t<std::is_pointer_v<Iter> || std::is_same_v<Iter, typename std::basic_string<Unit>::iterator> || std::is_same_v<Iter, typename std::basic_string<Unit>::const_iterator> || std::is_same_v<Iter, typename std::basic_string_view<Unit>::iterator> || std::is_same_v<Iter, typename std::basic_string_view<Unit>::const_iterator>, std::basic_string_view<Unit> > U_HEADER_ONLY_NAMESPACE::UnsafeCodeUnits< CP32, UnitIter, typename >::stringView ( ) const
inline
Returns
a string_view of the code unit sequence for one code point. Only works if UnitIter is a pointer or a contiguous_iterator.
Draft:
This API may be changed in the future versions and was introduced in ICU 78

Definition at line 422 of file utfiterator.h.


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