#include <CGAL/IO/Indenting_ostream.h>
std::basic_streambuf< CharT, std::char_traits< CharT > >, and std::char_traits< CharT >.
template<typename CharT, typename Traits = std::char_traits<CharT>>
class CGAL::IO::Basic_indenting_streambuf< CharT, Traits >
The class template Basic_indenting_streambuf wraps another basic_streambuf and automatically adds indentation at the beginning of each line.
This is useful for formatting debug output with consistent indentation levels.
- Template Parameters
-
| CharT | Character type (typically char or wchar_t) |
| Traits | Character traits type |
- See also
- Basic_indenting_stream_guard
-
make_indenting_guards
- Examples
- Stream_support/indenting_ostream.cpp.
|
|
using | char_type = CharT |
| | Character type.
|
| |
|
using | traits_type = Traits |
| | Character traits type.
|
| |
|
using | int_type = typename traits_type::int_type |
| | Integer type for character representation.
|
| |
|
using | pos_type = typename traits_type::pos_type |
| | Position type for stream positioning.
|
| |
|
using | off_type = typename traits_type::off_type |
| | Offset type for stream positioning.
|
| |
|
using | streambuf_type = std::basic_streambuf< char_type, traits_type > |
| | Type of the wrapped streambuf.
|
| |
|
using | string = std::basic_string< char_type > |
| | String type matching character type.
|
| |
◆ Basic_indenting_streambuf()
template<typename CharT , typename Traits = std::char_traits<CharT>>
constructs an indenting streambuf wrapper.
- Parameters
-
| wrapped_buf | The underlying streambuf to wrap |
| indent_string | The string to use for indentation (default: 2 spaces) |
◆ set_indent_level()
template<typename CharT , typename Traits = std::char_traits<CharT>>
sets indentation level using repeated spaces.
- Parameters
-
| level | Number of indentation levels |
| spaces_per_level | Number of spaces per level (default: 2) |
◆ set_indent_string()
template<typename CharT , typename Traits = std::char_traits<CharT>>
sets a new indentation string.
- Parameters
-
| new_indent | The new indentation string |