32 explicit indent_t(
int i) : indent(i) {}
51 friend std::ostream &operator<<(std::ostream &os,
indent_t i);
70 static indent_t &getindent(std::ostream &);
73inline std::ostream &operator<<(std::ostream &os,
indent_t i) {
74 os << std::setw(i.indent * i.tabsz) <<
"";
79inline std::ostream &endl(std::ostream &out) {
80 return out << std::endl << indent_t::getindent(out);
82inline std::ostream &indent(std::ostream &out) {
83 ++indent_t::getindent(out);
86inline std::ostream &unindent(std::ostream &out) {
87 --indent_t::getindent(out);
93 std::vector<std::ostream *> streams;
98 friend std::ostream &operator<<(std::ostream &out,
TempIndent &ti) {
99 ti.streams.push_back(&out);
100 return out << indent;
102 friend std::ostream &operator<<(std::ostream &out,
TempIndent &&ti) {
103 ti.streams.push_back(&out);
104 return out << indent;
106 const char *pop_back() {
107 if (!streams.empty()) {
108 *streams.back() << unindent;
113 const char *reset() {
114 for (
auto *out : streams) *out << unindent;
119 for (
auto *out : streams) *out << unindent;
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24