HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
text_decoration.hpp
1// Copyright Take Vos 2021.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#pragma once
6
7#include "../utility/utility.hpp"
8#include "../macros.hpp"
9#include <unordered_map>
10#include <string>
11#include <ostream>
12
13
14
15namespace hi::inline v1 {
16
23enum class text_decoration {
24 None,
25 Underline,
26 WavyUnderline,
27 StrikeThrough
28};
29
30// clang-format off
31constexpr auto text_decoration_metadata = enum_metadata{
32 text_decoration::None, "none",
33 text_decoration::Underline, "underline",
34 text_decoration::WavyUnderline, "wavy-underline",
35 text_decoration::StrikeThrough, "strike-through"
36};
37// clang-format on
38
39[[nodiscard]] inline std::string_view to_string(text_decoration const &rhs) noexcept
40{
41 return text_decoration_metadata[rhs];
42}
43
44inline std::ostream &operator<<(std::ostream &lhs, text_decoration const &rhs)
45{
46 return lhs << text_decoration_metadata[rhs];
47}
48
49} // namespace hi::inline v1
DOXYGEN BUG.
Definition algorithm.hpp:16
text_decoration
Describes how a grapheme should be underlined when rendering the text.
Definition text_decoration.hpp:23
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377
T to_string(T... args)