20 #ifndef MIRTK_Indent_H 21 #define MIRTK_Indent_H 23 #include "mirtk/Stream.h" 45 Indent(
int n = 0,
int s = 2) : _N(n), _NumberOfSpaces(s) {}
48 Indent(
const Indent &o) : _N(o._N), _NumberOfSpaces(o._NumberOfSpaces) {}
148 inline ostream &operator<< (ostream &os,
const Indent &indent)
150 for (
int i = 0; i < indent.
Spaces(); ++i) os <<
" ";
157 #endif // MIRTK_Indent_H
int _N
Number of indentation levels.
int Level() const
Get indentation level.
Indent(const Indent &o)
Copy constructor.
Indent & operator=(int n)
Assignment operator.
Indent & operator++()
Pre-increment operator.
Indent & operator+=(const Indent &indent)
Add indentation to this indentation.
Indent operator-(const Indent &indent) const
Subtract two indentations from another.
Indent & operator-=(const Indent &indent)
Subtract indentation from this indentation.
int SpacesPerLevel() const
Get number of indentation whitespace characters per level.
int Spaces() const
Number of space characters.
int _NumberOfSpaces
Number of whitespace characters per indentation level.
Indent operator+(const Indent &indent) const
Add two indentations.
Indent(int n=0, int s=2)
Constructor.
Indent & operator--()
Pre-decrement operator.
void SpacesPerLevel(int n)
Set number of indentation whitespace characters per level.