CoreComponents 3.0.0
A Modern C++ Toolkit
Loading...
Searching...
No Matches
Utf16 Class Reference

Iterate Unicode code points of an UTF-16 encoded string. More...

#include <cc/Utf16>

Public Member Functions

 Utf16 (const std::uint16_t *s, long n)
 Create an UTF-16 facade for the UTF-16 string s of length n.
 
 Utf16 (const String &s)
 Create an UTF-16 facade for reading the UTF-16 encoded string s.
 
Utf16Iterator begin () const
 Begin of iteration sequence.
 
Utf16Iterator end () const
 End of iteration sequence.
 
long count () const
 Count number of code points.
 

Static Public Member Functions

static int encodedSize (char32_t ch)
 Get encoded size of code point ch.
 

Detailed Description

Iterate Unicode code points of an UTF-16 encoded string.

Constructor & Destructor Documentation

◆ Utf16() [1/2]

Utf16 ( const std::uint16_t * s,
long n )

Create an UTF-16 facade for the UTF-16 string s of length n.

◆ Utf16() [2/2]

Utf16 ( const String & s)

Create an UTF-16 facade for reading the UTF-16 encoded string s.

Todo
FIXME argument type should be Bytes

Member Function Documentation

◆ encodedSize()

static int encodedSize ( char32_t ch)
static

Get encoded size of code point ch.

◆ begin()

Utf16Iterator begin ( ) const

Begin of iteration sequence.

◆ end()

Utf16Iterator end ( ) const

End of iteration sequence.

◆ count()

long count ( ) const

Count number of code points.