HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
ucd_bidi_paired_bracket_types.hpp
1// This file was generated by generate_unicode_data.py
2
3#pragma once
4
5#include "../utility/utility.hpp"
6#include <cstdint>
7#include <optional>
8
9
10
11namespace hi {
12inline namespace v1 {
13namespace detail {
14
15constexpr auto ucd_bidi_paired_bracket_types_chunk_size = 128_uz;
16constexpr auto ucd_bidi_paired_bracket_types_index_width = 4_uz;
17constexpr auto ucd_bidi_paired_bracket_types_indices_size = 512_uz;
18constexpr auto ucd_bidi_paired_bracket_type_width = 2_uz;
19
20static_assert(std::has_single_bit(ucd_bidi_paired_bracket_types_chunk_size));
21
22constexpr uint8_t ucd_bidi_paired_bracket_types_indices_bytes[272] = {
23 1, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 33, 17, 17, 17, 17, 17, 17, 19, 17, 17, 17, 17, 17, 17, 17, 17, 17,
24 69, 17, 17, 97, 17, 17, 17,120, 17, 25, 17, 17, 17, 17,161, 17,177, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
25 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
26 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
27 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
28 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
29 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
30 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,193,209,
31 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
32};
33
34constexpr uint8_t ucd_bidi_paired_bracket_types_bytes[464] = {
35 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 32, 0, 0, 0, 0, 0, 0, 1, 32,
36 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
37 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
38 0, 0, 0, 0, 0, 0, 1,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
39 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,
40 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
41 0, 0,102, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
42 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,102,102,102, 96, 0, 0,
43 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 6,102,102, 0, 0, 0, 0,
44 1,153,153,153,153,153,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,102, 0, 0, 0, 0, 0, 0, 0, 0, 96,
45 0, 0, 0, 0, 0, 0, 0, 0, 6,102, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25,153,128, 0, 0, 0, 0, 0, 0, 0, 0,
46 0, 0,102,102, 96,102,102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
47 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25,152, 0, 0, 0, 0, 0, 0, 0, 0,
48 0, 0, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 32, 0, 0, 0, 0, 0, 0, 1, 33,134, 0, 0, 0, 0, 0, 0, 0,
49 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
50};
51
52
53} // namespace detail
54
55enum class unicode_bidi_paired_bracket_type : uint8_t {
56 n = 0,
57 o = 1,
58 c = 2,
59};
60
61[[nodiscard]] constexpr unicode_bidi_paired_bracket_type ucd_get_bidi_paired_bracket_type(char32_t code_point) noexcept
62{
63 constexpr auto max_code_point_hi = detail::ucd_bidi_paired_bracket_types_indices_size - 1;
64
65 auto code_point_hi = code_point / detail::ucd_bidi_paired_bracket_types_chunk_size;
66 hilet code_point_lo = code_point % detail::ucd_bidi_paired_bracket_types_chunk_size;
67
70 }
71
73 detail::ucd_bidi_paired_bracket_types_indices_bytes,
74 code_point_hi * detail::ucd_bidi_paired_bracket_types_index_width);
75
76 // Add back in the lower-bits of the code-point.
77 hilet index = (chunk_index * detail::ucd_bidi_paired_bracket_types_chunk_size) + code_point_lo;
78
79 // Get the canonical combining class from the table.
81 detail::ucd_bidi_paired_bracket_types_bytes, index * detail::ucd_bidi_paired_bracket_type_width);
82
83 return static_cast<unicode_bidi_paired_bracket_type>(value);
84}
85
86}} // namespace hi::v1
87
DOXYGEN BUG.
Definition algorithm.hpp:16
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377