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

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

#include <cc/Utf8>

Public Member Functions

 Utf8 (const char *s)
 Create a UTF-8 facade for byte string s.
 
 Utf8 (const char *s, long n)
 Create a UTF-8 facade for byte string s of length n.
 
 Utf8 (const String &s)
 Create a UTF-8 facade for byte string s.
 
Utf8Iterator begin () const
 Begin of iteration sequence.
 
Utf8Iterator 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-8 encoded string.

Constructor & Destructor Documentation

◆ Utf8() [1/3]

Utf8 ( const char * s)

Create a UTF-8 facade for byte string s.

◆ Utf8() [2/3]

Utf8 ( const char * s,
long n )

Create a UTF-8 facade for byte string s of length n.

◆ Utf8() [3/3]

Utf8 ( const String & s)

Create a UTF-8 facade for byte string s.

Member Function Documentation

◆ encodedSize()

static int encodedSize ( char32_t ch)
static

Get encoded size of code point ch.

◆ begin()

Utf8Iterator begin ( ) const

Begin of iteration sequence.

◆ end()

Utf8Iterator end ( ) const

End of iteration sequence.

◆ count()

long count ( ) const

Count number of code points.