GlitchyByte Lib  0.3.1
GlitchyByte general library to bootstrap development.
Namespaces | Macros | Typedefs | Functions
terminal.hpp File Reference

Namespaces

 gb
 
 gb::terminal
 

Macros

#define GB_TERMINAL_TOKEN   "@"
 
#define GB_TERMINAL_CSI   "\u001b["
 
#define GB_TERMINAL_CSI_COLOR_RESET   GB_TERMINAL_CSI "0m"
 
#define GB_TERMINAL_CSI_COLOR_FOREGROUND   GB_TERMINAL_CSI "38;5;" GB_TERMINAL_TOKEN "m"
 
#define GB_TERMINAL_CSI_CLEAR_CURRENT_LINE   GB_TERMINAL_CSI "2K"
 
#define GB_TERMINAL_CSI_CLEAR_TO_END_OF_LINE   GB_TERMINAL_CSI "0K"
 
#define GB_TERMINAL_CSI_CLEAR_TO_START_OF_LINE   GB_TERMINAL_CSI "1K"
 
#define GB_TERMINAL_CSI_CURSOR_UP   GB_TERMINAL_CSI GB_TERMINAL_TOKEN "A"
 
#define GB_TERMINAL_CSI_CURSOR_DOWN   GB_TERMINAL_CSI GB_TERMINAL_TOKEN "B"
 
#define GB_TERMINAL_CSI_CURSOR_FORWARD   GB_TERMINAL_CSI GB_TERMINAL_TOKEN "C"
 
#define GB_TERMINAL_CSI_CURSOR_BACK   GB_TERMINAL_CSI GB_TERMINAL_TOKEN "D"
 

Typedefs

typedef uint32_t gb::terminal::color_t
 

Functions

static constexpr color_t gb::terminal::rgb (color_t const r, color_t const g, color_t const b) noexcept
 
static constexpr color_t gb::terminal::grey (color_t const step) noexcept
 
static constexpr std::string gb::terminal::colorText (std::string_view const str, color_t const color) noexcept
 
static constexpr std::string gb::terminal::clearToEndOfLine () noexcept
 
static constexpr std::string gb::terminal::clearToStartOfLine () noexcept
 
static constexpr std::string gb::terminal::cursorUp (uint const n=1) noexcept
 
static constexpr std::string gb::terminal::cursorDown (uint const n=1) noexcept
 
static constexpr std::string gb::terminal::cursorForward (uint const n=1) noexcept
 
static constexpr std::string gb::terminal::cursorBack (uint const n=1) noexcept
 

Macro Definition Documentation

◆ GB_TERMINAL_TOKEN

#define GB_TERMINAL_TOKEN   "@"

◆ GB_TERMINAL_CSI

#define GB_TERMINAL_CSI   "\u001b["

◆ GB_TERMINAL_CSI_COLOR_RESET

#define GB_TERMINAL_CSI_COLOR_RESET   GB_TERMINAL_CSI "0m"

◆ GB_TERMINAL_CSI_COLOR_FOREGROUND

#define GB_TERMINAL_CSI_COLOR_FOREGROUND   GB_TERMINAL_CSI "38;5;" GB_TERMINAL_TOKEN "m"

◆ GB_TERMINAL_CSI_CLEAR_CURRENT_LINE

#define GB_TERMINAL_CSI_CLEAR_CURRENT_LINE   GB_TERMINAL_CSI "2K"

◆ GB_TERMINAL_CSI_CLEAR_TO_END_OF_LINE

#define GB_TERMINAL_CSI_CLEAR_TO_END_OF_LINE   GB_TERMINAL_CSI "0K"

◆ GB_TERMINAL_CSI_CLEAR_TO_START_OF_LINE

#define GB_TERMINAL_CSI_CLEAR_TO_START_OF_LINE   GB_TERMINAL_CSI "1K"

◆ GB_TERMINAL_CSI_CURSOR_UP

#define GB_TERMINAL_CSI_CURSOR_UP   GB_TERMINAL_CSI GB_TERMINAL_TOKEN "A"

◆ GB_TERMINAL_CSI_CURSOR_DOWN

#define GB_TERMINAL_CSI_CURSOR_DOWN   GB_TERMINAL_CSI GB_TERMINAL_TOKEN "B"

◆ GB_TERMINAL_CSI_CURSOR_FORWARD

#define GB_TERMINAL_CSI_CURSOR_FORWARD   GB_TERMINAL_CSI GB_TERMINAL_TOKEN "C"

◆ GB_TERMINAL_CSI_CURSOR_BACK

#define GB_TERMINAL_CSI_CURSOR_BACK   GB_TERMINAL_CSI GB_TERMINAL_TOKEN "D"