![]() |
Murl Engine API
Version 2018.3
|
The Interchange File Format stream class. More...
#include <murl_util_iff_stream.h>
The Interchange File Format stream class.
The IffStream class is used to deserialize an data object which contains iff-file data. The data object's memory to read from is used by reference only, which allows using memory mapped files without copying the data to memory.
(!) The ownership of the data object's memory pointer remains to the caller. This means as long as the IffStream is used, the memory pointer of the data object (but probably not to data object itself) must be available in memory.
Public Member Functions | |
IffStream (UInt32 form, UInt32 fourCC, const ConstData &data) | |
Constructor taking the file identifier and the file type identifier. More... | |
IffStream (UInt32 fourCC, const ConstData &data) | |
Constructor taking the file type identifier. More... | |
IffStream (const ConstData &data) | |
Constructor to create a headerless IffStream. More... | |
virtual | ~IffStream () |
The destructor. | |
virtual Bool | Open () |
Open the iff-file stream. More... | |
virtual Bool | Close () |
Close the iff-file stream. More... | |
virtual UInt32 | Check (UInt32 fourCC=0) const |
Check the chunk identifier at the current read position and return the byte size of the chunk. More... | |
virtual Bool | Check (UInt32 fourCC, UInt32 chunkSize, UInt32 additionalSize=0) const |
Check the chunk identifier at the current read position and verify the byte size of the chunk. More... | |
virtual const IffChunk * | Read (UInt32 fourCC=0) const |
Check the chunk identifier and size at the current read position and return the the chunk. More... | |
virtual Bool | Advance () |
Advance the current read position to the next chunk. More... | |
virtual Bool | Rewind () |
Rewind the read postition to the first chunk. More... | |
virtual Bool | Eos () const |
Check if the end of the stream is reached. More... | |
template<class ChunkType > | |
Bool | CheckChunk (UInt32 additionalSize=0) const |
Check() a chunk of specified type at the current read position. More... | |
template<class ChunkType > | |
const ChunkType * | ReadChunk () const |
Read() a chunk of specified type at the current read position. More... | |
Protected Attributes | |
UInt32 | mForm |
The file format identifier. More... | |
UInt32 | mFourCC |
The FourCC file type identifier. More... | |
ConstData | mData |
Reference to the iff-file data. More... | |
UInt32 | mCurrentPos |
The current byte position. More... | |
Constructor taking the file identifier and the file type identifier.
This method takes care of the system's byte ordering.
form | The file format identifier. |
fourCC | The file type identifier. |
data | The iff-file data object. |
Constructor taking the file type identifier.
Set the file format identifier to 'MURL'. This method takes care of the system's byte ordering.
fourCC | The file type identifier. |
data | The iff-file data object. |
Murl::Util::IffStream::IffStream | ( | const ConstData & | data | ) |
Constructor to create a headerless IffStream.
Use this constructor to parse sub-streams from a given container stream. This method takes care of the system's byte ordering.
data | The iff-file data object. |
|
virtual |
Open the iff-file stream.
Verify the IffHeader and set the read position to the first chunk. The verification checks the file identifier, the file type identifier and the file size.
|
virtual |
Close the iff-file stream.
Check the chunk identifier at the current read position and return the byte size of the chunk.
This method takes care of the system's byte ordering.
fourCC | The FourCC chunk identifier to check or zero to skip the chunk test. |
|
virtual |
Check the chunk identifier at the current read position and verify the byte size of the chunk.
This method takes care of the system's byte ordering.
fourCC | The FourCC chunk identifier to check or zero to skip the chunk test. |
chunkSize | The byte size of the chunk. |
additionalSize | Additional byte size to check. |
Check the chunk identifier and size at the current read position and return the the chunk.
This method takes care of the system's byte ordering.
fourCC | The FourCC chunk identifier to check or zero to skip the chunk test. |
|
virtual |
Advance the current read position to the next chunk.
|
virtual |
Rewind the read postition to the first chunk.
|
virtual |
Check if the end of the stream is reached.
|
inline |
Check() a chunk of specified type at the current read position.
ChunkType | The iff chunk type which must have a public enum FOURCC constant defining the chunk identifier. |
additionalSize | Additional byte size to check. |
|
inline |
Read() a chunk of specified type at the current read position.
ChunkType | The iff chunk type which must have a public enum FOURCC constant defining the chunk identifier. |
|
protected |
The file format identifier.
|
protected |
The FourCC file type identifier.
|
protected |
Reference to the iff-file data.
|
protected |
The current byte position.