Isle
|
[AI] Represents a source file handler for SI (Streamer Interface) files, providing buffered access for reading SI file data and managing chunks. More...
#include <mxdsfile.h>
Classes | |
struct | ChunkHeader |
[AI] Represents the SI file stream's header chunk, containing versioning and SI buffer info. More... | |
Public Member Functions | |
MxDSFile (const char *p_filename, MxULong p_skipReadingChunks) | |
[AI] Constructs an MxDSFile object with the specified filename and chunk-read behavior. More... | |
__declspec (dllexport) ~MxDSFile() override | |
[AI] Destructor (exported for DLL builds). More... | |
const char * | ClassName () const override |
[AI] Class identification. More... | |
MxBool | IsA (const char *p_name) const override |
[AI] Type comparison with other class names (for dynamic type identification). More... | |
MxResult | Open (MxULong) override |
[AI] Opens the SI file for reading or writing with the specified style flags. More... | |
MxResult | Close () override |
[AI] Closes the file and releases internal file buffers. More... | |
MxResult | Read (unsigned char *, MxULong) override |
[AI] Reads up to the specified number of bytes from the file into a buffer. More... | |
MxResult | Seek (MxLong, MxS32) override |
[AI] Seeks to an absolute or relative position in the file. More... | |
MxULong | GetBufferSize () override |
[AI] Returns the SI chunk's buffer size, as obtained from the SI file header. More... | |
MxULong | GetStreamBuffersNum () override |
[AI] Returns the number of streaming buffers, as specified in the SI file header. More... | |
void | SetFileName (const char *p_filename) |
[AI] Sets the SI file's name. More... | |
MxS32 | CalcFileSize () |
[AI] Calculates and returns the file size by querying the system (Windows GetFileSize). More... | |
![]() | |
MxDSSource () | |
[AI] Constructor, initializes buffer pointer to NULL, position to -1 and lengthInDWords to 0. More... | |
~MxDSSource () override | |
[AI] Virtual destructor, frees internal buffer if allocated. More... | |
const char * | ClassName () const override |
[AI] Returns the class name string ("MxDSSource"). More... | |
MxBool | IsA (const char *p_name) const override |
[AI] Runtime type information check. More... | |
virtual MxLong | Open (MxULong p_param)=0 |
[AI] Opens the source (e.g., a file, memory buffer, etc). More... | |
virtual MxLong | Close ()=0 |
[AI] Closes the source and releases any resources held. More... | |
virtual MxResult | ReadToBuffer (MxDSBuffer *p_buffer) |
[AI] Reads from this source into a provided MxDSBuffer up to the buffer's current write offset. More... | |
virtual MxResult | Read (unsigned char *p_dest, MxULong p_count)=0 |
[AI] Read a specified number of bytes into user-supplied buffer, starting at the current position. More... | |
virtual MxLong | Seek (MxLong p_offset, MxS32 p_origin)=0 |
[AI] Seek to a specific position in the source, relative to the start, current, or end. More... | |
virtual MxULong | GetBufferSize ()=0 |
[AI] Returns the total buffer size in bytes (implementation-dependent). More... | |
virtual MxULong | GetStreamBuffersNum ()=0 |
[AI] Returns the number of buffers the stream is internally segmented into (for multi-buffered streaming). More... | |
virtual MxLong | GetLengthInDWords () |
[AI] Gets the length of the data in DWORDs (32-bit units). More... | |
virtual MxU32 * | GetBuffer () |
[AI] Returns a pointer to the internal buffer as a DWORD (32-bit) pointer. More... | |
MxLong | GetPosition () const |
[AI] Returns the current per-source seek/read/write position. More... | |
![]() | |
MxCore () | |
[AI] Constructs a new MxCore object and assigns it a unique id. More... | |
virtual | ~MxCore () |
[AI] Virtual destructor. Required for correct polymorphic cleanup in derived classes. More... | |
virtual MxLong | Notify (MxParam &p_param) |
[AI] Virtual callback notification mechanism. More... | |
virtual MxResult | Tickle () |
[AI] Called by tickle managers to allow the object to update itself. More... | |
virtual const char * | ClassName () const |
[AI] Returns the runtime class name of this object. More... | |
virtual MxBool | IsA (const char *p_name) const |
[AI] Checks whether this object's class type or parents match the given name. More... | |
MxU32 | GetId () |
[AI] Gets the unique (per-process) id assigned to this object instance. More... | |
Additional Inherited Members | |
![]() | |
MxULong | m_lengthInDWords |
[AI] Length of valid data in the stream, in DWORDs (32-bit units). Used for sizing and range checking. More... | |
MxU32 * | m_pBuffer |
[AI] Pointer to allocated buffer, or NULL if uninitialized. Contains the raw read/streamed data. More... | |
MxLong | m_position |
[AI] Current seek/read/write position in the source. -1 if uninitialized, otherwise logical/physical offset. More... | |
[AI] Represents a source file handler for SI (Streamer Interface) files, providing buffered access for reading SI file data and managing chunks.
This class is responsible for opening, reading, and managing SI files compliant with major version 2 and minor version 2, and makes header and data chunk information available to OMNI engine subsystems.
The MxDSFile can be instructed to defer chunk reading until explicitly requested (via the m_skipReadingChunks flag).
Inherits from MxDSSource.
Definition at line 20 of file mxdsfile.h.
MxDSFile::MxDSFile | ( | const char * | p_filename, |
MxULong | p_skipReadingChunks | ||
) |
[AI] Constructs an MxDSFile object with the specified filename and chunk-read behavior.
p_filename | Path to the SI file to open. [AI] |
p_skipReadingChunks | If nonzero, chunk reading is skipped until explicitly called through ReadChunks. [AI] |
Definition at line 17 of file mxdsfile.cpp.
|
inlineoverride |
[AI] Destructor (exported for DLL builds).
Automatically closes the file and releases associated resources. [AI]
Definition at line 38 of file mxdsfile.h.
|
inline |
[AI] Calculates and returns the file size by querying the system (Windows GetFileSize).
Definition at line 108 of file mxdsfile.h.
|
inlineoverridevirtual |
[AI] Class identification.
Reimplemented from MxCore.
Definition at line 45 of file mxdsfile.h.
|
overridevirtual |
[AI] Closes the file and releases internal file buffers.
[AI]
[AI] Resets file state and deletes memory buffer of loaded chunk data.
Implements MxDSSource.
Definition at line 92 of file mxdsfile.cpp.
|
overridevirtual |
[AI] Returns the SI chunk's buffer size, as obtained from the SI file header.
[AI]
Implements MxDSSource.
Definition at line 132 of file mxdsfile.cpp.
|
overridevirtual |
[AI] Returns the number of streaming buffers, as specified in the SI file header.
[AI]
Implements MxDSSource.
Definition at line 139 of file mxdsfile.cpp.
|
inlineoverridevirtual |
[AI] Type comparison with other class names (for dynamic type identification).
p_name | The name of the class for comparison. [AI] |
Reimplemented from MxCore.
Definition at line 56 of file mxdsfile.h.
[AI] Opens the SI file for reading or writing with the specified style flags.
[in] | p_uStyle | Flags for file access mode (e.g. read/write). [AI] |
[AI] Also optionally reads SI chunks immediately, unless m_skipReadingChunks is enabled.
Implements MxDSSource.
Definition at line 25 of file mxdsfile.cpp.
[AI] Reads up to the specified number of bytes from the file into a buffer.
p_buf | Buffer to read into. [AI] |
p_nbytes | Number of bytes to read. [AI] |
Implements MxDSSource.
Definition at line 108 of file mxdsfile.cpp.
[AI] Seeks to an absolute or relative position in the file.
p_lOffset | Offset to seek to (from origin). [AI] |
p_iOrigin | One of SEEK_SET, SEEK_CUR, or SEEK_END. [AI] |
Implements MxDSSource.
Definition at line 120 of file mxdsfile.cpp.
|
inline |
[AI] Sets the SI file's name.
p_filename | New filename to use for this object. [AI] |
Definition at line 102 of file mxdsfile.h.