- Main Page
- Related Pages
- Modules
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions

# MArgDatabase Class Reference
OpenMaya - API module for common classes

Search for all occurrences

## Detailed Description

Command argument list parser.

This class extends MArgParser by providing the ability to retrieve flag parameters, command arguments and command objects as selection lists.

See MArgParser for more details on how command argument parsing works in general.

Examples:

  cgfxShaderCmd.cpp, closestPointOnCurveCmd.cpp, clusterWeightFunction.cpp, conditionTest.cpp, dagMessageCmd.cpp, deletedMsgCmd.cpp, eventTest.cpp, filteredAsciiFile.cpp, flipUVCmd.cpp, flipUVCmd.h, fxManagerCmd.cpp, geometryCacheConverter.cpp, geometrySurfaceConstraint.cpp, helixTool.cpp, lockEvent.cpp, nodeCreatedCBCmd.cpp, nodeInfoCmd.cpp, particlePathsCmd.cpp, peltOverlapCmd.cpp, renderViewInteractiveRenderCmd.cpp, renderViewRenderCmd.cpp, renderViewRenderRegionCmd.cpp, scanDagSyntax.cpp, userMsgCmd.cpp, and viewCallbackTest.cpp.

`#include <MArgDatabase.h>`

Inheritance diagram for MArgDatabase:
[legend]

List of all members.

## Public Member Functions
| MArgDatabase ()
| Default Constructor.
| MArgDatabase (const MSyntax &syntax, const MArgList &argList, MStatus *ReturnStatus=NULL)
| Creates an MArgDatabase object by using the data in syntax to parse the arguments provided in argList.
virtual | ~MArgDatabase ()
| The class destructor.
MStatus | getFlagArgument (const char *flag, unsigned int index, MSelectionList &result) const
| Gets the value of the 'index'th parameter of the given flag as an MSelectionList.
MStatus | getCommandArgument (unsigned int index, MSelectionList &result) const
| Gets the value of the requested command argument and appends it to the end of the MSelectionList that is passed in.
MStatus | getObjects (MSelectionList &result) const
| Gets the list of objects passed to the command as an MSelectionList.
MStatus | getFlagArgument (const char *flag, unsigned int index, bool &result) const
| This method is not available in Python.
MStatus | getFlagArgument (const char *flag, unsigned int index, int &result) const
| This method is not available in Python.
MStatus | getFlagArgument (const char *flag, unsigned int index, double &result) const
| This method is not available in Python.
MStatus | getFlagArgument (const char *flag, unsigned int index, MString &result) const
| This method is not available in Python.
MStatus | getFlagArgument (const char *flag, unsigned int index, unsigned int &result) const
| This method is not available in Python.
MStatus | getFlagArgument (const char *flag, unsigned int index, MDistance &result) const
| This method is not available in Python.
MStatus | getFlagArgument (const char *flag, unsigned int index, MAngle &result) const
| This method is not available in Python.
MStatus | getFlagArgument (const char *flag, unsigned int index, MTime &result) const
| This method is not available in Python.
MStatus | getCommandArgument (unsigned int index, bool &result) const
| This method is not available in Python.
MStatus | getCommandArgument (unsigned int index, int &result) const
| This method is not available in Python.
MStatus | getCommandArgument (unsigned int index, double &result) const
| This method is not available in Python.
MStatus | getCommandArgument (unsigned int index, MString &result) const
| This method is not available in Python.
MStatus | getCommandArgument (unsigned int index, MDistance &result) const
| This method is not available in Python.
MStatus | getCommandArgument (unsigned int index, MAngle &result) const
| This method is not available in Python.
MStatus | getCommandArgument (unsigned int index, MTime &result) const
| This method is not available in Python.
MStatus | getObjects (MStringArray &result) const
| Gets the list of objects passed to the command as an array of strings.
## Static Public Member Functions
static const char * | className ()
| Returns the name of this class.

## Constructor & Destructor Documentation

MArgDatabase | ( | const MSyntax & | syntax,
|  | const MArgList & | argList,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Creates an MArgDatabase object by using the data in syntax to parse the arguments provided in argList.

Parameters:

  [in] | syntax | the syntax object
  [in] | argList | the argument list
  [out] | ReturnStatus | return status

Status Codes:
  - MS::kSuccess parsing successful. The MArgDatabase instance was constructed sucessfully.
  - MS::kFailure The provided arguments were not syntactically valid as specified by the syntax object, The MArgDatabase instance was not constructed sucessfully.

## Member Function Documentation

MStatus getFlagArgument | ( | const char * | flag,
|  | unsigned int | index,
|  | MSelectionList & | result
| ) |  | const

Search for all occurrences

Gets the value of the 'index'th parameter of the given flag as an MSelectionList.

Parameters:

  [in] | flag | flag whose parameter is being requested
  [in] | index | index of the parameter
  [out] | result | value of the parameter as an MSelectionList

Returns:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

Examples:
  flipUVCmd.cpp, fxManagerCmd.cpp, nodeCreatedCBCmd.cpp, and renderViewInteractiveRenderCmd.cpp.

MStatus getCommandArgument | ( | unsigned int | index,
|  | MSelectionList & | result
| ) |  | const

Search for all occurrences

Gets the value of the requested command argument and appends it to the end of the MSelectionList that is passed in.

Parameters:

  [in] | index | index of the command argument
  [out] | result | value of the argument as an MSelectionList

Returns:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

MStatus getObjects | ( | MSelectionList & | result | ) | const

Search for all occurrences

Gets the list of objects passed to the command as an MSelectionList.

Parameters:

  [out] | result | list of objects passed to the command

Returns:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

MStatus getFlagArgument | ( | const char * | flag,
|  | unsigned int | index,
|  | bool & | result
| ) |  | const

Search for all occurrences

This method is not available in Python.

Gets the value of the 'index'th parameter of the given flag as a boolean.

Python Notes

Use flagArgumentBool() instead.

Parameters:

  [in] | flag | flag whose parameter is being requested
  [in] | index | index of the parameter to retrieve
  [out] | result | value of the parameter as a boolean

Returns:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

Reimplemented from MArgParser.

MStatus getFlagArgument | ( | const char * | flag,
|  | unsigned int | index,
|  | int & | result
| ) |  | const

Search for all occurrences

This method is not available in Python.

Gets the value of the 'index'th parameter of the given flag as an int.

Python Notes

Use flagArgumentInt() instead.

Parameters:

  [in] | flag | flag whose parameter is being requested
  [in] | index | index of the parameter to retrieve
  [out] | result | value of the parameter as an int

Returns:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

Reimplemented from MArgParser.

MStatus getFlagArgument | ( | const char * | flag,
|  | unsigned int | index,
|  | double & | result
| ) |  | const

Search for all occurrences

This method is not available in Python.

Gets the value of the 'index'th parameter of the given flag as a double.

Python Notes

Use flagArgumentDouble() instead.

Parameters:

  [in] | flag | flag whose parameter is being requested
  [in] | index | index of the parameter to retrieve
  [out] | result | value of the parameter as a double

Returns:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

Reimplemented from MArgParser.

MStatus getFlagArgument | ( | const char * | flag,
|  | unsigned int | index,
|  | MString & | result
| ) |  | const

Search for all occurrences

This method is not available in Python.

Gets the value of the 'index'th parameter of the given flag as an MString.

Python Notes

Use flagArgumentString() instead.

Parameters:

  [in] | flag | flag whose parameter is being requested
  [in] | index | index of the parameter to retrieve
  [out] | result | value of the parameter as an MString

Returns:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

Reimplemented from MArgParser.

MStatus getFlagArgument | ( | const char * | flag,
|  | unsigned int | index,
|  | unsigned int & | result
| ) |  | const

Search for all occurrences

This method is not available in Python.

Gets the value of the 'index'th parameter of the given flag as an unsigned int.

Python Notes

Use flagArgumentInt() instead.

Parameters:

  [in] | flag | flag whose parameter is being requested
  [in] | index | index of the parameter to retrieve
  [out] | result | value of the parameter as an unsigned int

Returns:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

Reimplemented from MArgParser.

MStatus getFlagArgument | ( | const char * | flag,
|  | unsigned int | index,
|  | MDistance & | result
| ) |  | const

Search for all occurrences

This method is not available in Python.

Gets the value of the 'index'th parameter of the given flag as an MDistance.

Python Notes

Use flagArgumentMDistance() instead.

Parameters:

  [in] | flag | flag whose parameter is being requested
  [in] | index | index of the parameter to retrieve
  [out] | result | value of the parameter as an MDistance

Returns:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

Reimplemented from MArgParser.

MStatus getFlagArgument | ( | const char * | flag,
|  | unsigned int | index,
|  | MAngle & | result
| ) |  | const

Search for all occurrences

This method is not available in Python.

Gets the value of the 'index'th parameter of the given flag as an MAngle.

Python Notes

Use flagArgumentMAngle() instead.

Parameters:

  [in] | flag | flag whose parameter is being requested
  [in] | index | index of the parameter to retrieve
  [out] | result | value of the parameter as an MAngle

Returns:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

Reimplemented from MArgParser.

MStatus getFlagArgument | ( | const char * | flag,
|  | unsigned int | index,
|  | MTime & | result
| ) |  | const

Search for all occurrences

This method is not available in Python.

Gets the value of the 'index'th parameter of the given flag as an MTime.

Python Notes

Use flagArgumentMTime() instead.

Parameters:

  [in] | flag | flag whose parameter is being requested
  [in] | index | index of the parameter to retrieve
  [out] | result | value of the parameter as an MTime

Returns:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

Reimplemented from MArgParser.

MStatus getCommandArgument | ( | unsigned int | index,
|  | bool & | result
| ) |  | const

Search for all occurrences

This method is not available in Python.

Gets the value of the requested command argument to the command as a boolean.

Python Notes

Use commandArgumentBool() instead.

Parameters:

  [in] | index | the index of the argument of the command
  [out] | result | the value of the argument as a boolean

Returns:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

Reimplemented from MArgParser.

MStatus getCommandArgument | ( | unsigned int | index,
|  | int & | result
| ) |  | const

Search for all occurrences

This method is not available in Python.

Gets the value of the requested command argument to the command as an int.

Python Notes

Use commandArgumentInt() instead.

Parameters:

  [in] | index | the index of the argument of the command
  [out] | result | the value of the argument as a int

Returns:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

Reimplemented from MArgParser.

MStatus getCommandArgument | ( | unsigned int | index,
|  | double & | result
| ) |  | const

Search for all occurrences

This method is not available in Python.

Gets the value of the requested command argument to the command as a double.

Python Notes

Use commandArgumentDouble() instead.

Parameters:

  [in] | index | the index of the argument of the command
  [out] | result | the value of the argument as a double

Returns:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

Reimplemented from MArgParser.

MStatus getCommandArgument | ( | unsigned int | index,
|  | MString & | result
| ) |  | const

Search for all occurrences

This method is not available in Python.

Gets the value of the requested command argument to the command as an MString.

Python Notes

Use commandArgumentString() instead.

Parameters:

  [in] | index | the index of the argument of the command
  [out] | result | the value of the argument as an MString

Returns:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

Reimplemented from MArgParser.

MStatus getCommandArgument | ( | unsigned int | index,
|  | MDistance & | result
| ) |  | const

Search for all occurrences

This method is not available in Python.

Gets the value of the requested command argument to the command as an MDistance.

Python Notes

Use commandArgumentMDistance() instead.

Parameters:

  [in] | index | the index of the argument of the command
  [out] | result | the value of the argument as an MDistance

Returns:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

Reimplemented from MArgParser.

MStatus getCommandArgument | ( | unsigned int | index,
|  | MAngle & | result
| ) |  | const

Search for all occurrences

This method is not available in Python.

Gets the value of the requested command argument to the command as an MAngle.

Python Notes

Use commandArgumentMAngle() instead.

Parameters:

  [in] | index | the index of the argument of the command
  [out] | result | the value of the argument as an MAngle

Returns:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

Reimplemented from MArgParser.

MStatus getCommandArgument | ( | unsigned int | index,
|  | MTime & | result
| ) |  | const

Search for all occurrences

This method is not available in Python.

Gets the value of the requested command argument to the command as an MTime.

Python Notes

Use commandArgumentMTime() instead.

Parameters:

  [in] | index | the index of the argument of the command
  [out] | result | the value of the argument as an MTime

Returns:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

Reimplemented from MArgParser.

MStatus getObjects | ( | MStringArray & | result | ) | const

Search for all occurrences

Gets the list of objects passed to the command as an array of strings.

Parameters:

  [out] | result | the list of objects passed to the command as an MStringArray

Returns:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

Reimplemented from MArgParser.

const char * className | ( |  | ) | `[static]`

Search for all occurrences

Returns the name of this class.

Returns:
  Name of this class.

Reimplemented from MArgParser.

MArgDatabase MArgDatabase MArgDatabase MArgDatabase MArgDatabase MArgDatabase MArgDatabase MArgDatabase MArgDatabase MArgDatabase
MArgDatabase MArgDatabase MArgDatabase MArgDatabase MArgDatabase MArgDatabase MArgDatabase MArgDatabase MArgDatabase MArgDatabase