Ppstr Reference

_images/ditaa-ff606775e185cf5e45fe3e79b265120b0d1bcd5b.png
#include <xo/indentlog/ppstr.hpp>

Types

template<typename ...Args>
class ppconcat

Container for a tuple of values to be pretty-printed in order.

We don’t use the tuple directly, so that we don’t inadvertently usurp pretty-printing behavior for all tuples.

Template Parameters:

Args... – parameter pack of argument types

Functions

template<typename ...Tn>
std::string xo::toppstr(Tn&&... args)

Example:

toppstr("hello") -> "hello"
toppstr("string1", .., "string99")
  -> "string1
        string2
        ...
        string99"

Returns:

string comprised of pretty-printed sequence of values in args

template<typename ...Tn>
std::string xo::toppstr2(const print::ppconfig &ppc, Tn&&... args)

like toppstr, but use pretty-printing configuration ppc

Example:

ppconfig ppc{.right_margin_=20, .indent_width_=4};
toppstr2("string1", "string2", "string3") ->
"string1
     string2
     string3"