Read file images stored on disk.
This class provides a simple C++ interface to the IFF i/o library (flib). A class called MIffTag is used to create the 4 byte tags that are used to distinguish the different block types within an IFF file.
geometryCacheConverter.cpp, geometryCacheFile.cpp, and geometryCacheFile.h.
#include <MIffFile.h>
Public Member Functions |
|
MIffFile () | |
Default class constructor. |
|
MIffFile (const MString &fileName) | |
Alternate class constructor. |
|
virtual | ~MIffFile () |
Destructor. |
|
MStatus | open (const MString &fileName) |
Opens the file for reading. |
|
MStatus | close () |
Close the currently open file. |
|
bool | isActive () const |
Is the file currently active? |
|
MStatus | beginReadGroup (MIffTag &id, MIffTag &type) |
Opens a group for reading. |
|
MStatus | endReadGroup () |
Closes group currently being read, skipping
remaining data (including nested groups). |
|
const void * | getChunk (MIffTag &chunkTag, unsigned *byteCount) |
Opens a chunk for reading. |
|
MStatus | beginGet (MIffTag &chunkTag, unsigned *byteCount) |
Begin grabbing the data. |
|
MStatus | endGet () |
Finish grabbing the data. |
|
int | get (void *buf, unsigned byteCount, MStatus *stat=NULL) |
Attempt to read 'byteCount' bytes from the
file into the buffer pointed to by buf. |
|
MStatus | iffGetShort (short int &result) |
Grabs a short from the active file. |
|
MStatus | iffGetInt (int &result) |
Grabs an integer from the active file.
|
|
MStatus | iffGetFloat (float &result) |
Grabs a float from the active file. |
|
Static Public Member Functions |
|
static const char * | className () |
Returns the name of this class. |
Alternate class constructor.
Opens the specified file for reading.
[in] | fileName | The file name (full path). |
Opens the file for reading.
[in] | fileName | The file name (full path). |
MStatus close | ( | ) |
Close the currently open file.
bool isActive | ( | ) | const |
Is the file currently active?
Opens a group for reading.
A group is composed of several chunks (sub-groups). Provides the id and type of the current group. Can be followed by several calls to chunk reading functions or to nested beginReadGroup(...) calls if needed (depending on the file structure). The function endReadGroup(...) is used to closed a group skipping remaining data (including nested groups).
[out] | id | id of the group being read |
[out] | type | type of the group being read |
MStatus endReadGroup | ( | ) |
Closes group currently being read, skipping remaining data (including nested groups).
const void * getChunk | ( | MIffTag & | chunkTag, |
unsigned * | byteCount | ||
) |
Opens a chunk for reading.
A chunk is a block of unstructured data with an associated tag.
[out] | chunkTag | chunk's associated tag |
[out] | byteCount | number of bytes in the chunk |
Begin grabbing the data.
[out] | chunkTag | tag of current chunk |
[out] | byteCount | number of bytes in the chunk |
MStatus endGet | ( | ) |
Finish grabbing the data.
int get | ( | void * | buf, |
unsigned | byteCount, | ||
MStatus * | ReturnStatus =
NULL |
||
) |
Attempt to read 'byteCount' bytes from the file into the buffer pointed to by buf.
[out] | buf | pointer to buffer in which to store the data read from the file. |
[in] | byteCount | maximum number of bytes that buf can hold |
[out] | ReturnStatus | status code |
MStatus iffGetShort | ( | short int & | result | ) |
Grabs a short from the active file.
[out] | result | the short value read from the file |
MStatus iffGetInt | ( | int & | result | ) |
Grabs an integer from the active file.
[out] | result | the int value read from the file |
MStatus iffGetFloat | ( | float & | result | ) |
Grabs a float from the active file.
[out] | result | the float value read from the file |
const char * className | ( | ) | [static] |