Connect++ 0.1
A fast, readable connection prover for first-order logic.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
colour_string::ColourString Class Reference

Simple addition of colour to strings and ostreams. More...

#include <vic_strings.hpp>

Public Member Functions

 ColourString (bool uc)
 
bool get_use_colours () const
 
void set_use_colours (bool b)
 
void set_map (uint8_t i, ColourName colour)
 
ColourString operator() (const string &_s)
 
string operator() (const string &_s, size_t num)
 
string red ()
 
string green ()
 
string blue ()
 
string lblue ()
 
string orange ()
 
string yellow ()
 
string purple ()
 
string grey ()
 
string lgrey ()
 

Detailed Description

Simple addition of colour to strings and ostreams.

The format is:

cout << col("Hello").red() ...;

Also incorporates a map allowing the format:

col.set_map(2, ColourName::PURPLE); cout << col("Hello", 2) << ...

so that assignment of colours can easily be changed

Member Function Documentation

◆ operator()() [1/2]

ColourString colour_string::ColourString::operator() ( const string &  _s)
inline

This sets the member string. The idea is to allow other methods to add the colour to it.

◆ operator()() [2/2]

string colour_string::ColourString::operator() ( const string &  _s,
size_t  num 
)
inline

Make a coloured string using the map.

Does not affect the stored string.


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