xo-umbrella2/xo-ppsink/include/xo/ppsink/pad_ostream.hpp
Roland Conybeare 848b1ed6f0
Some checks failed
cmake-docker / cmake-build (clang, clang++) (push) Failing after 4m2s
cmake-docker / cmake-build (gcc, g++) (push) Failing after 4m25s
CI / smoke-test (push) Failing after 3m41s
xo-ppsink: include tidy to remove ostream refs [HYGIENE]
2026-08-22 16:17:51 -04:00

34 lines
906 B
C++

/** @file pad_ostream.hpp
*
* @author Roland Conybeare, Aug 2026
*
* operator<<(std::ostream&, pad_impl): render a pad()/spaces() to an ostream.
*
* A migration bridge, mirroring tag_ostream.hpp / quoted_ostream.hpp: the
* legacy `os << pad(indent)` idiom appears in hand-indented ostream printers
* (xo-ordinaltree's tree dumps), and this lets such a site move to
* xo::pp::pad without being rewritten. Routes through a FlatSink wrapping
* @p os, reusing Prettifier<pad_impl>.
*
* Segregated from pad.hpp, which stays free of <ostream>.
**/
#pragma once
#include "FlatSink.hpp"
#include "pad.hpp"
#include "pretty.hpp" /* PpSink::pp */
#include <ostream>
namespace xo::pp {
inline std::ostream &
operator<<(std::ostream & os, pad_impl x) {
FlatSink sink(os.rdbuf());
sink.pp(x);
return os;
}
} /*namespace xo::pp*/
/* end pad_ostream.hpp */