10#include "../enum_metadata.hpp"
13namespace hi::inline
v1 {
32constexpr auto text_phrasing_metadata = enum_metadata{
33 text_phrasing::regular,
"regular",
34 text_phrasing::emphesis,
"emphesis",
35 text_phrasing::strong,
"strong",
36 text_phrasing::code,
"code",
37 text_phrasing::abbreviation,
"abbreviation",
38 text_phrasing::bold,
"bold",
39 text_phrasing::italic,
"italic",
40 text_phrasing::citation,
"citation",
41 text_phrasing::keyboard,
"keyboard",
42 text_phrasing::mark,
"mark",
43 text_phrasing::math,
"math",
44 text_phrasing::example,
"example",
45 text_phrasing::unarticulated,
"unarticulated",
49enum class text_phrasing_mask : uint16_t {
50 regular = 1 << to_underlying(text_phrasing::regular),
51 emphesis = 1 << to_underlying(text_phrasing::emphesis),
52 strong = 1 << to_underlying(text_phrasing::strong),
53 code = 1 << to_underlying(text_phrasing::code),
54 abbreviation = 1 << to_underlying(text_phrasing::abbreviation),
55 bold = 1 << to_underlying(text_phrasing::bold),
56 italic = 1 << to_underlying(text_phrasing::italic),
57 citation = 1 << to_underlying(text_phrasing::citation),
58 keyboard = 1 << to_underlying(text_phrasing::keyboard),
59 mark = 1 << to_underlying(text_phrasing::mark),
60 math = 1 << to_underlying(text_phrasing::math),
61 example = 1 << to_underlying(text_phrasing::example),
62 unarticulated = 1 << to_underlying(text_phrasing::unarticulated),
64 all = regular | emphesis | strong | code | abbreviation | bold | italic | citation |
keyboard |
mark | math |
example |
68[[nodiscard]]
constexpr text_phrasing_mask to_text_phrasing_mask(text_phrasing
const& rhs)
noexcept
70 hi_axiom(to_underlying(rhs) <
sizeof(text_phrasing_mask) * CHAR_BIT);
71 return static_cast<text_phrasing_mask
>(1 << to_underlying(rhs));
74[[nodiscard]]
constexpr text_phrasing_mask operator&(text_phrasing_mask
const& lhs, text_phrasing_mask
const& rhs)
noexcept
76 return static_cast<text_phrasing_mask
>(to_underlying(lhs) & to_underlying(rhs));
79[[nodiscard]]
constexpr text_phrasing_mask operator|(text_phrasing_mask
const& lhs, text_phrasing_mask
const& rhs)
noexcept
81 return static_cast<text_phrasing_mask
>(to_underlying(lhs) | to_underlying(rhs));
84[[nodiscard]]
constexpr bool all(text_phrasing_mask
const& rhs)
noexcept
86 return (rhs & text_phrasing_mask::all) == text_phrasing_mask::all;
89[[nodiscard]]
constexpr bool to_bool(text_phrasing_mask
const& rhs)
noexcept
91 return to_bool(to_underlying(rhs));
#define hi_axiom(expression,...)
Specify an axiom; an expression that is true.
Definition assert.hpp:133
Utilities used by the HikoGUI library itself.
@ keyboard
The gui_event has keyboard data.
DOXYGEN BUG.
Definition algorithm.hpp:15
text_phrasing
Definition text_phrasing.hpp:15
@ example
Used for displaying console output.
@ unarticulated
underlined