HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
TextDecoration.hpp
1// Copyright 2020 Pokitec
2// All rights reserved.
3
4#pragma once
5
6#include <unordered_map>
7#include <string>
8#include <ostream>
9
10namespace tt {
11
18enum class TextDecoration {
19 None,
20 Underline,
21 WavyUnderline,
22 StrikeThrough,
23
24 max = StrikeThrough
25};
26
27inline ttlet TextDecoration_from_string_table = std::unordered_map<std::string,TextDecoration>{
28 {"none", TextDecoration::None},
29 {"underline", TextDecoration::Underline},
30 {"wavy-underline", TextDecoration::WavyUnderline},
31 {"strike-through", TextDecoration::StrikeThrough},
32};
33
34[[nodiscard]] inline char const *to_const_string(TextDecoration const &rhs) noexcept
35{
36 switch (rhs) {
37 case TextDecoration::None: return "none";
38 case TextDecoration::Underline: return "underline";
39 case TextDecoration::WavyUnderline: return "wavy-underline";
40 case TextDecoration::StrikeThrough: return "strike-through";
41 default: tt_no_default;
42 }
43}
44
45[[nodiscard]] inline std::string to_string(TextDecoration const &rhs) noexcept
46{
47 return to_const_string(rhs);
48}
49
50inline std::ostream &operator<<(std::ostream &lhs, TextDecoration const &rhs)
51{
52 return lhs << to_const_string(rhs);
53}
54
55}
T max(T... args)
T to_string(T... args)