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.

Constructors

this
this(VFSFile file)
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Functions

opAssign
void opAssign(VFSFileInput rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
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

VFSFile file; //initialized somewhere before

auto input = file.input;
with(input)
{
    auto buffer = new ubyte[32];

    //Read the first 32 bytes from the file:
    read(buffer);

    //Read the next 32 bytes:
    read(buffer);

    //Read the last 32 bytes in the file:
    seek(-32, file);
    read(buffer);
}

Meta