10 #ifndef ICARUSCODE_UTILITIES_STREAMINDENTER_H
11 #define ICARUSCODE_UTILITIES_STREAMINDENTER_H
73 : firstIndent{ std::move(firstIndent) },
indent{ std::move(
indent) }
108 template <
typename Stream>
111 template <
typename Stream>
117 template <
typename Stream>
123 namespace util::details {
129 template <
typename Stream>
141 :
fOut{ std::forward<Stream>(out) }
145 :
IndentAdder{ std::forward<Stream>(out), indent, indent } {}
147 template <
typename T>
157 while(
fSStr.get(ch)) {
160 newLine = (ch ==
'\n');
174 template <
typename Stream>
176 (
Stream&& out, std::string indent, std::string firstIndent)
179 { std::forward<Stream>(out), std::move(indent), std::move(firstIndent) };
184 template <
typename Stream>
190 template <
typename Stream>
193 std::forward<Stream>(out),
194 std::move(adder.indent), std::move(adder.firstIndent)
202 #endif // ICARUSCODE_UTILITIES_STREAMINDENTER_H
std::string const * fCurrentIndent
addIndent(std::string indent, std::string firstIndent)
auto makeIndented(Stream &&out, std::string indent, std::string firstIndent)
Creates an indented stream wrapper.
IndentAdder(Stream &out, std::string const &indent="")
Stream modifier that makes it "indented".
std::ostream & operator<<(std::ostream &, Binner< T > const &)
IndentAdder & operator<<(T &&value)
std::string const fFirstIndent
IndentAdder(Stream &&out, std::string indent, std::string firstIndent)
std::string const fIndent
addIndent(std::string const &indent)