#include <stream.h>
Public Member Functions | |
virtual bool | eos () const =0 |
virtual uint32 | read (void *dataPtr, uint32 dataSize)=0 |
Functions for reading data | |
The following methods all have default implementations. Subclasses in general should not overload them. | |
byte | readByte () |
FORCEINLINE int8 | readSByte () |
uint16 | readUint16LE () |
uint32 | readUint32LE () |
uint64 | readUint64LE () |
uint16 | readUint16BE () |
uint32 | readUint32BE () |
uint64 | readUint64BE () |
FORCEINLINE int16 | readSint16LE () |
FORCEINLINE int32 | readSint32LE () |
FORCEINLINE int64 | readSint64LE () |
FORCEINLINE int16 | readSint16BE () |
FORCEINLINE int32 | readSint32BE () |
FORCEINLINE int64 | readSint64BE () |
FORCEINLINE float | readFloatLE () |
FORCEINLINE float | readFloatBE () |
FORCEINLINE double | readDoubleLE () |
FORCEINLINE double | readDoubleBE () |
SeekableReadStream * | readStream (uint32 dataSize) |
Common::String | readPascalString (bool transformCR=true) |
![]() | |
virtual bool | err () const |
virtual void | clearErr () |
Generic interface for a readable data stream.
|
pure virtual |
Return true if a read failed because the stream end has been reached.
This flag is cleared by clearErr(). For a SeekableReadStream, the flag is also cleared by a successful seek.
|
pure virtual |
Read data from the stream.
Subclasses must implement this method. All other read methods are implemented using it.
dataPtr | Pointer to a buffer into which the data is read. |
dataSize | Number of bytes to be read. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
SeekableReadStream* Common::ReadStream::readStream | ( | uint32 | dataSize | ) |
Read the specified amount of data into a malloc'ed buffer which is then wrapped into a MemoryReadStream.
The returned stream might contain less data than requested if reading more data failed. This is because of an I/O error or because the end of the stream was reached. It can be determined by calling err() and eos().
Common::String Common::ReadStream::readPascalString | ( | bool | transformCR = true | ) |
Read a string in Pascal format, that is, one byte is string length, followed by string data.
transformCR | If set (default), then transform \r into \n. |