8#include "../utility/module.hpp"
11namespace hi::inline
v1 {
30constexpr auto text_phrasing_metadata = enum_metadata{
31 text_phrasing::regular,
"regular",
32 text_phrasing::emphesis,
"emphesis",
33 text_phrasing::strong,
"strong",
34 text_phrasing::code,
"code",
35 text_phrasing::abbreviation,
"abbreviation",
36 text_phrasing::bold,
"bold",
37 text_phrasing::italic,
"italic",
38 text_phrasing::citation,
"citation",
39 text_phrasing::keyboard,
"keyboard",
40 text_phrasing::mark,
"mark",
41 text_phrasing::math,
"math",
42 text_phrasing::example,
"example",
43 text_phrasing::unarticulated,
"unarticulated",
47enum class text_phrasing_mask : uint16_t {
48 regular = 1 << to_underlying(text_phrasing::regular),
49 emphesis = 1 << to_underlying(text_phrasing::emphesis),
50 strong = 1 << to_underlying(text_phrasing::strong),
51 code = 1 << to_underlying(text_phrasing::code),
52 abbreviation = 1 << to_underlying(text_phrasing::abbreviation),
53 bold = 1 << to_underlying(text_phrasing::bold),
54 italic = 1 << to_underlying(text_phrasing::italic),
55 citation = 1 << to_underlying(text_phrasing::citation),
56 keyboard = 1 << to_underlying(text_phrasing::keyboard),
57 mark = 1 << to_underlying(text_phrasing::mark),
58 math = 1 << to_underlying(text_phrasing::math),
59 example = 1 << to_underlying(text_phrasing::example),
60 unarticulated = 1 << to_underlying(text_phrasing::unarticulated),
62 all = regular | emphesis | strong | code | abbreviation | bold | italic | citation |
keyboard |
mark | math |
example |
66[[nodiscard]]
constexpr text_phrasing_mask to_text_phrasing_mask(text_phrasing
const& rhs)
noexcept
68 hi_axiom(to_underlying(rhs) <
sizeof(text_phrasing_mask) * CHAR_BIT);
69 return static_cast<text_phrasing_mask
>(1 << to_underlying(rhs));
72[[nodiscard]]
constexpr text_phrasing_mask operator&(text_phrasing_mask
const& lhs, text_phrasing_mask
const& rhs)
noexcept
74 return static_cast<text_phrasing_mask
>(to_underlying(lhs) & to_underlying(rhs));
77[[nodiscard]]
constexpr text_phrasing_mask operator|(text_phrasing_mask
const& lhs, text_phrasing_mask
const& rhs)
noexcept
79 return static_cast<text_phrasing_mask
>(to_underlying(lhs) | to_underlying(rhs));
82[[nodiscard]]
constexpr bool all(text_phrasing_mask
const& rhs)
noexcept
84 return (rhs & text_phrasing_mask::all) == text_phrasing_mask::all;
87[[nodiscard]]
constexpr bool to_bool(text_phrasing_mask
const& rhs)
noexcept
89 return to_bool(to_underlying(rhs));
#define hi_axiom(expression,...)
Specify an axiom; an expression that is true.
Definition assert.hpp:238
@ keyboard
The gui_event has keyboard data.
DOXYGEN BUG.
Definition algorithm.hpp:13
text_phrasing
Definition text_phrasing.hpp:13
@ example
Used for displaying console output.
@ unarticulated
underlined