class MIffFile

Jump to documentation

Read file images stored on disk. (OpenMaya) (OpenMaya.py)

public members:

MIffFile ()
MIffFile (const MString &fileName)
virtual ~MIffFile ()
MStatus open (const MString & fileName)
MStatus close ()
bool isActive () const
MStatus beginReadGroup ( MIffTag & id, MIffTag & type)
MStatus endReadGroup ()
const void * getChunk ( MIffTag & chunkTag, unsigned *byteCount)
MStatus beginGet ( MIffTag & chunkTag, unsigned *byteCount)
MStatus endGet ()
int get (void *buf, unsigned byteCount, MStatus *stat = NULL)
MStatus iffGetShort ( short int& result )
MStatus iffGetInt ( int& result )
MStatus iffGetFloat ( float& result )

Documentation

This class provides access to Maya's IFF parsing classes.
Description
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.

Functions

MIffFile:: MIffFile ()
Description

Default class constructor.

MIffFile:: MIffFile (const MString &fileName)
Description

Alternate class constructor. Opens the specified file for reading.

Arguments

  • charString The file name (full path).

MStatus MIffFile:: open (const MString &fileName )
Description

Opens the file for reading.

Return Value

  • MS::kSuccess if the open was successful
  • MS::kFailure otherwise.

MStatus MIffFile:: close ()
Description

Close the currently open file.

Return Value

  • MS::kSuccess if the close was successful.
  • MS::kFailure Invalid object.

MIffFile:: ~MIffFile ()
Description

Destructor.

bool MIffFile:: isActive () const
Description

Is the file currently active?

Return Value

  • True if the file is active.
  • False otherwise.

MStatus MIffFile:: beginReadGroup ( MIffTag & id, MIffTag & type)
Description

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).

Return Value

  • MS::kSuccess if the operation was successful.
  • MS::kFailure otherwise.

MStatus MIffFile:: endReadGroup ()
Description

Closes group currently being read, skipping remaining data (including nested groups).

Return Value

  • MS::kSuccess if the close was successful.
  • MS::kFailure otherwise.

const void* MIffFile:: getChunk ( MIffTag & chunkTag, unsigned *byteCount)
Description

Opens a chunk for reading. A chunk is a block of unstructured data with an associated tag

Return Value

  • Returns a pointer to the data, who's content should not be modified.

  • NULL if the read was not successful.

MStatus MIffFile:: beginGet ( MIffTag & chunkTag, unsigned *byteCount)
Description

Begin grabbing the data.

Return Value

  • MS::kSuccess if the read was successful.
  • MS::kFailure otherwise.

MStatus MIffFile:: endGet ()
Description

Finish grabbing the data.

Return Value

  • MS::kSuccess if successful.
  • MS::kFailure otherwise.

int MIffFile:: get (void *buf, unsigned byteCount, MStatus *ReturnStatus )
Description

Attempt to read 'byteCount' bytes from the file into the buffer pointed to by buf.

Return Value

  • Number of bytes read if successful.

Status Codes

  • MS::kSuccess Operation successful
  • MS::kFailure Read failure has occurred.

MStatus MIffFile:: iffGetShort ( short int& result )
Description

Grabs a short from the active file.

Return Value

  • MS::kSuccess if the open was successful
  • MS::kFailure otherwise.

MStatus MIffFile:: iffGetInt ( int& result )
Description

Grabs an integer from the active file.

Return Value

  • MS::kSuccess if the open was successful
  • MS::fFailure otherwise.

MStatus MIffFile:: iffGetFloat ( float& result )
Description

Grabs a float from the active file.

Return Value

  • MS::kSuccess if the open was successful
  • MS::kFailure Invalid object or read.

This class has no child classes.


Autodesk® Maya® 8.0 © 1997-2006 Autodesk, Inc. All rights reserved. doc++ Copyright