libzypp: zypp-tui/utils/ansi.h File Reference

libzypp 17.38.14

ansi.h File Reference
`#include <cstdint>`
`#include <iostream>`
`#include <sstream>`
`#include <type_traits>`
`#include <memory>`
`#include <map>`
`#include <string>`
`#include <zypp-core/base/String.h>`

Go to the source code of this file.

## Classes
class | ztui::ansi::tty::EscapeSequence
| ANSI Escape sequences and their fallback if no tty. More...
struct | ztui::ansi::ColorTraits< Tp_ >
class | ztui::ansi::Color
| Various ways to define ansi SGR sequences. More...
union | ztui::ansi::Color::Comp
struct | ztui::ansi::ColorTraits< Color::Constant >
class | ztui::ansi::ColorString
| Colored string if do_colors. More...
class | ztui::ansi::ColorStream
| Colored stream output if do_colors. More...
struct | ztui::ansi::ColorStream::nullDeleter
class | ztui::ColorString
| Colored string if do_colors. More...
class | ztui::ColorStream
| Colored stream output if do_colors. More...

## Namespaces
namespace | ztui
namespace | ztui::ansi
namespace | ztui::ansi::tty
namespace | std

## Macros
#define | ZYPPER_TRACE_SGR 0
#define | ESC "\033"

## Typedefs
template<typename CCC_>
using | ztui::ansi::EnableIfCustomColorCtor = std::enable_if_t< ansi::ColorTraits<std::decay_t<CCC_>>::customColorCtor >
| relates: ColorTraits<Tp_> SFINAE: hide template signatures unless enum is enabled in ColorTraits
template<typename CCC_>
using | ztui::ansi::DisableIfCustomColorCtor = std::enable_if_t< !ansi::ColorTraits<std::decay_t<CCC_>>::customColorCtor >
| relates: ColorTraits<Tp_> SFINAE: hide template signatures unless enum is enabled in ColorTraits

## Functions
bool | ztui::do_ttyout ()
| True unless output is a dumb tty or file.
bool | ztui::do_colors ()
| If output is done in colors (depends on config).
bool | ztui::mayUseANSIEscapes ()
| Simple check whether stdout is a (not dumb) tty.
bool | ztui::hasANSIColor ()
| Simple check whether stdout can handle colors.
std::ostream & | ztui::ansi::tty::operator<< (std::ostream &str, const EscapeSequence &obj)
| relates: EscapeSequence stream output
std::ostream & | ztui::ansi::operator<< (std::ostream &str, Color obj)
| relates: Color Print the colors SGRsequence if do_colors is `true`
std::ostream & | ztui::ansi::operator<< (std::ostream &str, const ColorString &obj)
| relates: ColorString Print colored on ostream
template<class Tp_>
ansi::ColorStream | ztui::operator<< (ansi::Color color_r, Tp_ &&val_r)
| relates: ColorStream Create ColorStream via Color
ansi::ColorStream | ztui::operator<< (ansi::Color color_r, std::ostream &(*omanip)(std::ostream &))
template<class CCC_, class Tp_, typename = ansi::EnableIfCustomColorCtor<CCC_>>
ansi::ColorStream | ztui::operator<< (CCC_ &&color_r, Tp_ &&val_r)
| relates: ColorStream Create ColorStream via enum << expr
template<class CCC_, typename = ansi::EnableIfCustomColorCtor<CCC_>>
ansi::ColorStream | ztui::operator<< (CCC_ &&color_r, std::ostream &(*omanip)(std::ostream &))
template<class CCC_, typename = ztui::ansi::EnableIfCustomColorCtor<CCC_>>
ostream & | std::operator<< (ostream &str, CCC_ &&color_r)
| relates: ansi::Color Stream oputput for ColorTraits enabled types Defined in namespace 'std' because namespace of 'CCC_' may vary

## Variables
const EscapeSequence | ztui::ansi::tty::clearLN
| Clear entire line.
const EscapeSequence | ztui::ansi::tty::cursorUP
| Cursor up 1 line.
const EscapeSequence | ztui::ansi::tty::cursorDOWN
| Cursor down 1 line.
const EscapeSequence | ztui::ansi::tty::cursorRIGHT
| Cursor right 1 char.
const EscapeSequence | ztui::ansi::tty::cursorLEFT
| Cursor left 1 char.

## Macro Definition Documentation

## ◆ ZYPPER_TRACE_SGR

#define ZYPPER_TRACE_SGR 0

Definition at line 95 of file ansi.h.

## ◆ ESC

#define ESC "\033"

Definition at line 98 of file ansi.h.