Connect++ 0.6.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 240 of file vic_strings.hpp.

Constructor & Destructor Documentation

◆ VPrint()

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

Definition at line 245 of file vic_strings.hpp.

245{ 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 142 of file vic_strings.cpp.

142 {
143 if (v <= verbosity) {
144 for (uint8_t i = 0; i < nl; i++) {
145 std::cout << std::endl;
146 }
147 }
148}
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 128 of file vic_strings.cpp.

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

◆ 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 108 of file vic_strings.cpp.

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

Member Data Documentation

◆ verbosity

uint8_t verbose_print::VPrint::verbosity = 0
staticprivate

Definition at line 242 of file vic_strings.hpp.


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