#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 CodePointAndSize & | operator= (const CodePointAndSize &)=default |
constexpr | CodePointAndSize (CodePointAndSize &&)=default |
constexpr CodePointAndSize & | operator= (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. | |
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.