MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / get_utf8_mask

Function get_utf8_mask

modules/core/core/include/OpenString/unicode.h:62–73  ·  view source on GitHub ↗

* @param length length of a utf8 sequence * @return mask of utf8 code unit */

Source from the content-addressed store, hash-verified

60 * @return mask of utf8 code unit
61 */
62 [[nodiscard]] constexpr ochar8_t get_utf8_mask(const u64 length) noexcept
63 {
64 constexpr ochar8_t masks[] =
65 {
66 0b00111111_as_char,
67 0b01111111_as_char,
68 0b00011111_as_char,
69 0b00001111_as_char,
70 0b00000111_as_char,
71 };
72 return masks[length];
73 }
74
75 /**
76 * @param c start of a utf8 sequence

Callers 1

utf8_to_utf32Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected