5#include "../utility/utility.hpp"
12hi_export_module(hikogui.unicode.ucd_bidi_paired_bracket_types);
14hi_export
namespace hi {
18constexpr auto ucd_bidi_paired_bracket_types_chunk_size = 128_uz;
19constexpr auto ucd_bidi_paired_bracket_types_index_width = 4_uz;
20constexpr auto ucd_bidi_paired_bracket_types_indices_size = 512_uz;
21constexpr auto ucd_bidi_paired_bracket_type_width = 2_uz;
23static_assert(std::has_single_bit(ucd_bidi_paired_bracket_types_chunk_size));
25constexpr uint8_t ucd_bidi_paired_bracket_types_indices_bytes[272] = {
26 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,
27 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,
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, 17, 17,
31 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,
32 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,
33 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,102, 0, 0, 0, 0, 0, 0, 0, 0, 96,
48 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,
49 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,
50 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,
51 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,
52 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
58enum class unicode_bidi_paired_bracket_type : uint8_t {
64[[nodiscard]]
constexpr unicode_bidi_paired_bracket_type ucd_get_bidi_paired_bracket_type(
char32_t code_point)
noexcept
66 constexpr auto max_code_point_hi = detail::ucd_bidi_paired_bracket_types_indices_size - 1;
68 auto code_point_hi = code_point / detail::ucd_bidi_paired_bracket_types_chunk_size;
69 auto const code_point_lo = code_point % detail::ucd_bidi_paired_bracket_types_chunk_size;
71 if (code_point_hi > max_code_point_hi) {
72 code_point_hi = max_code_point_hi;
75 auto const chunk_index = load_bits_be<detail::ucd_bidi_paired_bracket_types_index_width>(
76 detail::ucd_bidi_paired_bracket_types_indices_bytes,
77 code_point_hi * detail::ucd_bidi_paired_bracket_types_index_width);
80 auto const index = (chunk_index * detail::ucd_bidi_paired_bracket_types_chunk_size) + code_point_lo;
83 auto const value = load_bits_be<detail::ucd_bidi_paired_bracket_type_width>(
84 detail::ucd_bidi_paired_bracket_types_bytes, index * detail::ucd_bidi_paired_bracket_type_width);
86 return static_cast<unicode_bidi_paired_bracket_type
>(value);
The HikoGUI namespace.
Definition array_generic.hpp:20
DOXYGEN BUG.
Definition algorithm_misc.hpp:20