AppendableBuffer

A betterC-compatible array buffer that grows as needed to accommodate new elements.

Constructors

this
this()
Undocumented in source.
this
this(uint initialCapacity, BufferAllocationStrategy allocationStrategy)

Constructs the buffer using the given initial capacity and allocation strategy. No memory is allocated yet.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

appendItems
void appendItems(T[] items)

Appends items to the buffer, expanding the buffer if needed.

length
uint length()

Gets the length of the buffer, or the total number of items in it.

reset
void reset()

Resets the buffer.

toArray
T[] toArray()

Gets a slice representing the buffer's contents.

toArrayCopy
T[] toArrayCopy()

Gets a copy of this buffer's contents in a new allocated array. You must free this array yourself.

Meta