3 #include <boost/iostreams/filtering_stream.hpp> 4 #include <boost/foreach.hpp> 10 : pad(Pad), need_pad(true) {}
11 template <
typename Sink>
12 bool put(Sink& snk,
char c)
15 BOOST_FOREACH(
char c2, pad)
16 boost::iostreams::put(snk, c2);
18 need_pad = (c ==
'\n');
19 return boost::iostreams::put(snk, c);
32 class OstreamPad :
public boost::iostreams::filtering_ostream {
35 : os(Os),
p(Pad) { push(
p); push(Os); }
This is a filtering stream that adds a pad to the front of every line written out.
OstreamPadFilter(const std::string &Pad)
OstreamPad(std::ostream &Os, const std::string &Pad)
Contains classes to abstract away details in various Spurr Radiative Transfer software.
bool put(Sink &snk, char c)