FlexibleFileQueue

Undocumented in source.

Constructors

this
this(cstring path, size_t size, bool open_existing)

Constructor. Creates and opens the files and buffered inputs and outputs. Moves the file pointers to the correct position in the files and marks the files as open.

Members

Functions

clear
void clear()

Deletes all items

free_space
size_t free_space()
is_empty
bool is_empty()

Tells whether the queue is empty.

length
size_t length()
peek
void[] peek()

Returns the element that would be popped next, without poppin' it

pop
void[] pop()

Popps the next element

push
bool push(void[] item)

Pushes an item into the queue.

push
void[] push(size_t size)

Reserves space for an item of <size> bytes on the queue but doesn't fill the content. The caller is expected to fill in the content using the returned slice.

total_space
ulong total_space()
used_space
ulong used_space()
willFit
bool willFit(size_t bytes)

Finds out whether the provided number of bytes will fit in the queue.

Static functions

exists
bool exists(cstring path)

Checks whether a file and the associated index file exist at the specified path.

Inherited Members

From IByteQueue

clear
void clear()

Removes all items from the queue.

push
void[] push(size_t size)

Reserves space for an item of <size> bytes on the queue but doesn't fill the content. The caller is expected to fill in the content using the returned slice.

push
bool push(void[] item)

Pushes an item into the queue.

pop
void[] pop()

Pops an item from the queue.

peek
void[] peek()

Peek at the next item that would be popped from the queue.

Meta