Consolix
Loading...
Searching...
No Matches
consolix::ColorManipulator Class Reference

A utility class for managing text color in streams. More...

#include <ColorManipulator.hpp>

Public Member Functions

 ColorManipulator (TextColor color)
 Constructor.
 
TextColor color () const
 Retrieves the current text color.
 
 ~ColorManipulator ()
 Destructor that resets the text color to the default.
 

Private Attributes

TextColor m_color
 The current text color.
 

Detailed Description

A utility class for managing text color in streams.

This class allows dynamic control of text color when writing to output streams. It resets the color to the default upon destruction.

Definition at line 21 of file ColorManipulator.hpp.

Constructor & Destructor Documentation

◆ ColorManipulator()

consolix::ColorManipulator::ColorManipulator ( TextColor color)
inlineexplicit

Constructor.

Parameters
colorThe desired text color.

Definition at line 25 of file ColorManipulator.hpp.

◆ ~ColorManipulator()

consolix::ColorManipulator::~ColorManipulator ( )
inline

Destructor that resets the text color to the default.

Definition at line 32 of file ColorManipulator.hpp.

Member Function Documentation

◆ color()

TextColor consolix::ColorManipulator::color ( ) const
inline

Retrieves the current text color.

Returns
The color associated with the manipulator.

Definition at line 29 of file ColorManipulator.hpp.

Member Data Documentation

◆ m_color

TextColor consolix::ColorManipulator::m_color
private

The current text color.

Definition at line 46 of file ColorManipulator.hpp.


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