Buffers

Undocumented in source.

Constructors

this
this(size_t _chunk_length, size_t _max_chunk, bool _use_secure_mem, bool _zeroize_on_free)

This is the same as calling init2 with the given arguments and offset = 0.

this
this(size_t _chunk_length, size_t _max_chunk, size_t _offset, bool _use_secure_mem, bool _zeroize_on_free)

This is the same as calling init3 with the given arguments and chunk_keep = max_chunk.

this
this(size_t _chunk_length, size_t _max_chunk, size_t _chunk_keep, size_t _offset, bool _use_secure_mem, bool _zeroize_on_free)

Initializes Buffers. Each buffer size is given in the |chunk_length|. The maximum number of buffers is given in the |max_chunk|. On reset, first |chunk_keep| buffers are kept and remaining buffers are deleted. Each buffer will have bufs.pos and bufs.last shifted to left by |offset| bytes on creation and reset.

this
this(ubyte[] buf)
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Members

Classes

Chain
class Chain
Undocumented in source.

Functions

add
ErrorCode add(string data)
Undocumented in source. Be warned that the author may not have intended to support it.
add
ErrorCode add(ubyte b)
Undocumented in source. Be warned that the author may not have intended to support it.
addHold
ErrorCode addHold(ubyte b)
Undocumented in source. Be warned that the author may not have intended to support it.
advance
ErrorCode advance()
Undocumented in source. Be warned that the author may not have intended to support it.
curAvailable
int curAvailable()
Undocumented in source. Be warned that the author may not have intended to support it.
fastAdd
void fastAdd(ubyte b)
Undocumented in source. Be warned that the author may not have intended to support it.
fastAddHold
void fastAddHold(ubyte b)
Undocumented in source. Be warned that the author may not have intended to support it.
fastOr
void fastOr(ubyte b)
Undocumented in source. Be warned that the author may not have intended to support it.
fastOrHold
void fastOrHold(ubyte b)
Undocumented in source. Be warned that the author may not have intended to support it.
free
void free()

Frees any related resources

nextPresent
bool nextPresent()
Undocumented in source. Be warned that the author may not have intended to support it.
or
ErrorCode or(ubyte b)
Undocumented in source. Be warned that the author may not have intended to support it.
orHold
ErrorCode orHold(ubyte b)
Undocumented in source. Be warned that the author may not have intended to support it.
realloc
void realloc(size_t _chunk_length)
Undocumented in source.
remove
ubyte[] remove()
Undocumented in source. Be warned that the author may not have intended to support it.
removeOne
ubyte[] removeOne(ubyte[] dst)

Fills dst with a slice of the head chain's buffer, and frees the chain if it becomes empty chunk_keep must be 1 for buffers to be emptied this way.

removeOne
void removeOne()
Undocumented in source.
reset
void reset()
Undocumented in source. Be warned that the author may not have intended to support it.
rewind
void rewind()
Undocumented in source. Be warned that the author may not have intended to support it.
seekLastPresent
void seekLastPresent()
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

available
int available [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
length
int length [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

chunk_keep
size_t chunk_keep;

The number of Chains to keep on reset

chunk_length
size_t chunk_length;

The buffer capacity of each Buffer

chunk_used
size_t chunk_used;

The number of Chains allocated

cur
Chain cur;

Buffer pointer where write occurs.

dont_free
bool dont_free;

true if the buffers were initialized with a pre-allocated ubyte[] which mustn't be freed

head
Chain head;

Points to the first buffer

max_chunk
size_t max_chunk;

The maximum number of Chains

offset
size_t offset;

pos offset from begin in each buffers. On initialization and reset, buf.pos and buf.last are positioned at buf.begin + offset.

use_secure_mem
bool use_secure_mem;

true if we should secure the Buffer allocations

zeroize_on_free
bool zeroize_on_free;

true if the Buffer allocations should be zeroized

Meta