projects.practivist.org

sendero_base.util.ArrayWriter

Authors:
Aaron Craelius

License:
GNU Lesser General Public License v3



class ArrayWriter (T);
Allows for concatentation to arrays of type T where arrays grow in steps of size growSize. Designed to reduce array-reallocation and copying.

this(size_t initSize = 100, size_t growSize = 10);
Params:
initSize the initial size of the array
growSize the amount by which the array size is increase each time it is grows

size_t growSize ;
The array grow size

size_t length ();
Returns:
The current length of the array that has been written to (not the size of the buffer).

void opCatAssign (T t);
Appends a single element to the array.

void append (T[] t);
Appends an array of elements to the array

alias opCatAssign ;


T[] get ();
Returns:
The array that has been written. (Essentially returns a slice of the array buffer up to the last element that has been written.)

Documentation last updated Thu May 29 17:23:15 2008