Class ColourImpl::ColourGuard

Nested Relationships

This class is a nested type of Class ColourImpl.

Class Documentation

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.