25 #ifndef WTERMINALCOLOR_H
26 #define WTERMINALCOLOR_H
109 std::ostream&
operator<<( std::ostream& ostr )
const;
125 std::string
operator()(
const std::string s )
const;
134 std::string
operator+(
const std::string& istr )
const;
195 #endif // WTERMINALCOLOR_H
TerminalColorBackground
Background colors.
TerminalColorAttribute m_attrib
Color attributes.
WTerminalColor()
Constructor to create a color code which actually does not do any coloring.
std::ostream & operator<<(std::ostream &ostr) const
Gives the control string which actually enables the color.
TerminalColorForeground
Foreground colors.
void setEnabled(bool enabled)
With this you can easily trigger whether the color control string is used or if "" is returned...
std::string operator+(const std::string &istr) const
Combines strings.
TerminalColorAttribute
Define possible attributes.
TerminalColorForeground m_foreground
The foreground color.
bool m_enabled
True when colors should are used.
std::string operator()() const
Gives the control string which actually enables the color.
Helper class to provide a convenient way to colorize output on the console.
std::string m_colorResetString
Control sequence to reset color.
std::string operator!() const
Resets the color and returns control string.
void generateControlStrings()
Actually generates the control sequences.
std::string m_colorString
The string actually containing the control sequence to enable colors on the console.
virtual ~WTerminalColor()
Destructor.
bool isEnabled() const
Is coloring enabled?
TerminalColorBackground m_background
The background color.