VFSFileInput

Provides basic file input functionality - seeking and reading.

VFSFileInput uses reference counting so that the file is closed when the last instance of VFSFileInput provided by the file is destroyed.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Postblit

A postblit is present on this object, but not explicitly documented in the source.

Members

Functions

read
void[] read(void[] target)

Read at most target.length bytes starting at current file position to target.

seek
void seek(long offset, Seek origin)

Set file position to offset bytes from specified origin.

Examples

1 VFSFile file; //initialized somewhere before
2 
3 auto input = file.input;
4 with(input)
5 {
6    auto buffer = new ubyte[32];
7 
8    //Read the first 32 bytes from the file:
9    read(buffer);
10 
11    //Read the next 32 bytes:
12    read(buffer);
13 
14    //Read the last 32 bytes in the file:
15    seek(-32, file);
16    read(buffer);
17 }

Meta