55 : indent_spaces(0), opening_char(o), closing_char(c), delta(d), is_line_start(
true)
65 std::cerr <<
"Not all indentations have been closed: " <<
indentation << std::endl;
72 std::string::const_iterator it_end = str.end();
75 bool needToInd =
false;
94 for(std::string::const_iterator it = str.begin(); it != it_end; ++it)
100 if((it + 1) != it_end)
126 if(*(str.begin()) !=
closing_char and it != str.begin())
185 std::ofstream file_out(file_name.c_str(), std::ios::out);
void WriteFile(const std::string &file_name)
Write the indented output on a file.
size_t indentation
In global_variables.hpp.
void AppendIndent()
Append the indent spaces.
unsigned int delta
delta indent space
IndentedOutputStream(char o='{', char c='}', unsigned int d=3)
constructor
void AppendIndented(const std::string &str)
Append a pre-indented string to the output.
void Indent()
Manually increase the indenting of the code.
exceptions managed by PandA
Class to print indented code.
char closing_char
char that increments the indent space by a delta
const std::string WriteString()
Write the indented output on a string.
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
void Append(const std::string &str)
Append a string to the output.
char opening_char
char that increments the indent space by a delta
unsigned int indent_spaces
number of spaces used to indent after a new line print
std::ostringstream output_stream
The actual stream.
~IndentedOutputStream()
destructor
#define STD_OPENING_CHAR
STD include.
#define STD_CLOSING_CHAR
Special closing character used to close the current nested level.
void AppendChar(const char &c)
Append the current char.
void Deindent()
Manually reduce the indenting of the code.
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...