Composer

The Composer is a configurable string joiner.

It was originally designed to be a way to allow assert messages with runtime parameters in functions marked @nogc.

struct Composer (
Char
size_t buffSize = runtime
OverflowPolicy policy = OverflowPolicy.assertFalse
) {
Char[] _buffer;
Char[buffSize] _buffer;
OverflowCallback _overflowCallback;
}

Members

Functions

clear
void clear()

Clears the composer of any previously written characters.

setBuffer
void setBuffer(Char[] buffer, size_t numCharsWritten = 0)

Set the composer's buffer to buffer. This is to enable the creation of dynamic buffers.

write
Composer write(A args)

Composes a message from arguments. Anything that was previously written to the composer will be cleared.

Properties

message
immutable(Char[]) message [@property getter]
messageLength
size_t messageLength [@property getter]

Meta