std::ostream & operator<<(std::ostream & os, const exmap & e) { print_context *p = get_print_context(os); auto i = e.begin(); auto mend = e.end(); if (i==mend) { os << "{}"; return os; } os << "{"; while (true) { if (p == nullptr) i->first.print(print_dflt(os)); else i->first.print(*p); os << "=="; if (p == nullptr) i->second.print(print_dflt(os)); else i->second.print(*p); ++i; if( i==mend ) break; os << ","; } os << "}"; return os; }
std::ostream & operator<<(std::ostream & os, const exset & e) { print_context *p = get_print_context(os); auto i = e.begin(); auto send = e.end(); if (i==send) { os << "<>"; return os; } os << "<"; while (true) { if (p == nullptr) i->print(print_dflt(os)); else i->print(*p); ++i; if (i == send) break; os << ","; } os << ">"; return os; }
std::ostream & operator<<(std::ostream & os, const exvector & e) { print_context *p = get_print_context(os); exvector::const_iterator i = e.begin(); exvector::const_iterator vend = e.end(); if (i==vend) { os << "[]"; return os; } os << "["; while (true) { if (p == 0) i -> print(print_dflt(os)); else i -> print(*p); ++i; if (i==vend) break; os << ","; } os << "]"; return os; }
// Set options for print_context associated with stream static void set_print_options(std::ostream & s, unsigned options) { print_context *p = get_print_context(s); if (p == nullptr) set_print_context(s, print_dflt(s, options)); else p->options = options; }
std::ostream & operator<<(std::ostream & os, const ex & e) { print_context *p = get_print_context(os); if (p == nullptr) e.print(print_dflt(os)); else e.print(*p); return os; }
/** Little wrapper around print to be called within a debugger. * This is needed because you cannot call foo.print(cout) from within the * debugger because it might not know what cout is. This method can be * invoked with no argument and it will simply print to stdout. * * @see basic::print * @see basic::dbgprinttree */ void basic::dbgprint() const { this->print(print_dflt(std::cerr)); std::cerr << std::endl; }