ae.utils.textout

Fast string building with minimum heap allocations.

Members

Aliases

IsStringSink
deprecated alias IsStringSink = isStringSink
Undocumented in source.
StringBuffer
alias StringBuffer = FastAppender!char
Undocumented in source.
StringBuilder
alias StringBuilder = FastAppender!(immutable(char))

Appender instantiations for building strings.

Functions

countCopy
T[] countCopy()
Undocumented in source. Be warned that the author may not have intended to support it.
put
void put(S sink, dchar c)

Default implementation of put for dchars

put
void put(S sink, N n)

Default implementation of put for numbers (uses decimal ASCII)

putDecimal
void putDecimal(S sink, N n)

Write a number n in decimal to sink.

Structs

BlindWriter
struct BlindWriter(T)

Sink which simply copies data to a pointer and advances it. No reallocation, no bounds check - unsafe.

CountingWriter
struct CountingWriter(T)

Sink which simply counts how much data is written to it.

StaticBuf
struct StaticBuf(T, size_t size)

Output range which writes to a static buffer.

Templates

countCopy
template countCopy(T)

Calls putter to count the length of the output, allocates a buffer of that size, and then calls putter a second time to write to the buffer. Returns the buffer.

isStringSink
template isStringSink(T)

Resolves to true when T can accept strings via .put.

Meta

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Authors

Vladimir Panteleev <ae@cy.md>