#include <MArgDatabase.h>
This class is used to parse and store all of the flags, arguments and objects which are passed to a command. The MArgDatabase accepts an MSyntax object, which describes the format for a command, and uses it to parse the command arguments into a form which is easy to query. The documentation for the MSyntax command contains the details on three types of arguments to commands:
The isFlagSet method can be used to find out if a particular flag argument was provided in the command invocation, and the getFlagArgument methods are used to return the value of that flag.
If the command requires command arguments (i.e. the addArg method was used to construct the syntax object), then getCommandArgument methods are used to return the values of those arguments.
If the command requires objects then the getObjects methods are used to return those objects either as a selection list of as a list of strings.
Note: command arguments and objects are incompatible and must not be combined in the syntax definition of a command. If both have been specified to the Syntax object, then neither the getCommandArgument or getObjects methods will work predictably.
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.
Public Member Functions | |
MArgDatabase () | |
MArgDatabase (const MSyntax &syntax, const MArgList &argList, MStatus *ReturnStatus=NULL) | |
virtual | ~MArgDatabase () |
MStatus | getFlagArgument (const char *flag, unsigned int index, MSelectionList &result) const |
MStatus | getCommandArgument (unsigned int index, MSelectionList &result) const |
MStatus | getObjects (MSelectionList &result) const |
MStatus | getFlagArgument (const char *flag, unsigned int index, bool &result) const |
NO SCRIPT SUPPORT, USE BASE CLASS. | |
MStatus | getFlagArgument (const char *flag, unsigned int index, int &result) const |
NO SCRIPT SUPPORT, USE BASE CLASS. | |
MStatus | getFlagArgument (const char *flag, unsigned int index, double &result) const |
NO SCRIPT SUPPORT, USE BASE CLASS. | |
MStatus | getFlagArgument (const char *flag, unsigned int index, MString &result) const |
NO SCRIPT SUPPORT, USE BASE CLASS. | |
MStatus | getFlagArgument (const char *flag, unsigned int index, unsigned int &result) const |
NO SCRIPT SUPPORT, USE BASE CLASS. | |
MStatus | getFlagArgument (const char *flag, unsigned int index, MDistance &result) const |
NO SCRIPT SUPPORT, USE BASE CLASS. | |
MStatus | getFlagArgument (const char *flag, unsigned int index, MAngle &result) const |
NO SCRIPT SUPPORT, USE BASE CLASS. | |
MStatus | getFlagArgument (const char *flag, unsigned int index, MTime &result) const |
NO SCRIPT SUPPORT, USE BASE CLASS. | |
MStatus | getCommandArgument (unsigned int index, bool &result) const |
NO SCRIPT SUPPORT, USE BASE CLASS. | |
MStatus | getCommandArgument (unsigned int index, int &result) const |
NO SCRIPT SUPPORT, USE BASE CLASS. | |
MStatus | getCommandArgument (unsigned int index, double &result) const |
NO SCRIPT SUPPORT, USE BASE CLASS. | |
MStatus | getCommandArgument (unsigned int index, MString &result) const |
NO SCRIPT SUPPORT, USE BASE CLASS. | |
MStatus | getCommandArgument (unsigned int index, MDistance &result) const |
NO SCRIPT SUPPORT, USE BASE CLASS. | |
MStatus | getCommandArgument (unsigned int index, MAngle &result) const |
NO SCRIPT SUPPORT, USE BASE CLASS. | |
MStatus | getCommandArgument (unsigned int index, MTime &result) const |
NO SCRIPT SUPPORT, USE BASE CLASS. | |
MStatus | getObjects (MStringArray &result) const |
MArgDatabase::MArgDatabase | ( | ) |
Default Constructor
MArgDatabase::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.
[in] | syntax | the syntax object |
[in] | argList | the argument list |
[out] | ReturnStatus | return status |
MArgDatabase::~MArgDatabase | ( | ) | [virtual] |
The class destructor.
MStatus MArgDatabase::getFlagArgument | ( | const char * | flag, | |
unsigned int | index, | |||
MSelectionList & | result | |||
) | const |
Gets the value of the requested flag argument to the given flag as an MSelectionList.
[in] | flag | the flag whose argument is being requested |
[in] | index | the index of the argument to the flag |
[out] | result | the value of the argument as an MSelectionList |
MStatus MArgDatabase::getCommandArgument | ( | unsigned int | index, | |
MSelectionList & | result | |||
) | const |
Gets the value of the requested command argument to the command and appends it to the end of the MSelectionList that is passed in.
[in] | index | the index of the argument of the command |
[out] | result | the value of the argument as an MSelectionList |
MStatus MArgDatabase::getObjects | ( | MSelectionList & | result | ) | const |
Gets the list of objects passed to the command as an MSelectionList.
[out] | result | the list of objects passed to the command as an MSelectionList |
MStatus MArgDatabase::getObjects | ( | MStringArray & | result | ) | const |
Gets the list of objects passed to the command as an array of strings.
[out] | result | the list of objects passed to the command as an MStringArray |
Reimplemented from MArgParser.
Autodesk® Maya® 2009 © 1997-2008 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |