Version: SMASH-3.1
einhard::Color< Parent > Class Template Reference

#include <einhard.hpp>

template<typename Parent>
class einhard::Color< Parent >

A stream modifier that allows to colorize the log output.

Definition at line 142 of file einhard.hpp.

Public Member Functions

EINHARD_ALWAYS_INLINE_ Color () noexcept
 The default color modifier only affects the next object in the stream. More...
 
EINHARD_ALWAYS_INLINE_ Color< Parent > operator~ () const noexcept
 With the ~ operator the color modifier affects the rest of the stream (or until another color object is used). More...
 
EINHARD_ALWAYS_INLINE_ char const * ansiCode () const noexcept
 
EINHARD_ALWAYS_INLINE_ bool resetColor () const noexcept
 

Private Member Functions

EINHARD_ALWAYS_INLINE_ Color (bool r) noexcept
 

Private Attributes

bool reset
 

Constructor & Destructor Documentation

◆ Color() [1/2]

template<typename Parent >
EINHARD_ALWAYS_INLINE_ einhard::Color< Parent >::Color ( )
inlinenoexcept

The default color modifier only affects the next object in the stream.

Definition at line 146 of file einhard.hpp.

146  : reset( true )
147  {
148  }

◆ Color() [2/2]

template<typename Parent >
EINHARD_ALWAYS_INLINE_ einhard::Color< Parent >::Color ( bool  r)
inlineprivatenoexcept

Definition at line 165 of file einhard.hpp.

165  : reset( r )
166  {
167  }

Member Function Documentation

◆ operator~()

template<typename Parent >
EINHARD_ALWAYS_INLINE_ Color<Parent> einhard::Color< Parent >::operator~ ( ) const
inlinenoexcept

With the ~ operator the color modifier affects the rest of the stream (or until another color object is used).

Definition at line 151 of file einhard.hpp.

152  {
153  return {false};
154  }

◆ ansiCode()

template<typename Parent >
EINHARD_ALWAYS_INLINE_ char const* einhard::Color< Parent >::ansiCode ( ) const
inlinenoexcept

Definition at line 155 of file einhard.hpp.

156  {
157  return Parent::ANSI();
158  }

◆ resetColor()

template<typename Parent >
EINHARD_ALWAYS_INLINE_ bool einhard::Color< Parent >::resetColor ( ) const
inlinenoexcept

Definition at line 159 of file einhard.hpp.

160  {
161  return reset;
162  }

Member Data Documentation

◆ reset

template<typename Parent >
bool einhard::Color< Parent >::reset
private

Definition at line 168 of file einhard.hpp.


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