xoreos  0.0.5
Public Member Functions | Private Attributes | List of all members
Common::SeekableSubReadStreamEndian Class Reference

This is a wrapper around SeekableSubReadStream, but it adds non-endian read methods whose endianness is set on the stream creation. More...

#include <readstream.h>

Inheritance diagram for Common::SeekableSubReadStreamEndian:
Inheritance graph
[legend]
Collaboration diagram for Common::SeekableSubReadStreamEndian:
Collaboration graph
[legend]

Public Member Functions

 SeekableSubReadStreamEndian (SeekableReadStream *parentStream, size_t begin, size_t end, bool bigEndian=false, bool disposeParentStream=false)
 
 ~SeekableSubReadStreamEndian ()
 
uint16 readUint16 ()
 
uint32 readUint32 ()
 
uint64 readUint64 ()
 
int16 readSint16 ()
 
int32 readSint32 ()
 
int64 readSint64 ()
 
float readIEEEFloat ()
 
double readIEEEDouble ()
 
- Public Member Functions inherited from Common::SeekableSubReadStream
 SeekableSubReadStream (SeekableReadStream *parentStream, size_t begin, size_t end, bool disposeParentStream=false)
 
 ~SeekableSubReadStream ()
 
size_t pos () const
 Obtains the current value of the stream position indicator of the stream. More...
 
size_t size () const
 Obtains the total size of the stream, measured in bytes. More...
 
size_t seek (ptrdiff_t offset, Origin whence=kOriginBegin)
 Sets the stream position indicator for the stream. More...
 
- Public Member Functions inherited from Common::SubReadStream
 SubReadStream (ReadStream *parentStream, size_t end, bool disposeParentStream=false)
 
 ~SubReadStream ()
 
bool eos () const
 Returns true if a read failed because the stream has been reached. More...
 
size_t read (void *dataPtr, size_t dataSize)
 Read data from the stream. More...
 
- Public Member Functions inherited from Common::ReadStream
 ReadStream ()
 
virtual ~ReadStream ()
 
byte readByte ()
 Read an unsigned byte from the stream and return it. More...
 
FORCEINLINE int8 readSByte ()
 Read a signed byte from the stream and return it. More...
 
uint32 readChar ()
 Reads the next character from stream and returns it as an unsigned char cast to an uint32, or kEOF on end of file or error. More...
 
uint16 readUint16LE ()
 Read an unsigned 16-bit word stored in little endian (LSB first) order from the stream and return it. More...
 
uint32 readUint32LE ()
 Read an unsigned 32-bit word stored in little endian (LSB first) order from the stream and return it. More...
 
uint64 readUint64LE ()
 Read an unsigned 64-bit word stored in little endian (LSB first) order from the stream and return it. More...
 
uint16 readUint16BE ()
 Read an unsigned 16-bit word stored in big endian (MSB first) order from the stream and return it. More...
 
uint32 readUint32BE ()
 Read an unsigned 32-bit word stored in big endian (MSB first) order from the stream and return it. More...
 
uint64 readUint64BE ()
 Read an unsigned 64-bit word stored in big endian (MSB first) order from the stream and return it. More...
 
FORCEINLINE int16 readSint16LE ()
 Read a signed 16-bit word stored in little endian (LSB first) order from the stream and return it. More...
 
FORCEINLINE int32 readSint32LE ()
 Read a signed 32-bit word stored in little endian (LSB first) order from the stream and return it. More...
 
FORCEINLINE int64 readSint64LE ()
 Read a signed 64-bit word stored in little endian (LSB first) order from the stream and return it. More...
 
FORCEINLINE int16 readSint16BE ()
 Read a signed 16-bit word stored in big endian (MSB first) order from the stream and return it. More...
 
FORCEINLINE int32 readSint32BE ()
 Read a signed 32-bit word stored in big endian (MSB first) order from the stream and return it. More...
 
FORCEINLINE int64 readSint64BE ()
 Read a signed 64-bit word stored in big endian (MSB first) order from the stream and return it. More...
 
FORCEINLINE float readIEEEFloatLE ()
 Read a 32-bit IEEE float stored in little endian (LSB first) order from the stream and return it. More...
 
FORCEINLINE float readIEEEFloatBE ()
 Read a 32-bit IEEE float stored in big endian (MSB first) order from the stream and return it. More...
 
FORCEINLINE double readIEEEDoubleLE ()
 Read a 64-bit IEEE double stored in little endian (LSB first) order from the stream and return it. More...
 
FORCEINLINE double readIEEEDoubleBE ()
 Read a 64-bit IEEE double stored in big endian (MSB first) order from the stream and return it. More...
 
MemoryReadStreamreadStream (size_t dataSize)
 Read the specified amount of data into a new[]'ed buffer which then is wrapped into a MemoryReadStream. More...
 
- Public Member Functions inherited from Common::SeekableReadStream
 SeekableReadStream ()
 
 ~SeekableReadStream ()
 
virtual size_t skip (ptrdiff_t offset)
 Skip the specified number of bytes, adding that offset to the current position in the stream. More...
 

Private Attributes

const bool _bigEndian
 

Additional Inherited Members

- Public Types inherited from Common::SeekableReadStream
enum  Origin { kOriginBegin = 0, kOriginCurrent = 1, kOriginEnd = 2, kOriginMAX }
 The position a seeking offset takes as a base. More...
 
- Static Public Member Functions inherited from Common::SeekableReadStream
static size_t evalSeek (ptrdiff_t offset, Origin whence, size_t pos, size_t begin, size_t size)
 Evaluate the seek offset relative to whence into a position from the beginning. More...
 
- Static Public Attributes inherited from Common::ReadStream
static const uint32 kEOF = 0xFFFFFFFF
 Return value for end-of-file. More...
 
static const size_t kSizeInvalid = SIZE_MAX
 
static const size_t kPositionInvalid = SIZE_MAX
 
- Protected Attributes inherited from Common::SeekableSubReadStream
SeekableReadStream_parentStream
 
size_t _begin
 
- Protected Attributes inherited from Common::SubReadStream
DisposablePtr< ReadStream_parentStream
 
size_t _pos
 
size_t _end
 
bool _eos
 

Detailed Description

This is a wrapper around SeekableSubReadStream, but it adds non-endian read methods whose endianness is set on the stream creation.

Manipulating the parent stream directly /will/ mess up a substream.

See also
SubReadStream

Definition at line 383 of file readstream.h.

Constructor & Destructor Documentation

◆ SeekableSubReadStreamEndian()

Common::SeekableSubReadStreamEndian::SeekableSubReadStreamEndian ( SeekableReadStream parentStream,
size_t  begin,
size_t  end,
bool  bigEndian = false,
bool  disposeParentStream = false 
)

Definition at line 166 of file readstream.cpp.

◆ ~SeekableSubReadStreamEndian()

Common::SeekableSubReadStreamEndian::~SeekableSubReadStreamEndian ( )

Definition at line 172 of file readstream.cpp.

Member Function Documentation

◆ readIEEEDouble()

double Common::SeekableSubReadStreamEndian::readIEEEDouble ( )
inline

Definition at line 420 of file readstream.h.

References _bigEndian, Common::ReadStream::readIEEEDoubleBE(), and Common::ReadStream::readIEEEDoubleLE().

Referenced by Aurora::GFF4Struct::getDouble(), and Aurora::GFF4Struct::getFloat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readIEEEFloat()

float Common::SeekableSubReadStreamEndian::readIEEEFloat ( )
inline

Definition at line 416 of file readstream.h.

References _bigEndian, Common::ReadStream::readIEEEFloatBE(), and Common::ReadStream::readIEEEFloatLE().

Referenced by Aurora::GFF4Struct::getDouble(), and Aurora::GFF4Struct::getFloat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readSint16()

int16 Common::SeekableSubReadStreamEndian::readSint16 ( )
inline

Definition at line 404 of file readstream.h.

References _bigEndian, Common::ReadStream::readSint16BE(), and Common::ReadStream::readSint16LE().

Referenced by Aurora::GFF4Struct::getSint(), and Aurora::GFF4Struct::getUint().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readSint32()

int32 Common::SeekableSubReadStreamEndian::readSint32 ( )
inline

Definition at line 408 of file readstream.h.

References _bigEndian, Common::ReadStream::readSint32BE(), and Common::ReadStream::readSint32LE().

Referenced by Aurora::GFF4Struct::getSint(), Aurora::GFF4Struct::getUint(), and Aurora::TalkTable_GFF::readString05().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readSint64()

int64 Common::SeekableSubReadStreamEndian::readSint64 ( )
inline

Definition at line 412 of file readstream.h.

References _bigEndian, Common::ReadStream::readSint64BE(), and Common::ReadStream::readSint64LE().

Referenced by Aurora::GFF4Struct::getSint(), and Aurora::GFF4Struct::getUint().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readUint16()

uint16 Common::SeekableSubReadStreamEndian::readUint16 ( )
inline

◆ readUint32()

uint32 Common::SeekableSubReadStreamEndian::readUint32 ( )
inline

◆ readUint64()

uint64 Common::SeekableSubReadStreamEndian::readUint64 ( )
inline

Definition at line 400 of file readstream.h.

References _bigEndian, Common::ReadStream::readUint64BE(), and Common::ReadStream::readUint64LE().

Referenced by Aurora::GFF4Struct::getSint(), and Aurora::GFF4Struct::getUint().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _bigEndian

const bool Common::SeekableSubReadStreamEndian::_bigEndian
private

The documentation for this class was generated from the following files: