The Interchange File Format stream class. More...
#include "murl_util_iff_stream.h"
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. | |
UInt32 | mFourCC |
The FourCC file type identifier. | |
ConstData | mData |
Reference to the iff-file data. | |
UInt32 | mCurrentPos |
The current byte position. | |
Detailed Description
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.
Constructor & Destructor Documentation
◆ IffStream() [1/3]
Constructor taking the file identifier and the file type identifier.
This method takes care of the system's byte ordering.
- Parameters
-
form The file format identifier. fourCC The file type identifier. data The iff-file data object.
◆ IffStream() [2/3]
Constructor taking the file type identifier.
Set the file format identifier to 'MURL'. This method takes care of the system's byte ordering.
- Parameters
-
fourCC The file type identifier. data The iff-file data object.
◆ IffStream() [3/3]
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.
- Parameters
-
data The iff-file data object.
Member Function Documentation
◆ Open()
|
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.
- Returns
- true if successful.
◆ Close()
|
virtual |
Close the iff-file stream.
- Returns
- true if successful.
◆ Check() [1/2]
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.
- Parameters
-
fourCC The FourCC chunk identifier to check or zero to skip the chunk test.
- Returns
- The byte size of the chunk, zero if the check failed or the end of the stream is reached.
Referenced by CheckChunk().
◆ Check() [2/2]
|
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.
- Parameters
-
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.
- Returns
- true if successful.
◆ Read()
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.
- Parameters
-
fourCC The FourCC chunk identifier to check or zero to skip the chunk test.
- Returns
- Pointer to the chunk, null if the check failed or the end of the stream is reached.
Referenced by ReadChunk().
◆ Advance()
|
virtual |
Advance the current read position to the next chunk.
- Returns
- true if successful, false if the end of the stream is reached.
◆ Rewind()
|
virtual |
Rewind the read postition to the first chunk.
- Returns
- true if successful.
◆ Eos()
|
virtual |
Check if the end of the stream is reached.
- Returns
- true if the end of the stream is reached.
◆ CheckChunk()
◆ ReadChunk()
|
inline |
Read() a chunk of specified type at the current read position.
- Template Parameters
-
ChunkType The iff chunk type which must have a public enum FOURCC_CHUNK constant defining the chunk identifier.
- Returns
- Pointer to the chunk of specified type, null if the check failed or the end of the stream is reached.
References Read().
The documentation for this class was generated from the following file:
- murl_util_iff_stream.h