AppendBuffer

AppendBuffer class template

Constructors

this
this()

Constructor without buffer preallocation

this
this(size_t n, bool limited)

Constructor

Members

Aliases

ParamT
alias ParamT = T
Undocumented in source.
ParamT
alias ParamT = const(T)
Undocumented in source.
opOpAssign
alias opOpAssign(istring op = "~") = opCatAssign

Support for operator ~= for appending elements and concatenating chunks

Functions

append
T[] append(U chunks)

Concatenates chunks and appends them to the content, extending the content where required.

cut
T[] cut(size_t n)

Cuts the last n elements from the current content. If n is greater than the current content length, all elements in the content are cut.

cut
T cut()

Cuts the last element from the current content.

dump
T[] dump()

Cuts the last n elements from the current content. If n is greater than the current content length, all elements in the content are cut.

erase
void erase(void[] data)

Sets all elements in data to the initial value of the element type. data.length is guaranteed to be dividable by the element size.

extend
T[] extend(size_t n)

Increases the content length by n elements.

opCatAssign
T[] opCatAssign(T element)

Appends element to the content, extending content where required.

opCatAssign
T[] opCatAssign(ParamT[] chunk)

Appends chunk to the content, extending content where required.

opIndex
R opIndex(size_t i)

Returns the i-th element in content.

opIndexAssign
R opIndexAssign(T val, size_t i)

Sets the i-th element in content.

opSlice
T[] opSlice()
opSlice
T[] opSlice(size_t start, size_t end)

Returns content[start .. end]. start must be at most end and end must be at most the current content length.

opSliceAssign
T[] opSliceAssign(ParamT element)

Sets all elements in the current content to element.

opSliceAssign
T[] opSliceAssign(ParamT element, size_t start, size_t end)

Copies chunk to the content, setting the content length to chunk.length.

opSliceAssign
T[] opSliceAssign(ParamT[] chunk)

Copies chunk to the content, setting the content length to chunk.length.

opSliceAssign
T[] opSliceAssign(ParamT[] chunk, size_t start, size_t end)

Copies chunk to content[start .. end]. chunk.length must be end - start and end must be at most the current content length.

ptr
T* ptr()
tail
T[] tail(size_t start)

Returns content[start .. length].

Parameters

T

array element type

Base

base class

Meta