5#ifndef DUNE_COMMON_INDENT_HH
6#define DUNE_COMMON_INDENT_HH
55 std::string basic_indent;
63 inline Indent(
const std::string& basic_indent_ =
" ",
unsigned level_ = 0)
64 : parent(0), basic_indent(basic_indent_), level(level_)
69 : parent(0), basic_indent(
" "), level(level_)
77 const std::string& basic_indent_ =
" ",
unsigned level_ = 1)
78 : parent(parent_), basic_indent(basic_indent_), level(level_)
83 : parent(parent_), basic_indent(
" "), level(level_)
88 return Indent(
this, newindent);
92 return Indent(parent, basic_indent, level+morelevel);
100 friend inline std::ostream&
operator<<(std::ostream& s,
108 for(
unsigned i = 0; i < indent.level; ++i)
109 s << indent.basic_indent;
Indent operator+(const std::string &newindent) const
create new indentation object with this one as parent
Definition indent.hh:87
Indent(unsigned level_)
setup without parent and basic_indentation of two spaces
Definition indent.hh:68
Indent operator+(unsigned morelevel) const
create a copy of this indentation object with raised level
Definition indent.hh:91
Indent(const Indent *parent_, unsigned level_)
setup with parent
Definition indent.hh:82
Indent & operator++()
raise indentation level
Definition indent.hh:95
Indent(const std::string &basic_indent_=" ", unsigned level_=0)
setup without parent
Definition indent.hh:63
Indent & operator--()
lower indentation level
Definition indent.hh:97
friend std::ostream & operator<<(std::ostream &s, const Indent &indent)
write indentation to a stream
Definition indent.hh:105
Indent(const Indent *parent_, const std::string &basic_indent_=" ", unsigned level_=1)
setup with parent
Definition indent.hh:76
std::ostream & operator<<(std::ostream &s, const bigunsignedint< k > &x)
Definition bigunsignedint.hh:278
Dune namespace.
Definition alignedallocator.hh:13
Utility class for handling nested indentation in output.
Definition indent.hh:53