Horizon
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
Catch::ColourImpl::ColourGuard Class Reference

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

#include <catch_amalgamated.hpp>

Public Member Functions

 ColourGuard (Colour::Code code, ColourImpl const *colour)
 Does not engage the guard/start the colour.
 
 ColourGuard (ColourGuard const &rhs)=delete
 
ColourGuardoperator= (ColourGuard const &rhs)=delete
 
 ColourGuard (ColourGuard &&rhs) noexcept
 
ColourGuardoperator= (ColourGuard &&rhs) noexcept
 
 ~ColourGuard ()
 Removes colour if the guard was engaged.
 
ColourGuardengage (std::ostream &stream) &
 Explicitly engages colour for given stream.
 
ColourGuard && engage (std::ostream &stream) &&
 Explicitly engages colour for given stream.
 

Friends

std::ostream & operator<< (std::ostream &lhs, ColourGuard &guard)
 Engages the guard and starts using colour.
 
std::ostream & operator<< (std::ostream &lhs, ColourGuard &&guard)
 Engages the guard and starts using colour.
 

Detailed Description

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

Member Function Documentation

◆ engage() [1/2]

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

Explicitly engages colour for given stream.

The API based on operator<< should be preferred.

◆ engage() [2/2]

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

Explicitly engages colour for given stream.

The API based on operator<< should be preferred.


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