Goby3  3.1.4
2024.02.22
goby::util::TermColor Class Reference

Converts between string, escape code, and enumeration representations of the terminal colors. More...

#include <goby/util/debug_logger/term_color.h>

Static Public Member Functions

static Colors::Color from_str (const std::string &s)
 Color enumeration from string (e.g. "blue" -> blue) More...
 
static std::string str_from_col (const Colors::Color &c)
 String from color enumeration (e,g, red -> "red") More...
 
static Colors::Color from_esc_code (const std::string &s)
 Color enumeration from escape code (e,g, "\33[31m" -> red) More...
 
static std::string esc_code_from_col (const Colors::Color &c)
 Escape code from color enumeration (e.g. red -> "\33[31m") More...
 
static std::string esc_code_from_str (const std::string &s)
 Escape code from string (e.g. "red" -> "\33[31m") More...
 

Friends

class TermColorDeleter
 

Detailed Description

Converts between string, escape code, and enumeration representations of the terminal colors.

Definition at line 132 of file term_color.h.

Member Function Documentation

◆ esc_code_from_col()

static std::string goby::util::TermColor::esc_code_from_col ( const Colors::Color c)
inlinestatic

Escape code from color enumeration (e.g. red -> "\33[31m")

Definition at line 151 of file term_color.h.

◆ esc_code_from_str()

static std::string goby::util::TermColor::esc_code_from_str ( const std::string &  s)
inlinestatic

Escape code from string (e.g. "red" -> "\33[31m")

Definition at line 157 of file term_color.h.

◆ from_esc_code()

static Colors::Color goby::util::TermColor::from_esc_code ( const std::string &  s)
inlinestatic

Color enumeration from escape code (e,g, "\33[31m" -> red)

Definition at line 145 of file term_color.h.

◆ from_str()

static Colors::Color goby::util::TermColor::from_str ( const std::string &  s)
inlinestatic

Color enumeration from string (e.g. "blue" -> blue)

Definition at line 136 of file term_color.h.

◆ str_from_col()

static std::string goby::util::TermColor::str_from_col ( const Colors::Color c)
inlinestatic

String from color enumeration (e,g, red -> "red")

Definition at line 139 of file term_color.h.

Friends And Related Function Documentation

◆ TermColorDeleter

friend class TermColorDeleter
friend

Definition at line 169 of file term_color.h.


The documentation for this class was generated from the following file: