9#include "../exception.hpp"
12namespace hi::inline
v1 {
45[[nodiscard]]
constexpr bool is_isolate_starter(unicode_bidi_class
const &rhs)
noexcept
47 using enum unicode_bidi_class;
48 return rhs == LRI || rhs == RLI || rhs == FSI;
51[[nodiscard]]
constexpr bool is_isolate_formatter(unicode_bidi_class
const &rhs)
noexcept
54 return is_isolate_starter(rhs) || rhs ==
PDI;
57[[nodiscard]]
constexpr bool is_NI(unicode_bidi_class
const &rhs)
noexcept
60 return rhs == B || rhs == S || rhs ==
WS || rhs ==
ON || rhs ==
FSI || rhs ==
LRI || rhs ==
RLI || rhs ==
PDI;
63[[nodiscard]]
constexpr bool is_control(unicode_bidi_class
const &rhs)
noexcept
66 return rhs ==
RLE or rhs ==
LRE or rhs ==
RLO or rhs ==
LRO or rhs ==
PDF or rhs ==
BN;
69[[nodiscard]]
constexpr unicode_bidi_class unicode_bidi_class_from_string(std::string_view str)
noexcept
75 }
else if (str ==
"R") {
77 }
else if (str ==
"AL") {
79 }
else if (str ==
"EN") {
81 }
else if (str ==
"ES") {
83 }
else if (str ==
"ET") {
85 }
else if (str ==
"AN") {
87 }
else if (str ==
"CS") {
89 }
else if (str ==
"NSM") {
91 }
else if (str ==
"BN") {
93 }
else if (str ==
"B") {
95 }
else if (str ==
"S") {
97 }
else if (str ==
"WS") {
99 }
else if (str ==
"ON") {
101 }
else if (str ==
"LRE") {
103 }
else if (str ==
"LRO") {
105 }
else if (str ==
"RLE") {
107 }
else if (str ==
"RLO") {
109 }
else if (str ==
"PDF") {
111 }
else if (str ==
"LRI") {
113 }
else if (str ==
"RLI") {
115 }
else if (str ==
"FSI") {
117 }
else if (str ==
"PDI") {
Utilities to assert and bound check.
#define hi_no_default(...)
This part of the code should not be reachable, unless a programming bug.
Definition assert.hpp:148
DOXYGEN BUG.
Definition algorithm.hpp:15
unicode_bidi_class
Bidirectional class Unicode Standard Annex #9: https://unicode.org/reports/tr9/.
Definition unicode_bidi_class.hpp:17
@ LRO
Left-to-Right Override.
@ ES
European Number Separator.
@ FSI
First Strong Isolate.
@ RLE
Right-to-Left Embedding.
@ LRI
Left-to-Right Isolate.
@ CS
Common Number Separator.
@ PDI
Pop Directional Isolate.
@ ET
European Number Terminator.
@ RLI
Right-to-Left Isolate.
@ PDF
Pop Directional Format.
@ RLO
Right-to-left Override.
@ AL
Right-to-Left Arabic.
@ LRE
Left-to-Right Embedding.