3#ifndef DUNE_COMMON_INDENT_HH
4#define DUNE_COMMON_INDENT_HH
53 std::string basic_indent;
61 inline Indent(
const std::string& basic_indent_ =
" ",
unsigned level_ = 0)
62 : parent(0), basic_indent(basic_indent_), level(level_)
67 : parent(0), basic_indent(
" "), level(level_)
75 const std::string& basic_indent_ =
" ",
unsigned level_ = 1)
76 : parent(parent_), basic_indent(basic_indent_), level(level_)
81 : parent(parent_), basic_indent(
" "), level(level_)
86 return Indent(
this, newindent);
90 return Indent(parent, basic_indent, level+morelevel);
98 friend inline std::ostream&
operator<<(std::ostream& s,
106 for(
unsigned i = 0; i < indent.level; ++i)
107 s << indent.basic_indent;
Indent operator+(const std::string &newindent) const
create new indentation object with this one as parent
Definition indent.hh:85
std::ostream & operator<<(std::ostream &s, const std::array< T, N > &e)
Output operator for array.
Definition array.hh:28
Indent(unsigned level_)
setup without parent and basic_indentation of two spaces
Definition indent.hh:66
Indent operator+(unsigned morelevel) const
create a copy of this indetation object with raised level
Definition indent.hh:89
Indent(const Indent *parent_, unsigned level_)
setup with parent
Definition indent.hh:80
Indent & operator++()
raise indentation level
Definition indent.hh:93
Indent(const std::string &basic_indent_=" ", unsigned level_=0)
setup without parent
Definition indent.hh:61
Indent & operator--()
lower indentation level
Definition indent.hh:95
friend std::ostream & operator<<(std::ostream &s, const Indent &indent)
write indentation to a stream
Definition indent.hh:103
Indent(const Indent *parent_, const std::string &basic_indent_=" ", unsigned level_=1)
setup with parent
Definition indent.hh:74
Dune namespace.
Definition alignment.hh:11
Utility class for handling nested indentation in output.
Definition indent.hh:51