Class ColourImpl

Nested Relationships

Nested Types

Class Documentation

class ColourImpl

Public Functions

inline ColourImpl(IStream *stream)
virtual ~ColourImpl()
ColourGuard guardColour(Colour::Code colourCode)

Creates a guard object for given colour and this colour impl

Important: the guard starts disengaged, and has to be engaged explicitly.

Protected Attributes

IStream *m_stream

The associated stream of this ColourImpl instance.

class ColourGuard

RAII wrapper around writing specific colour of text using specific colour impl into a stream.

Public Functions

ColourGuard(Colour::Code code, ColourImpl const *colour)

Does not engage the guard/start the colour.

ColourGuard(ColourGuard const &rhs) = delete
ColourGuard &operator=(ColourGuard const &rhs) = delete
ColourGuard(ColourGuard &&rhs) noexcept
ColourGuard &operator=(ColourGuard &&rhs) noexcept
~ColourGuard()

Removes colour if the guard was engaged.

ColourGuard &engage(std::ostream &stream) &

Explicitly engages colour for given stream.

The API based on operator<< should be preferred.

ColourGuard &&engage(std::ostream &stream) &&

Explicitly engages colour for given stream.

The API based on operator<< should be preferred.