Public Member Functions | |
Tabs (bool jump=true) | |
~Tabs () | |
void | print (std::ostream &os) const |
Static Public Member Functions | |
static void | setTabSize (int ts) |
static bool & | showDepth () |
Static Private Member Functions | |
static int & | tabLevel () |
static int & | tabSize () |
Private Attributes | |
bool | jump_ |
int | myLevel_ |
Related Functions | |
(Note that these are not member functions.) | |
std::ostream & | operator<< (std::ostream &os, const Tabs &t) |
The tab size and character can be specified through the setTabSize() and setTabChar() methods, for example,
Tabs::setTabChar('*'); Tabs::setTabSize(4);
By default, a header giving the depth of tabs is written to each line; this can simplify scanning by eye for when a given tab level is reached. This header can be turned off by calling
Tabs::showDepth() = false;
Example: the code
void f() { Tabs tab; cout << tab << "in f()" << std::endl; g(); cout << tab << "leaving f()" << std::endl; } void g() { Tabs tab0; cout << tab0 << "in g()" << std::endl; for (int i=0; i<3; i++) { Tabs tab1(); cout << tab1 << "i=" << i << std::endl; } cout << tab0 << "leaving g()" << std::endl; }
[0] in f() [1] in g() [2]------i=0 [2]------i=1 [2]------i=2 [1] leaving g() [0] leaving f()
Definition at line 66 of file PlayaTabs.hpp.
Tabs::Tabs | ( | bool | jump = true |
) |
Constructor increments tab level
Definition at line 10 of file PlayaTabs.cpp.
References myLevel_, and tabLevel().
Tabs::~Tabs | ( | ) |
Destructor decrements tab level
Definition at line 17 of file PlayaTabs.cpp.
References jump_, and tabLevel().
void Tabs::print | ( | std::ostream & | os | ) | const |
Print to stream. This method is usually not called directly, as tabs will usually be written with the insertion operator
Definition at line 22 of file PlayaTabs.cpp.
References myLevel_, showDepth(), tabLevel(), and tabSize().
Referenced by Sundance::UnaryMinusEvaluator::internalEval(), Sundance::SymbolicFuncElementEvaluator::internalEval(), Sundance::ChainRuleEvaluator::internalEval(), and operator<<().
static void Playa::Tabs::setTabSize | ( | int | ts | ) | [inline, static] |
Change the tab size. Default is 2.
Definition at line 82 of file PlayaTabs.hpp.
References tabSize().
static bool& Playa::Tabs::showDepth | ( | ) | [inline, static] |
Indicate whether to print the tab depth as a header for each line.
Definition at line 85 of file PlayaTabs.hpp.
Referenced by print().
static int& Playa::Tabs::tabLevel | ( | ) | [inline, static, private] |
static int& Playa::Tabs::tabSize | ( | ) | [inline, static, private] |
std::ostream & operator<< | ( | std::ostream & | os, | |
const Tabs & | t | |||
) | [related] |
bool Playa::Tabs::jump_ [private] |
int Playa::Tabs::myLevel_ [private] |