mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Data Structures | Functions | Variables
m::term Namespace Reference

Data Structures

struct  Color
 Wrapper class to ease the use of terminal colors (foreground and background). More...
 

Functions

Color fg (unsigned color)
 Create a foreground color to be printed in a terminal.
 
Color bg (unsigned color)
 Create a background color to be printed in a terminal.
 
bool M_EXPORT has_color ()
 Returns true if the terminal is known to support colors, false otherwise.
 

Variables

constexpr const char * RESET = "\033[0m"
 
constexpr const char * BOLD = "\033[1m"
 
constexpr const char * HALF_BRIGHT = "\033[2m"
 
constexpr const char * ITALIC = "\033[3m"
 
constexpr const char * UNDERLINE = "\033[4m"
 
constexpr const char * BLINK = "\033[5m"
 
constexpr const char * REVERSE = "\033[7m"
 
constexpr const char * DOUBLE_UNDERLINE = "\033[21m"
 
constexpr const char * NORMAL = "\033[22m"
 
constexpr const char * UNDERLINE_OFF = "\033[24m"
 
constexpr const char * BLINK_OFF = "\033[25m"
 
constexpr const char * REVERSE_OFF = "\033[27m"
 
constexpr const char * FG_BLACK = "\033[30m"
 
constexpr const char * FG_RED = "\033[31m"
 
constexpr const char * FG_GREEN = "\033[32m"
 
constexpr const char * FG_YELLOW = "\033[33m"
 
constexpr const char * FG_BLUE = "\033[34m"
 
constexpr const char * FG_MAGENTA = "\033[35m"
 
constexpr const char * FG_CYAN = "\033[36m"
 
constexpr const char * FG_WHITE = "\033[37m"
 
constexpr const char * BG_BLACK = "\033[40m"
 
constexpr const char * BG_RED = "\033[41m"
 
constexpr const char * BG_GREEN = "\033[42m"
 
constexpr const char * BG_YELLOW = "\033[43m"
 
constexpr const char * BG_BLUE = "\033[44m"
 
constexpr const char * BG_MAGENTA = "\033[45m"
 
constexpr const char * BG_CYAN = "\033[46m"
 
constexpr const char * BG_WHITE = "\033[47m"
 
constexpr const char * BG_DEFAULT = "\033[49m"
 

Function Documentation

◆ bg()

Color m::term::bg ( unsigned  color)
inline

Create a background color to be printed in a terminal.

Definition at line 90 of file terminal.hpp.

References m::term::Color::BG.

Referenced by prompt().

◆ fg()

Color m::term::fg ( unsigned  color)
inline

Create a foreground color to be printed in a terminal.

Definition at line 88 of file terminal.hpp.

References m::term::Color::FG.

Referenced by main(), and prompt().

◆ has_color()

bool m::term::has_color ( )

Returns true if the terminal is known to support colors, false otherwise.

Definition at line 7 of file terminal.cpp.

References m::streq().

Referenced by main().

Variable Documentation

◆ BG_BLACK

constexpr const char* m::term::BG_BLACK = "\033[40m"
constexpr

Definition at line 53 of file terminal.hpp.

◆ BG_BLUE

constexpr const char* m::term::BG_BLUE = "\033[44m"
constexpr

Definition at line 61 of file terminal.hpp.

◆ BG_CYAN

constexpr const char* m::term::BG_CYAN = "\033[46m"
constexpr

Definition at line 65 of file terminal.hpp.

◆ BG_DEFAULT

constexpr const char* m::term::BG_DEFAULT = "\033[49m"
constexpr

Definition at line 69 of file terminal.hpp.

Referenced by prompt().

◆ BG_GREEN

constexpr const char* m::term::BG_GREEN = "\033[42m"
constexpr

Definition at line 57 of file terminal.hpp.

◆ BG_MAGENTA

constexpr const char* m::term::BG_MAGENTA = "\033[45m"
constexpr

Definition at line 63 of file terminal.hpp.

◆ BG_RED

constexpr const char* m::term::BG_RED = "\033[41m"
constexpr

Definition at line 55 of file terminal.hpp.

◆ BG_WHITE

constexpr const char* m::term::BG_WHITE = "\033[47m"
constexpr

Definition at line 67 of file terminal.hpp.

◆ BG_YELLOW

constexpr const char* m::term::BG_YELLOW = "\033[43m"
constexpr

Definition at line 59 of file terminal.hpp.

◆ BLINK

constexpr const char* m::term::BLINK = "\033[5m"
constexpr

Definition at line 23 of file terminal.hpp.

◆ BLINK_OFF

constexpr const char* m::term::BLINK_OFF = "\033[25m"
constexpr

Definition at line 33 of file terminal.hpp.

◆ BOLD

constexpr const char* m::term::BOLD = "\033[1m"
constexpr

Definition at line 14 of file terminal.hpp.

Referenced by prompt().

◆ DOUBLE_UNDERLINE

constexpr const char* m::term::DOUBLE_UNDERLINE = "\033[21m"
constexpr

Definition at line 27 of file terminal.hpp.

◆ FG_BLACK

constexpr const char* m::term::FG_BLACK = "\033[30m"
constexpr

Definition at line 37 of file terminal.hpp.

◆ FG_BLUE

constexpr const char* m::term::FG_BLUE = "\033[34m"
constexpr

Definition at line 45 of file terminal.hpp.

◆ FG_CYAN

constexpr const char* m::term::FG_CYAN = "\033[36m"
constexpr

Definition at line 49 of file terminal.hpp.

◆ FG_GREEN

constexpr const char* m::term::FG_GREEN = "\033[32m"
constexpr

Definition at line 41 of file terminal.hpp.

◆ FG_MAGENTA

constexpr const char* m::term::FG_MAGENTA = "\033[35m"
constexpr

Definition at line 47 of file terminal.hpp.

◆ FG_RED

constexpr const char* m::term::FG_RED = "\033[31m"
constexpr

Definition at line 39 of file terminal.hpp.

◆ FG_WHITE

constexpr const char* m::term::FG_WHITE = "\033[37m"
constexpr

Definition at line 51 of file terminal.hpp.

Referenced by main(), and prompt().

◆ FG_YELLOW

constexpr const char* m::term::FG_YELLOW = "\033[33m"
constexpr

Definition at line 43 of file terminal.hpp.

◆ HALF_BRIGHT

constexpr const char* m::term::HALF_BRIGHT = "\033[2m"
constexpr

Definition at line 16 of file terminal.hpp.

◆ ITALIC

constexpr const char* m::term::ITALIC = "\033[3m"
constexpr

Definition at line 18 of file terminal.hpp.

Referenced by main(), and prompt().

◆ NORMAL

constexpr const char* m::term::NORMAL = "\033[22m"
constexpr

Definition at line 29 of file terminal.hpp.

◆ RESET

constexpr const char* m::term::RESET = "\033[0m"
constexpr

Definition at line 12 of file terminal.hpp.

Referenced by main(), and prompt().

◆ REVERSE

constexpr const char* m::term::REVERSE = "\033[7m"
constexpr

Definition at line 25 of file terminal.hpp.

◆ REVERSE_OFF

constexpr const char* m::term::REVERSE_OFF = "\033[27m"
constexpr

Definition at line 35 of file terminal.hpp.

◆ UNDERLINE

constexpr const char* m::term::UNDERLINE = "\033[4m"
constexpr

Definition at line 21 of file terminal.hpp.

◆ UNDERLINE_OFF

constexpr const char* m::term::UNDERLINE_OFF = "\033[24m"
constexpr

Definition at line 31 of file terminal.hpp.