Connect++ 0.5.0
A fast, readable connection prover for first-order logic.
Loading...
Searching...
No Matches
verbose_print::VPrint Class Reference

#include <vic_strings.hpp>

Public Member Functions

 VPrint (uint8_t v)
 
void operator() (uint8_t, const string &, bool=false, uint8_t=1)
 
void operator() (uint8_t, char *, bool=false, uint8_t=1)
 
void nl (uint8_t, uint8_t=1)
 

Static Private Attributes

static uint8_t verbosity = 0
 

Detailed Description

Print strings and optionally newlines on the terminal output, taking verbosity into account.

Definition at line 237 of file vic_strings.hpp.

Constructor & Destructor Documentation

◆ VPrint()

verbose_print::VPrint::VPrint ( uint8_t v)
inline

Definition at line 242 of file vic_strings.hpp.

242{ verbosity = v; }

Member Function Documentation

◆ nl()

void verbose_print::VPrint::nl ( uint8_t v,
uint8_t nl = 1 )

Print a number of newlines if verbosity warrants it.

Definition at line 140 of file vic_strings.cpp.

140 {
141 if (v <= verbosity) {
142 for (uint8_t i = 0; i < nl; i++) {
143 std::cout << std::endl;
144 }
145 }
146}
void nl(uint8_t, uint8_t=1)

◆ operator()() [1/2]

void verbose_print::VPrint::operator() ( uint8_t v,
char * s,
bool n = false,
uint8_t nl = 1 )

Print something, plus optionally newlines, if verbosity warrants it.

Parameters
vverbosity level
sstring
nprint newlines?
nlnumber of newlines

Definition at line 126 of file vic_strings.cpp.

126 {
127 if (v <= verbosity) {
128 std::cout << s;
129 if (n) {
130 for (uint8_t i = 0; i < nl; i++) {
131 std::cout << std::endl;
132 }
133 }
134 }
135}

◆ operator()() [2/2]

void verbose_print::VPrint::operator() ( uint8_t v,
const string & s,
bool n = false,
uint8_t nl = 1 )

Print something, plus optionally newlines, if verbosity warrants it.

Parameters
vverbosity level
sstring
nprint newlines?
nlnumber of newlines

Definition at line 106 of file vic_strings.cpp.

106 {
107 if (v <= verbosity) {
108 std::cout << s;
109 if (n) {
110 for (uint8_t i = 0; i < nl; i++) {
111 std::cout << std::endl;
112 }
113 }
114 }
115}

Member Data Documentation

◆ verbosity

uint8_t verbose_print::VPrint::verbosity = 0
staticprivate

Definition at line 239 of file vic_strings.hpp.


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