Files Classes Functions Hierarchy
#include <projprint.h>
Public Types | |
| enum | print { all = 0, summary = 1, silent = 2 } |
| "summary" outputs and saves the first few lines. More... | |
Public Member Functions | |
| projprint (print printstate_=projprint::all) | |
| By default all output is printed to screen. | |
| projprint (projprint const &p) | |
| Copy same printing mode. | |
| void | changestate (projprint::print printstate_) |
| Change to the input state. | |
| void | changestate (projprint const &p) |
| boolc | isall () const |
| Is everything output to the terminal? | |
| boolc | issilent () const |
| Is printing suppressed? | |
| boolc | issummary () const |
| Is only summary printing enabled? | |
| void | setall () |
| Set all mode. | |
| void | setsummary () |
| Set summary mode. | |
| void | setsilent () |
| Set silent mode. | |
| operator stringc () const | |
| Output the mode as a string. | |
Public Attributes | |
| printstate | |
| Current output mode. | |
While this can be represented in one integer I have written as a class because the state needs to be in multiple classes. This could be a poor design.
Definition at line 13 of file projprint.h.
| enum projprint::print |
"summary" outputs and saves the first few lines.
"silent" saves but does not output. "all" prints and saves all.
Definition at line 21 of file projprint.h.
| projprint::projprint | ( | projprint::print | printstate_ = projprint::all |
) |
By default all output is printed to screen.
Definition at line 3 of file projprint.cpp.
00004 : printstate(printstate_) 00005 { 00006 }
| projprint::projprint | ( | projprint const & | p | ) |
Copy same printing mode.
Definition at line 8 of file projprint.cpp.
00009 : printstate(p.printstate) 00010 { 00011 }
| void projprint::changestate | ( | projprint const & | p | ) |
Definition at line 49 of file projprint.cpp.
References printstate.
00050 { 00051 printstate=p.printstate; 00052 }
| void projprint::changestate | ( | projprint::print | printstate_ | ) |
Change to the input state.
Definition at line 43 of file projprint.cpp.
References printstate.
Referenced by projunittests::eval().
00044 { 00045 printstate=printstate_; 00046 }
| boolc projprint::isall | ( | ) | const |
Is everything output to the terminal?
Definition at line 13 of file projprint.cpp.
References all, and printstate.
Referenced by unittestcmd::eval().
00014 { 00015 return (printstate==all); 00016 }
| boolc projprint::issilent | ( | ) | const |
Is printing suppressed?
Definition at line 18 of file projprint.cpp.
References printstate, and silent.
Referenced by projunittests::eval(), and projunittest::eval().
00019 { 00020 return (printstate==silent); 00021 }
| boolc projprint::issummary | ( | ) | const |
Is only summary printing enabled?
Definition at line 23 of file projprint.cpp.
References printstate, and summary.
Referenced by projunittests::eval(), and unittestcmd::eval().
00024 { 00025 return (printstate==summary); 00026 }
| projprint::operator stringc | ( | ) | const |
Output the mode as a string.
Definition at line 54 of file projprint.cpp.
References all, printstate, silent, and summary.
00055 { 00056 switch (printstate) 00057 { 00058 case all: return "all"; 00059 case summary: return "summary"; 00060 case silent: return "silent"; 00061 } 00062 00063 assert(false); 00064 00065 return "all"; 00066 }
| void projprint::setall | ( | ) |
Set all mode.
Definition at line 28 of file projprint.cpp.
References all, and printstate.
00029 { 00030 printstate=all; 00031 }
| void projprint::setsilent | ( | ) |
Set silent mode.
Definition at line 38 of file projprint.cpp.
References printstate, and silent.
Referenced by mkerrorstest::test02(), and mkerrorstest::test03().
00039 { 00040 printstate=silent; 00041 }
| void projprint::setsummary | ( | ) |
Set summary mode.
Definition at line 33 of file projprint.cpp.
References printstate, and summary.
Referenced by mkerrorstest::test02(), and mkerrorstest::test03().
00034 { 00035 printstate=summary; 00036 }
Current output mode.
Definition at line 24 of file projprint.h.
Referenced by changestate(), isall(), issilent(), issummary(), operator stringc(), setall(), setsilent(), and setsummary().
1.5.8