#include <qafHgeInputStream.h>
Inheritance diagram for qaf::HgeInputStream:
Public Member Functions | |
HgeInputStream (const char *filename) | |
The constructor will load the resource through hge->Resource_Load() , preparing it for reading. | |
bool | canRead () |
| |
int | getSize () |
| |
int | seek (long offset, int whence) |
Behaves in the same way as fseek from the standard I/O library. | |
long | tell () |
| |
int | getC () |
| |
int | read (void *buffer, long itemSize, long itemCount) |
Reads a block of data from the stream. | |
int | skipWhiteSpace () |
Skips all whitespace characters (' ', '', ' ', '') from the current position until either a non-whitespace character is found or the end of the file is reached. | |
virtual | ~HgeInputStream () |
Destructor: If the resource has been loaded, it will be automatically freed before this object is destroyed. |
qaf::HgeInputStream::HgeInputStream | ( | const char * | filename | ) |
The constructor will load the resource through hge->Resource_Load()
, preparing it for reading.
Before accessing the stream with its reading methods, it is advisable to check if the operation was successful with canRead()
.
int qaf::HgeInputStream::seek | ( | long | offset, | |
int | whence | |||
) |
Behaves in the same way as fseek
from the standard I/O library.
offset | Displacement, in bytes, to position the position indicator relative to whence . | |
whence | Can be one of the constants:
|
int qaf::HgeInputStream::read | ( | void * | buffer, | |
long | itemSize, | |||
long | itemCount | |||
) |
Reads a block of data from the stream.
Read count
number of items each one with a size of size
bytes from the stream and stores it in the specified buffer. The stream's postion indicator is increased by the number of bytes read. Total amount of bytes read is (
size x count
).
int qaf::HgeInputStream::skipWhiteSpace | ( | ) |
Skips all whitespace characters (' ', '', '
', '') from the current position until either a non-whitespace character is found or the end of the file is reached.