Version: SMASH-3.1
einhard::UnconditionalOutput Class Reference

#include <einhard.hpp>

Definition at line 216 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 234 of file einhard.hpp.

236  : colorize( colorize_ )
237  {
238  doInit<VERBOSITY>( areaName );
239  }

◆ UnconditionalOutput() [2/2]

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

Definition at line 267 of file einhard.hpp.

267  : colorize( colorize_ )
268  {
269  }

Member Function Documentation

◆ operator<<() [1/3]

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

Definition at line 241 of file einhard.hpp.

242  {
243  if( colorize )
244  {
245  *out << col.ansiCode();
246  resetColor = col.resetColor();
247  }
248  return *this;
249  }
std::ostringstream * out
Definition: einhard.hpp:220

◆ operator<<() [2/3]

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

Definition at line 251 of file einhard.hpp.

252  {
253  *out << manip;
254  return *this;
255  }

◆ operator<<() [3/3]

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

Definition at line 257 of file einhard.hpp.

258  {
259  *out << msg;
260  checkColorReset();
261  return *this;
262  }

◆ 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 220 of file einhard.hpp.

◆ indent

unsigned char einhard::UnconditionalOutput::indent
private

Definition at line 226 of file einhard.hpp.

◆ colorize

const bool einhard::UnconditionalOutput::colorize
private

Definition at line 228 of file einhard.hpp.

◆ resetColor

bool einhard::UnconditionalOutput::resetColor = false
private

Definition at line 230 of file einhard.hpp.


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