#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 () |
template<class TDataFormat , class... T> | |
bool | readMultiple (const TDataFormat &dataFormat, T &...values) |
template<class... T> | |
bool | readMultipleEndian (bool isLittle, T &...values) |
template<class... T> | |
bool | readMultipleLE (T &...values) |
template<class... T> | |
bool | readMultipleBE (T &...values) |
SeekableReadStream * | readStream (uint32 dataSize) |
String | readString (char terminator=0, size_t len=String::npos) |
Common::String | readPascalString (bool transformCR=true) |
Public Member Functions inherited from Common::Stream | |
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.
Implemented in Common::SeekableReadStreamEndianWrapper, Common::MemorySeekableReadWriteStream, Common::MemoryReadWriteStream, Common::PackBitsReadStream, Twp::GGPackEntryReader, Twp::GGBnutReader, AGS3::AGS::Shared::ScummVMPackReadStream, Common::File, Scumm::ScummDiskImage, BladeRunner::SaveFileReadStream, AGS3::AGS::Shared::ScummVMReadStream, LastExpress::SavegameStream, Networking::NetworkReadStream, Twp::RangeStream, Common::MemoryReadStream, Scumm::ScummNESFile, Twp::XorStream, Scumm::ScummFile, Tinsel::TinselFile, NGI::MfcArchive, PspIoStream, Gob::SaveConverter, Common::SubReadStream, StdioStream, Bagel::SaveReadStream, Titanic::y222, ZVision::LzssReadStream, Common::PowerPackerStream, Common::ConcatReadStream, Twp::SoundStream, InFRAMSave, InPAKSave, TwinE::LzssReadStream, Twp::MemStream, RomfsStream, Grim::PackFile, and Groovie::LzssReadStream.
|
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. |
Implemented in Common::SeekableReadStreamEndianWrapper, Common::MemorySeekableReadWriteStream, Common::MemoryReadWriteStream, Common::PackBitsReadStream, Twp::GGPackEntryReader, Twp::GGBnutReader, AGS3::AGS::Shared::ScummVMPackReadStream, Common::File, Scumm::ScummDiskImage, Common::SafeMutexedSeekableSubReadStream, Networking::NetworkReadStream, AGS3::AGS::Shared::ScummVMReadStream, BladeRunner::SaveFileReadStream, LastExpress::SavegameStream, Common::SafeSeekableSubReadStream, Twp::RangeStream, Scumm::ScummNESFile, Common::MemoryReadStream, Scumm::ScummFile, PspIoStream, Twp::XorStream, Tinsel::TinselFile, NGI::MfcArchive, StdioStream, Gob::SaveConverter, Common::SubReadStream, Common::PowerPackerStream, Common::ConcatReadStream, Bagel::SaveReadStream, ZVision::LzssReadStream, Titanic::y222, RomfsStream, Twp::SoundStream, TwinE::LzssReadStream, Twp::MemStream, Groovie::LzssReadStream, Grim::PackFile, and MutationOfJB::EncryptedFile.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Read multiple values from the stream using a specified data format, return true on success and false on failure.
|
inline |
Read multiple values from the stream using a specified endianness, return true on success and false on failure.
|
inline |
Read multiple values from the stream in little endian format, return true on success and false on failure.
|
inline |
Read multiple values from the stream in big endian format, return true on success and false on failure.
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().
String Common::ReadStream::readString | ( | char | terminator = 0 , |
size_t | len = String::npos |
||
) |
Reads in a terminated string. Upon successful completion, return a string with the content of the line, without the terminating character.
terminator | The terminating character to use. |
len | The maximum length to read (includes terminator). |
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. |