prettyformat

Formats an aggregate object, with all its printable members with all their printable values. Overload that writes to a passed output range sink.

  1. void prettyformat(Sink sink, Flag!"brightTerminal" bright, Things things)
    void
    prettyformat
    (
    Flag!"all" all = No.all
    Flag!"coloured" coloured = Yes.coloured
    Sink
    Things...
    )
    (
    auto ref Sink sink
    ,
    const Flag!"brightTerminal" bright
    ,
    const auto ref Things things
    )
  2. string prettyformat(Flag!"brightTerminal" bright, Things things)

Parameters

all

Whether or not to also display members marked as Unserialisable; usually transitive information that doesn't carry between program runs. Also those annotated Hidden.

coloured

Whether to display in colours or not.

sink Sink

Output range to write to.

bright Flag!"brightTerminal"

Whether or not to format for a bright terminal background.

things Things

Variadic list of aggregate objects to enumerate and format.

Examples

struct Foo
{
    int foo = 42;
    string bar = "arr matey";
    float f = 3.14f;
    double d = 9.99;
}

Foo foo, bar;
Appender!(char[]) sink;

sink.prettyformat!(Yes.all, Yes.coloured)(foo);
sink.prettyformat!(No.all, No.coloured)(bar);
writeln(sink.data);