Flutter Engine
The Flutter Engine
|
Functions | |
SK_SPI int | CountUTF8 (const char *utf8, size_t byteLength) |
SK_SPI int | CountUTF16 (const uint16_t *utf16, size_t byteLength) |
SK_SPI int | CountUTF32 (const int32_t *utf32, size_t byteLength) |
SK_SPI SkUnichar | NextUTF8 (const char **ptr, const char *end) |
SK_SPI SkUnichar | NextUTF8WithReplacement (const char **ptr, const char *end) |
SK_SPI SkUnichar | NextUTF16 (const uint16_t **ptr, const uint16_t *end) |
SK_SPI SkUnichar | NextUTF32 (const int32_t **ptr, const int32_t *end) |
SK_SPI size_t | ToUTF8 (SkUnichar uni, char utf8[kMaxBytesInUTF8Sequence]=nullptr) |
SK_SPI size_t | ToUTF16 (SkUnichar uni, uint16_t utf16[2]=nullptr) |
SK_SPI int | UTF8ToUTF16 (uint16_t dst[], int dstCapacity, const char src[], size_t srcByteLength) |
SK_SPI int | UTF16ToUTF8 (char dst[], int dstCapacity, const uint16_t src[], size_t srcLength) |
static bool | IsLeadingSurrogateUTF16 (uint16_t c) |
static bool | IsTrailingSurrogateUTF16 (uint16_t c) |
Variables | |
constexpr unsigned | kMaxBytesInUTF8Sequence = 4 |
int SkUTF::CountUTF16 | ( | const uint16_t * | utf16, |
size_t | byteLength | ||
) |
Given a sequence of aligned UTF-16 characters in machine-endian form, return the number of unicode codepoints. If the sequence is invalid UTF-16, return -1.
Definition at line 70 of file SkUTF.cpp.
int SkUTF::CountUTF32 | ( | const int32_t * | utf32, |
size_t | byteLength | ||
) |
Given a sequence of aligned UTF-32 characters in machine-endian form, return the number of unicode codepoints. If the sequence is invalid UTF-32, return -1.
Definition at line 96 of file SkUTF.cpp.
int SkUTF::CountUTF8 | ( | const char * | utf8, |
size_t | byteLength | ||
) |
Given a sequence of UTF-8 bytes, return the number of unicode codepoints. If the sequence is invalid UTF-8, return -1.
Definition at line 47 of file SkUTF.cpp.
|
inlinestatic |
Given a UTF-16 code point, returns true iff it is a leading surrogate. https://unicode.org/faq/utf_bom.html#utf16-2
Definition at line 91 of file SkUTF.h.
|
inlinestatic |
Given a UTF-16 code point, returns true iff it is a trailing surrogate. https://unicode.org/faq/utf_bom.html#utf16-2
Definition at line 97 of file SkUTF.h.
SkUnichar SkUTF::NextUTF16 | ( | const uint16_t ** | ptr, |
const uint16_t * | end | ||
) |
Given a sequence of aligned UTF-16 characters in machine-endian form, return the first unicode codepoint. The pointer will be incremented to point at the next codepoint's start. If invalid UTF-16 is encountered, set *ptr to end and return -1.
Definition at line 159 of file SkUTF.cpp.
SkUnichar SkUTF::NextUTF32 | ( | const int32_t ** | ptr, |
const int32_t * | end | ||
) |
Given a sequence of aligned UTF-32 characters in machine-endian form, return the first unicode codepoint. The pointer will be incremented to point at the next codepoint's start. If invalid UTF-32 is encountered, set *ptr to end and return -1.
Definition at line 197 of file SkUTF.cpp.
SkUnichar SkUTF::NextUTF8 | ( | const char ** | ptr, |
const char * | end | ||
) |
Given a sequence of UTF-8 bytes, return the first unicode codepoint. The pointer will be incremented to point at the next codepoint's start. If invalid UTF-8 is encountered, set *ptr to end and return -1.
Definition at line 118 of file SkUTF.cpp.
SkUnichar SkUTF::NextUTF8WithReplacement | ( | const char ** | ptr, |
const char * | end | ||
) |
Given a sequence of UTF-8 bytes, return the first unicode codepoint. The pointer will be incremented to point at the next codepoint's start. If invalid UTF-8 is encountered, set *ptr to end and return the replacement character (0xFFFD)
Definition at line 154 of file SkUTF.cpp.
size_t SkUTF::ToUTF16 | ( | SkUnichar | uni, |
uint16_t | utf16[2] = nullptr |
||
) |
Convert the unicode codepoint into UTF-16. If utf16
is non-null, place the result in that array. Return the number of UTF-16 code units in the result (1 or 2). If utf16
is null, simply return the number of code units that would be used. For invalid unicode codepoints, return 0.
Definition at line 243 of file SkUTF.cpp.
Convert the unicode codepoint into UTF-8. If utf8
is non-null, place the result in that array. Return the number of bytes in the result. If utf8
is null, simply return the number of bytes that would be used. For invalid unicode codepoints, return 0.
Returns the number of resulting UTF8 values needed to convert the src utf16 sequence. If dst is not null, it is filled with the corresponding values up to its capacity. If there is an error, -1 is returned and the dst[] buffer is undefined.
Definition at line 291 of file SkUTF.cpp.
Returns the number of resulting UTF16 values needed to convert the src utf8 sequence. If dst is not null, it is filled with the corresponding values up to its capacity. If there is an error, -1 is returned and the dst[] buffer is undefined.
Definition at line 259 of file SkUTF.cpp.