TRIQS/triqs_modest 3.3.0
Brillouin zone summation
Loading...
Searching...
No Matches
triqs::indented_ostream

#include <triqs/utility/streams.hpp>

Detailed Description

A custom output stream that automatically indents each new line by a specified number of spaces.

This class is useful for formatting output with consistent indentation. It wraps around an existing std::ostream and ensures that every new line starts with a specified number of spaces.

Example usage:

auto out = triqs::indented_ostream{std::cout, 3}; // Indent all lines with 3 spaces
out << "Hello, world!" << std::endl;
out << "Indented text." << std::endl;
A custom output stream that automatically indents each new line by a specified number of spaces.
Definition streams.hpp:88
Note
This class inherits from std::ostream and uses a custom stream buffer to handle indentation.

Definition at line 88 of file streams.hpp.

Inheritance diagram for triqs::indented_ostream:

Public Member Functions

 indented_ostream (std::ostream &os, int indent)
 Constructor.
 

Constructor & Destructor Documentation

◆ indented_ostream()

triqs::indented_ostream::indented_ostream ( std::ostream &  os,
int  indent 
)
inline

Constructor.

Parameters
osThe underlying std::ostream to write into.
indentThe number of spaces to use for indentation.

Definition at line 116 of file streams.hpp.


The documentation for this class was generated from the following file: