Version: SMASH-3.2
einhard::UnconditionalOutput Class Reference

#include <einhard.hpp>

Definition at line 220 of file einhard.hpp.

Inheritance diagram for einhard::UnconditionalOutput:
einhard::OutputFormatter

Public Member Functions

template<LogLevel VERBOSITY>
EINHARD_ALWAYS_INLINE_ UnconditionalOutput (bool colorize_, const char *areaName, std::integral_constant< LogLevel, VERBOSITY >)
 
template<typename T >
UnconditionalOutputoperator<< (const Color< T > &col)
 
EINHARD_ALWAYS_INLINE_ UnconditionalOutputoperator<< (std::ostream &(*manip)(std::ostream &))
 
template<typename T >
EINHARD_ALWAYS_INLINE_ UnconditionalOutputoperator<< (const T &msg)
 
void doCleanup (std::FILE *outfile=stdout) noexcept
 

Protected Member Functions

EINHARD_ALWAYS_INLINE_ UnconditionalOutput (bool colorize_)
 
template<LogLevel VERBOSITY>
void doInit (const char *areaName)
 
void checkColorReset ()
 

Private Attributes

std::ostringstream * out
 
unsigned char indent
 
const bool colorize
 
bool resetColor = false
 

Constructor & Destructor Documentation

◆ UnconditionalOutput() [1/2]

template<LogLevel VERBOSITY>
EINHARD_ALWAYS_INLINE_ einhard::UnconditionalOutput::UnconditionalOutput ( bool  colorize_,
const char *  areaName,
std::integral_constant< LogLevel, VERBOSITY >   
)
inline

Definition at line 238 of file einhard.hpp.

240  : colorize( colorize_ )
241  {
242  doInit<VERBOSITY>( areaName );
243  }

◆ UnconditionalOutput() [2/2]

EINHARD_ALWAYS_INLINE_ einhard::UnconditionalOutput::UnconditionalOutput ( bool  colorize_)
inlineprotected

Definition at line 271 of file einhard.hpp.

271  : colorize( colorize_ )
272  {
273  }

Member Function Documentation

◆ operator<<() [1/3]

template<typename T >
UnconditionalOutput& einhard::UnconditionalOutput::operator<< ( const Color< T > &  col)
inline

Definition at line 245 of file einhard.hpp.

246  {
247  if( colorize )
248  {
249  *out << col.ansiCode();
250  resetColor = col.resetColor();
251  }
252  return *this;
253  }
std::ostringstream * out
Definition: einhard.hpp:224

◆ operator<<() [2/3]

EINHARD_ALWAYS_INLINE_ UnconditionalOutput& einhard::UnconditionalOutput::operator<< ( std::ostream &(*)(std::ostream &)  manip)
inline

Definition at line 255 of file einhard.hpp.

256  {
257  *out << manip;
258  return *this;
259  }

◆ operator<<() [3/3]

template<typename T >
EINHARD_ALWAYS_INLINE_ UnconditionalOutput& einhard::UnconditionalOutput::operator<< ( const T &  msg)
inline

Definition at line 261 of file einhard.hpp.

262  {
263  *out << msg;
264  checkColorReset();
265  return *this;
266  }

◆ doCleanup()

void einhard::UnconditionalOutput::doCleanup ( std::FILE *  outfile = stdout)
noexcept

◆ doInit()

template<LogLevel VERBOSITY>
void einhard::UnconditionalOutput::doInit ( const char *  areaName)
protected

◆ checkColorReset()

void einhard::UnconditionalOutput::checkColorReset ( )
protected

Member Data Documentation

◆ out

std::ostringstream* einhard::UnconditionalOutput::out
private

Definition at line 224 of file einhard.hpp.

◆ indent

unsigned char einhard::UnconditionalOutput::indent
private

Definition at line 230 of file einhard.hpp.

◆ colorize

const bool einhard::UnconditionalOutput::colorize
private

Definition at line 232 of file einhard.hpp.

◆ resetColor

bool einhard::UnconditionalOutput::resetColor = false
private

Definition at line 234 of file einhard.hpp.


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