Go to the source code of this file.
◆ is_align2()
static constexpr bool is_align2 |
( |
T |
x | ) |
|
|
staticconstexpr |
Definition at line 12 of file SkUTF.cpp.
12{
return 0 == (
x & 1); }
◆ is_align4()
static constexpr bool is_align4 |
( |
T |
x | ) |
|
|
staticconstexpr |
Definition at line 14 of file SkUTF.cpp.
14{
return 0 == (
x & 3); }
◆ left_shift()
static constexpr int32_t left_shift |
( |
int32_t |
value, |
|
|
int32_t |
shift |
|
) |
| |
|
inlinestaticconstexpr |
Definition at line 8 of file SkUTF.cpp.
8 {
9 return (int32_t) ((uint32_t)
value << shift);
10}
◆ next_fail()
static SkUnichar next_fail |
( |
const T ** |
ptr, |
|
|
const T * |
end |
|
) |
| |
|
static |
Definition at line 113 of file SkUTF.cpp.
113 {
115 return -1;
116}
◆ utf16_is_high_surrogate()
static constexpr bool utf16_is_high_surrogate |
( |
uint16_t |
c | ) |
|
|
inlinestaticconstexpr |
Definition at line 16 of file SkUTF.cpp.
16{ return (c & 0xFC00) == 0xD800; }
◆ utf16_is_low_surrogate()
static constexpr bool utf16_is_low_surrogate |
( |
uint16_t |
c | ) |
|
|
inlinestaticconstexpr |
Definition at line 18 of file SkUTF.cpp.
18{ return (c & 0xFC00) == 0xDC00; }
◆ utf8_byte_is_continuation()
static bool utf8_byte_is_continuation |
( |
uint8_t |
c | ) |
|
|
static |
Definition at line 43 of file SkUTF.cpp.
static int utf8_byte_type(uint8_t c)
◆ utf8_byte_type()
static int utf8_byte_type |
( |
uint8_t |
c | ) |
|
|
static |
- Returns
- -1 iff invalid UTF8 byte, 0 iff UTF8 continuation byte, 1 iff ASCII byte, 2 iff leading byte of 2-byte sequence, 3 iff leading byte of 3-byte sequence, and 4 iff leading byte of 4-byte sequence. I.e.: if return value > 0, then gives length of sequence.
Definition at line 28 of file SkUTF.cpp.
28 {
29 if (c < 0x80) {
30 return 1;
31 } else if (c < 0xC0) {
32 return 0;
33 } else if (c >= 0xF5 || (c & 0xFE) == 0xC0) {
34 return -1;
35 } else {
36 int value = (((0xe5 << 24) >> ((
unsigned)c >> 4 << 1)) & 3) + 1;
37
39 }
40}
◆ utf8_type_is_valid_leading_byte()
static bool utf8_type_is_valid_leading_byte |
( |
int |
type | ) |
|
|
static |