Printable

OutputStream: OutputStream, append

Printable: print, toString

struct OutputStream

A stream that accepts printed output, writing to a string buffer, to a file, or to standard output.

Writing to a file or standard output never allocates; buffering into a StringBuf allocates only to grow the buffer itself.

OutputStream

OutputStream()

Writes to standard output.

OutputStream(public StringBuf* buffer)

append

void append(string s)

Writes the string without allocating when writing to a file or standard output.

void append(char c)

Writes the character without allocating when writing to a file or standard output.

interface Printable

A type that can be printed.

print

void print(OutputStream& stream);

Writes this value to the given stream.

toString

StringBuf toString()

Returns this value rendered as a string.