utest: + code_location test

This commit is contained in:
Roland Conybeare 2023-09-22 14:55:38 -04:00
commit b2d939363e
5 changed files with 73 additions and 1 deletions

View file

@ -14,6 +14,18 @@ namespace xo {
rgb
};
inline std::ostream &
operator<< (std::ostream & os, color_encoding x) {
switch(x) {
case color_encoding::none: os << "none"; break;
case color_encoding::ansi: os << "ansi"; break;
case color_encoding::xterm: os << "xterm"; break;
case color_encoding::rgb: os << "rgb"; break;
default: os << "???"; break;
}
return os;
} /*operator<<*/
/* specify a color (consistent with ANSI escape sequences - the Select Graphics Rendition subset
* see [[https://stackoverflow.com/questions/4842424/list-of-ansi-color-escape-sequences]]
*
@ -106,6 +118,12 @@ namespace xo {
std::uint32_t code_ = 0;
}; /*color_spec_type*/
inline std::ostream &
operator<< (std::ostream & os, color_spec_type const & x) {
os << "<color_spec_type :encoding " << x.encoding() << " :code " << x.code() << ">";
return os;
} /*operator<<*/
enum class coloring_control_flags : std::uint8_t {
none = 0x0,
color_on = 0x01,

View file

@ -20,6 +20,11 @@ namespace xo {
T2 x2_;
}; /*concat_impl*/
template <typename T1>
T1 concat(T1 && x1) {
return x1;
} /*concat*/
template <typename T1, typename T2>
concat_impl<T1,T2> concat(T1 && x1, T2 && x2) {
return concat_impl<T1,T2>(std::move(x1), std::move(x2));