GCC Middle and Back End API Reference
diagnostic_color_dict Class Reference

Data Structures

struct  entry
 

Public Member Functions

 diagnostic_color_dict (const color_default *default_values, size_t num_default_values)
 
bool parse_envvar_value (const char *const envvar_value)
 
const char * get_start_by_name (const char *name, size_t name_len) const
 
const char * get_start_by_name (const char *name) const
 

Private Member Functions

const entryget_entry_by_name (const char *name, size_t name_len) const
 
entryget_entry_by_name (const char *name, size_t name_len)
 

Private Attributes

std::vector< entrym_entries
 

Constructor & Destructor Documentation

◆ diagnostic_color_dict()

diagnostic_color_dict::diagnostic_color_dict ( const color_default * default_values,
size_t num_default_values )
diagnostic_color_dict's ctor.  Initialize it from the given array
of color_default values.   

References m_entries.

Member Function Documentation

◆ get_entry_by_name() [1/2]

diagnostic_color_dict::entry * diagnostic_color_dict::get_entry_by_name ( const char * name,
size_t name_len )
private
Non-const version of the above.   

References m_entries.

◆ get_entry_by_name() [2/2]

const diagnostic_color_dict::entry * diagnostic_color_dict::get_entry_by_name ( const char * name,
size_t name_len ) const
private
Look for an entry named NAME of length NAME_LEN within this
diagnostic_color_dict, or nullptr if there isn't one.   

References m_entries.

Referenced by get_start_by_name(), and parse_envvar_value().

◆ get_start_by_name() [1/2]

const char * diagnostic_color_dict::get_start_by_name ( const char * name) const
inline

References get_start_by_name().

◆ get_start_by_name() [2/2]

const char * diagnostic_color_dict::get_start_by_name ( const char * name,
size_t name_len ) const
Return the SGR codes to start a color entry named NAME of length
NAME_LEN within this diagnostic_color_dict, or the empty string if
there isn't one.   

References get_entry_by_name(), and diagnostic_color_dict::entry::m_val.

Referenced by colorize_start(), and get_start_by_name().

◆ parse_envvar_value()

bool diagnostic_color_dict::parse_envvar_value ( const char *const envvar_value)
Parse a list of color definitions from an environment variable
value (such as that of GCC_COLORS).
No character escaping is needed or supported.   

References b, get_entry_by_name(), diagnostic_color_dict::entry::m_val, NULL, SGR_END, SGR_SEQ, and SGR_START.

Referenced by parse_gcc_colors().

Field Documentation

◆ m_entries

std::vector<entry> diagnostic_color_dict::m_entries
private

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