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 "../enum_metadata.hpp"
8#include <unordered_map>
9#include <string>
10#include <ostream>
11
12namespace hi::inline v1 {
13
20enum class text_decoration {
21 None,
22 Underline,
23 WavyUnderline,
24 StrikeThrough
25};
26
27// clang-format off
28constexpr auto text_decoration_metadata = enum_metadata{
29 text_decoration::None, "none",
30 text_decoration::Underline, "underline",
31 text_decoration::WavyUnderline, "wavy-underline",
32 text_decoration::StrikeThrough, "strike-through"
33};
34// clang-format on
35
36[[nodiscard]] inline std::string_view to_string(text_decoration const &rhs) noexcept
37{
38 return text_decoration_metadata[rhs];
39}
40
41inline std::ostream &operator<<(std::ostream &lhs, text_decoration const &rhs)
42{
43 return lhs << text_decoration_metadata[rhs];
44}
45
46} // namespace hi::inline v1
T to_string(T... args)