BufferedFile

Wrapper around an AutoFile& that implements a ring buffer to deserialize from. It guarantees the ability to rewind a given number of bytes.

Synopsis

Declared in <streams.h>

class BufferedFile;

Description

Will automatically close the file when it goes out of scope if not null. If you need to close the file early, use file.fclose() instead of fclose(file).

Member Functions

NameDescription
BufferedFile [constructor]Wrap a source file with a ring buffer of nBufSize bytes, guaranteeing nRewindIn bytes of rewind.
FindByte search for a given byte in the stream, and remain positioned on it
GetPos return the current reading position
SetLimit prevent reading beyond a certain position no argument removes the limit
SetPos rewind to a given reading position
SkipTo Move the read position ahead in the stream to the given position. Use SetPos() to back up in the stream, not SkipTo().
eof check whether we're at the end of the source file
operator>> Deserialize an object from the buffered file and return this wrapper.
read read a number of bytes