Pigweed
 
Loading...
Searching...
No Matches
pw::utf::CodePointAndSize Class Referencefinal

#include <utf_codecs.h>

Public Member Functions

constexpr CodePointAndSize (uint32_t code_point, size_t size)
 Creates a combined view of a @code_point and its encoded @size.
 
constexpr CodePointAndSize (const CodePointAndSize &)=default
 
constexpr CodePointAndSizeoperator= (const CodePointAndSize &)=default
 
constexpr CodePointAndSize (CodePointAndSize &&)=default
 
constexpr CodePointAndSizeoperator= (CodePointAndSize &&)=default
 
constexpr uint32_t code_point () const
 Returns the code point this represents.
 
constexpr size_t size () const
 Returns the number of bytes required to encode this codepoint.
 

Detailed Description

Provides a combined view of a valid codepoint and the number of bytes its encoding requires. The maximum valid codepoint is 0x10FFFFU which requires 20 bits to represent. This combined view uses the available upper bits to encode the number of bytes required to represent the codepoint when UTF encoded.


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