ZeroErr
载入中...
搜索中...
未找到
zeroerr::Printer结构体 参考

A functor class Printer for printing a value of any type. 更多...

#include <print.h>

zeroerr::Printer 的协作图:

Public 成员函数

template<typename... Args>
Printer & operator() (Args &&... args)
 
template<typename T >
Printer & operator() (std::initializer_list< T > &&value)
 
void check_stream ()
 
template<typename T , typename... V>
void call (T &&value, V &&... others)
 
template<typename T >
void call (T &&value)
 
 Printer ()
 
template<class Stream >
 Printer (Stream &stream)
 
 Printer (const Printer &other)
 
 print (const T &value, unsigned level, const char *lb, rank< 0 >)
 
 print (const T &value, unsigned level, const char *lb, rank< 0 >)
 
 ZEROERR_ENABLE_IF (ZEROERR_IS_POINTER &&!std::is_function< typename std::remove_pointer< T >::type >::value) print(const T &value
 

静态 Public 成员函数

template<class T >
static zeroerr::String type (const T &t)
 

Public 属性

bool isColorful = true
 
bool isCompact = false
 
bool isQuoted = true
 
int indent = 2
 
const char * line_break = "\n"
 
StringBuffer & os
 
bool use_stringstream = false
 
bool clear_stream_before_printing = true
 
unsigned level
 
unsigned const char * lb
 
unsigned const char rank< 0 >
 

详细描述

A functor class Printer for printing a value of any type.

This class can print values with all basic types, pointers, STL containers, tuple, optional, and variant values. Any class that is streamable can be printed. POD structs can be supported using third-party library Boost.PFR and enum can be supported using magic_enum.

构造及析构函数说明

◆ Printer() [1/3]

zeroerr::Printer::Printer ( )
inline

◆ Printer() [2/3]

template<class Stream >
zeroerr::Printer::Printer ( Stream &  stream)
inlineexplicit

◆ Printer() [3/3]

zeroerr::Printer::Printer ( const Printer &  other)
inline

成员函数说明

◆ call() [1/2]

template<typename T >
void zeroerr::Printer::call ( T &&  value)
inline

◆ call() [2/2]

template<typename T , typename... V>
void zeroerr::Printer::call ( T &&  value,
V &&...  others 
)
inline

◆ check_stream()

void zeroerr::Printer::check_stream ( )
inline

◆ operator()() [1/2]

template<typename... Args>
Printer & zeroerr::Printer::operator() ( Args &&...  args)
inline

◆ operator()() [2/2]

template<typename T >
Printer & zeroerr::Printer::operator() ( std::initializer_list< T > &&  value)
inline

◆ print() [1/2]

zeroerr::Printer::print ( const T &  value,
unsigned  level,
const char *  lb,
rank< 0 >   
)
inline

◆ print() [2/2]

zeroerr::Printer::print ( const T &  value,
unsigned  level,
const char *  lb,
rank< 0 >   
)
inline

◆ type()

template<class T >
static zeroerr::String zeroerr::Printer::type ( const T &  t)
inlinestatic

◆ ZEROERR_ENABLE_IF()

zeroerr::Printer::ZEROERR_ENABLE_IF ( ZEROERR_IS_POINTER &&!std::is_function< typename std::remove_pointer< T >::type >::value  ) const &

类成员变量说明

◆ clear_stream_before_printing

bool zeroerr::Printer::clear_stream_before_printing = true

◆ indent

int zeroerr::Printer::indent = 2

◆ isColorful

bool zeroerr::Printer::isColorful = true

◆ isCompact

bool zeroerr::Printer::isCompact = false

◆ isQuoted

bool zeroerr::Printer::isQuoted = true

◆ lb

unsigned const char* zeroerr::Printer::lb

◆ level

unsigned zeroerr::Printer::level

◆ line_break

const char* zeroerr::Printer::line_break = "\n"

◆ os

StringBuffer& zeroerr::Printer::os

◆ rank< 0 >

unsigned const char zeroerr::Printer::rank< 0 >
初始值:
{
if (value == nullptr)
os << tab(level) << "nullptr" << lb
unsigned const char * lb
Definition print.h:149
StringBuffer & os
Definition print.h:121
unsigned level
Definition print.h:149

◆ use_stringstream

bool zeroerr::Printer::use_stringstream = false

该结构体的文档由以下文件生成: