The OpenD Programming Language

IOStream

I/O abstraction, to support load/write from a file, from memory, or from user-provided callbacks.

Members

Functions

read_ubyte
ubyte read_ubyte(IOHandle handle, bool* err)

Helper to read one ubyte in stream. On error, sets err to true and return 0.

read_uint_LE
uint read_uint_LE(IOHandle handle, bool* err)

Helper to read one little-endian uint in stream. On error, sets err to true and return 0.

read_ushort_LE
ushort read_ushort_LE(IOHandle handle, bool* err)

Helper to read one little-endian ushort in stream. On error, sets err to true and return 0.

rewind
bool rewind(IOHandle handle)

Seek to beginning of the I/O stream.

seekAbsolute
bool seekAbsolute(IOHandle handle, c_long offset)

Seek to asolute position in the I/O stream. Useful because some function need to preserve it.

setupForFileIO
void setupForFileIO()

Setup the IOStream for reading a file. The passed IOHandle will need to be a FILE*. For internal Gamut usage.

setupForMemoryIO
void setupForMemoryIO()

Setup the IOStream for using a a file. The passed IOHandle will need to be a MemoryFile*. For internal Gamut usage.

setupSetupForLogging
void setupSetupForLogging(IOStream io)

Setup the IOStream for wrapping another IOStream and logging what happens. The passed IOHandle will need to be a WrappedIO. For internal Gamut usage.

skipBytes
bool skipBytes(IOHandle handle, int nbytes)

Skip bytes.

Variables

eof
EofProc eof;

A function with semantics and signature similar to feof.

read
ReadProc read;

A function with semantics and signature similar to fread.

seek
SeekProc seek;

A function with semantics and signature similar to fseek.

tell
TellProc tell;

A function with semantics and signature similar to ftell.

write
WriteProc write;

A function with semantics and signature similar to fwrite.

Meta