Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Functions | Variables
term_colors.hpp File Reference
#include <string>
+ Include dependency graph for term_colors.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  shambase::details::TermColors
 Struct representing the terminal colors to be used for printing. More...
 

Namespaces

namespace  shambase
 namespace for basic c++ utilities
 

Macros

#define TERM_ESCAPTE_CHAR   "\x1b["
 Escape character for terminal control sequences.
 

Functions

void shambase::term_colors::enable_colors ()
 Enable colors in logs.
 
void shambase::term_colors::disable_colors ()
 Disable all colors.
 
bool shambase::term_colors::colors_enabled ()
 Are colors enabled.
 
const std::string shambase::term_colors::empty ()
 Get the empty terminal escape.
 
const std::string shambase::term_colors::reset ()
 Get the reset terminal escape char.
 
const std::string shambase::term_colors::bold ()
 Get the bold terminal escape char.
 
const std::string shambase::term_colors::faint ()
 Get the faint terminal escape char.
 
const std::string shambase::term_colors::underline ()
 Get the underline terminal escape char.
 
const std::string shambase::term_colors::blink ()
 Get the blink terminal escape char.
 
const std::string shambase::term_colors::col8b_black ()
 Get the black terminal escape char.
 
const std::string shambase::term_colors::col8b_red ()
 Get the red terminal escape char.
 
const std::string shambase::term_colors::col8b_green ()
 Get the green terminal escape char.
 
const std::string shambase::term_colors::col8b_yellow ()
 Get the yellow terminal escape char.
 
const std::string shambase::term_colors::col8b_blue ()
 Get the blue terminal escape char.
 
const std::string shambase::term_colors::col8b_magenta ()
 Get the magenta (pink) terminal escape char.
 
const std::string shambase::term_colors::col8b_cyan ()
 Get the cyan terminal escape char.
 
const std::string shambase::term_colors::col8b_white ()
 Get the white terminal escape char.
 

Variables

TermColors shambase::details::_int_term_colors = TermColors::get_config_colors()
 Global instance of TermColors.
 

Detailed Description

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

Definition in file term_colors.hpp.

Macro Definition Documentation

◆ TERM_ESCAPTE_CHAR

#define TERM_ESCAPTE_CHAR   "\x1b["

Escape character for terminal control sequences.

This is a control character that is used to initiate a terminal control sequence. It is typically represented by the escape character \x1b[.

Definition at line 27 of file term_colors.hpp.

Function Documentation

◆ blink()

const std::string shambase::term_colors::blink ( )
inline

Get the blink terminal escape char.

Definition at line 118 of file term_colors.hpp.

+ Here is the call graph for this function:

◆ bold()

const std::string shambase::term_colors::bold ( )
inline

Get the bold terminal escape char.

Definition at line 112 of file term_colors.hpp.

+ Here is the call graph for this function:

◆ col8b_black()

const std::string shambase::term_colors::col8b_black ( )
inline

Get the black terminal escape char.

Definition at line 120 of file term_colors.hpp.

+ Here is the call graph for this function:

◆ col8b_blue()

const std::string shambase::term_colors::col8b_blue ( )
inline

Get the blue terminal escape char.

Definition at line 128 of file term_colors.hpp.

+ Here is the call graph for this function:

◆ col8b_cyan()

const std::string shambase::term_colors::col8b_cyan ( )
inline

Get the cyan terminal escape char.

Definition at line 134 of file term_colors.hpp.

+ Here is the call graph for this function:

◆ col8b_green()

const std::string shambase::term_colors::col8b_green ( )
inline

Get the green terminal escape char.

Definition at line 124 of file term_colors.hpp.

+ Here is the call graph for this function:

◆ col8b_magenta()

const std::string shambase::term_colors::col8b_magenta ( )
inline

Get the magenta (pink) terminal escape char.

Definition at line 130 of file term_colors.hpp.

+ Here is the call graph for this function:

◆ col8b_red()

const std::string shambase::term_colors::col8b_red ( )
inline

Get the red terminal escape char.

Definition at line 122 of file term_colors.hpp.

+ Here is the call graph for this function:

◆ col8b_white()

const std::string shambase::term_colors::col8b_white ( )
inline

Get the white terminal escape char.

Definition at line 136 of file term_colors.hpp.

+ Here is the call graph for this function:

◆ col8b_yellow()

const std::string shambase::term_colors::col8b_yellow ( )
inline

Get the yellow terminal escape char.

Definition at line 126 of file term_colors.hpp.

+ Here is the call graph for this function:

◆ colors_enabled()

bool shambase::term_colors::colors_enabled ( )
inline

Are colors enabled.

Definition at line 105 of file term_colors.hpp.

+ Here is the call graph for this function:

◆ disable_colors()

void shambase::term_colors::disable_colors ( )

Disable all colors.

Definition at line 27 of file term_colors.cpp.

+ Here is the call graph for this function:

◆ empty()

const std::string shambase::term_colors::empty ( )
inline

Get the empty terminal escape.

Definition at line 108 of file term_colors.hpp.

+ Here is the call graph for this function:

◆ enable_colors()

void shambase::term_colors::enable_colors ( )

Enable colors in logs.

Definition at line 23 of file term_colors.cpp.

+ Here is the call graph for this function:

◆ faint()

const std::string shambase::term_colors::faint ( )
inline

Get the faint terminal escape char.

Definition at line 114 of file term_colors.hpp.

+ Here is the call graph for this function:

◆ reset()

const std::string shambase::term_colors::reset ( )
inline

Get the reset terminal escape char.

Definition at line 110 of file term_colors.hpp.

+ Here is the call graph for this function:

◆ underline()

const std::string shambase::term_colors::underline ( )
inline

Get the underline terminal escape char.

Definition at line 116 of file term_colors.hpp.

+ Here is the call graph for this function:

Variable Documentation

◆ _int_term_colors

TermColors shambase::details::_int_term_colors = TermColors::get_config_colors()

Global instance of TermColors.

This instance is used to store the escape sequences for the terminal colors. The escape sequences are stored in the TermColors structure.

Note
This global variable is initialized in the implementation file.

Definition at line 20 of file term_colors.cpp.