#include <xtd/console>
#include <xtd/enum_class>
#include <xtd/environment>
#include <xtd/format>
enum class text_styles {
bold = 0b1,
italic = 0b10,
underline = 0b100,
strikeout = 0b1000,
};
explicit operator auto()
const noexcept {
return xtd::enum_collection<text_styles> {{text_styles::normal,
"normal"}, {text_styles::bold,
"bold"}, {text_styles::italic,
"italic"}, {text_styles::underline,
"underline"}, {text_styles::strikeout,
"strikeout"}};}
};
auto print_text_styles(
const string&
text, text_styles value, cap
c) {
<<
"┌───────────────────────────────────────────────┬────────────┬──────────────────────────────────┐" <<
environment::new_line
<<
"├───────────────────────────────────────────────┼────────────┼──────────────────────────────────┤" <<
environment::new_line;
else
}
auto main() -> int {
print_text_styles("text_styles::normal", text_styles::normal, cap::title);
print_text_styles("text_styles::bold|text_styles::italic", text_styles::bold|text_styles::italic, cap::middle);
print_text_styles("text_styles::strikeout", text_styles::strikeout, cap::end);
}
static std::ostream out
Gets the standard output stream. A std::basic_ostream<char_t> that represents the standard output str...
Definition console.hpp:52
static xtd::string new_line() noexcept
Gets the newline string defined for this environment.
#define flags_attribute_(namespace_name, enum_type)
Provides the set attribute struct for enumerations helper.
Definition flags_attribute.hpp:34
std::vector< std::pair< enum_t, xtd::string > > enum_collection
Represents a pair of an enum_t value and a string of an enum of type enum_t.
Definition enum_collection.hpp:24
@ c
The C key.
Definition console_key.hpp:92
@ normal
Represent the exit mode when the terminates normally (via xtd::environment::exit or returning from th...
Definition exit_mode.hpp:20
Contains classes that represent ASCII and Unicode character encodings; abstract base classes for conv...
Definition basic_string_builder.hpp:16
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
const_iterator end() const
Returns an iterator to the end.
Definition read_only_span.hpp:213
Provides the registration struct for enumerations.
Definition enum_register.hpp:38