blob: e185e3e76205a83c4ddcd43f048ea2747ae002f4 (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 | #ifndef CODEPOINT_ITERATOR_UTILITY_H_
#define CODEPOINT_ITERATOR_UTILITY_H_
#include <cstdint>
namespace UTF8 {
namespace dtl {
enum class CodeUnitType : std::uint8_t {
	CONTINUATION = (128 >> 0),       // 10000000
	LEADING      = (128 >> 1),       // 01000000
	THREE        = (128 >> 2),       // 00100000
	FOUR         = (128 >> 3),       // 00010000
};
enum class CodePoint : std::uint8_t {
	CONTINUATION = (UINT8_MAX >> 2), // 00111111
	TWO          = (UINT8_MAX >> 3), // 00011111
	THREE        = (UINT8_MAX >> 4), // 00001111
	FOUR         = (UINT8_MAX >> 5), // 00000111
};
bool match(const std::uint8_t&, CodeUnitType&&);
void write(char32_t&, const std::uint8_t&, CodePoint&&, const std::uint8_t&);
}
}
#endif  // CODEPOINT_ITERATOR_UTILITY_H_
 |