MArgDatabase Class Reference

#include <MArgDatabase.h>

Class 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:
+ Inheritance diagram for MArgDatabase:

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. More...
 
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. More...
 
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. More...
 
MStatus getObjects (MSelectionList &result) const
 Gets the list of objects passed to the command as an MSelectionList. More...
 
MStatus getFlagArgument (const char *flag, unsigned int index, bool &result) const
 This method is not available in Python. More...
 
MStatus getFlagArgument (const char *flag, unsigned int index, int &result) const
 This method is not available in Python. More...
 
MStatus getFlagArgument (const char *flag, unsigned int index, double &result) const
 This method is not available in Python. More...
 
MStatus getFlagArgument (const char *flag, unsigned int index, MString &result) const
 This method is not available in Python. More...
 
MStatus getFlagArgument (const char *flag, unsigned int index, unsigned int &result) const
 This method is not available in Python. More...
 
MStatus getFlagArgument (const char *flag, unsigned int index, MDistance &result) const
 This method is not available in Python. More...
 
MStatus getFlagArgument (const char *flag, unsigned int index, MAngle &result) const
 This method is not available in Python. More...
 
MStatus getFlagArgument (const char *flag, unsigned int index, MTime &result) const
 This method is not available in Python. More...
 
MStatus getCommandArgument (unsigned int index, bool &result) const
 This method is not available in Python. More...
 
MStatus getCommandArgument (unsigned int index, int &result) const
 This method is not available in Python. More...
 
MStatus getCommandArgument (unsigned int index, double &result) const
 This method is not available in Python. More...
 
MStatus getCommandArgument (unsigned int index, MString &result) const
 This method is not available in Python. More...
 
MStatus getCommandArgument (unsigned int index, MDistance &result) const
 This method is not available in Python. More...
 
MStatus getCommandArgument (unsigned int index, MAngle &result) const
 This method is not available in Python. More...
 
MStatus getCommandArgument (unsigned int index, MTime &result) const
 This method is not available in Python. More...
 
MStatus getObjects (MStringArray &result) const
 Gets the list of objects passed to the command as an array of strings. More...
 
- Public Member Functions inherited from MArgParser
 MArgParser ()
 The default class constructor.
 
 MArgParser (const MSyntax &syntax, const MArgList &argList, MStatus *ReturnStatus=NULL)
 Creates an MArgParser object by using the data in 'syntax' to parse the argList. More...
 
virtual ~MArgParser ()
 The class destructor.
 
bool isFlagSet (const char *flag, MStatus *ReturnStatus=NULL) const
 Queries the arguments to the command to determine if the given flag is set. More...
 
bool isEdit (MStatus *ReturnStatus=NULL) const
 Determines if the edit flag was one of the arguments to the command. More...
 
bool isQuery (MStatus *ReturnStatus=NULL) const
 Determines if the query flag was one of the arguments to the command. More...
 
unsigned int numberOfFlagsUsed () const
 Returns the number of flags given on the command line. More...
 
unsigned int numberOfFlagUses (const char *flag) const
 Returns the number of times the given flag was used on the command line. More...
 
MStatus getFlagArgument (const char *flag, unsigned int index, bool &result) const
 Gets the value of the 'index'th parameter of the given flag as a boolean. More...
 
MStatus getFlagArgument (const char *flag, unsigned int index, int &result) const
 Gets the value of the 'index'th parameter of the given flag as an int. More...
 
MStatus getFlagArgument (const char *flag, unsigned int index, double &result) const
 Gets the value of the 'index'th parameter of the given flag as a double. More...
 
MStatus getFlagArgument (const char *flag, unsigned int index, MString &result) const
 Gets the value of the 'index'th parameter of the given flag as an MString. More...
 
MStatus getFlagArgument (const char *flag, unsigned int index, unsigned int &result) const
 Gets the value of the 'index'th parameter of the given flag as an unsigned int. More...
 
MStatus getFlagArgument (const char *flag, unsigned int index, MDistance &result) const
 Gets the value of the 'index'th parameter of the given flag as an MDistance. More...
 
MStatus getFlagArgument (const char *flag, unsigned int index, MAngle &result) const
 Gets the value of the 'index'th parameter of the given flag as an MAngle. More...
 
MStatus getFlagArgument (const char *flag, unsigned int index, MTime &result) const
 Gets the value of the 'index'th parameter of the given flag as an MTime. More...
 
bool flagArgumentBool (const char *flag, unsigned int index, MStatus *ReturnStatus=NULL) const
 Gets the value of the 'index'th parameter of the given flag as a boolean. More...
 
int flagArgumentInt (const char *flag, unsigned int index, MStatus *ReturnStatus=NULL) const
 Gets the value of the 'index'th parameter of the given flag as an int. More...
 
double flagArgumentDouble (const char *flag, unsigned int index, MStatus *ReturnStatus=NULL) const
 Gets the value of the 'index'th parameter of the given flag as a double. More...
 
MString flagArgumentString (const char *flag, unsigned int index, MStatus *ReturnStatus=NULL) const
 Gets the value of the 'index'th parameter of the given flag as an MString. More...
 
MDistance flagArgumentMDistance (const char *flag, unsigned int index, MStatus *ReturnStatus=NULL) const
 Gets the value of the 'index'th parameter of the given flag as an MDistance. More...
 
MAngle flagArgumentMAngle (const char *flag, unsigned int index, MStatus *ReturnStatus=NULL) const
 Gets the value of the 'index'th parameter of the given flag as an MAngle. More...
 
MTime flagArgumentMTime (const char *flag, unsigned int index, MStatus *ReturnStatus=NULL) const
 Gets the value of the 'index'th parameter of the given flag as an MTime. More...
 
MStatus getFlagArgumentPosition (const char *flag, unsigned int i, unsigned int &position) const
 Returns the position in the command line of the i'th usage of the specified flag. More...
 
MStatus getFlagArgumentList (const char *flag, unsigned int i, MArgList &args) const
 Returns an MArgList containing the parameters to the i'th usage of the specified flag. More...
 
MStatus getCommandArgument (unsigned int index, bool &result) const
 Gets the value of the requested command argument to the command as a boolean. More...
 
MStatus getCommandArgument (unsigned int index, int &result) const
 Gets the value of the requested command argument to the command as an int. More...
 
MStatus getCommandArgument (unsigned int index, double &result) const
 Gets the value of the requested command argument to the command as a double. More...
 
MStatus getCommandArgument (unsigned int index, MString &result) const
 Gets the value of the requested command argument to the command as an MString. More...
 
MStatus getCommandArgument (unsigned int index, MDistance &result) const
 Gets the value of the requested command argument to the command as an MDistance. More...
 
MStatus getCommandArgument (unsigned int index, MAngle &result) const
 Gets the value of the requested command argument to the command as an MAngle. More...
 
MStatus getCommandArgument (unsigned int index, MTime &result) const
 Gets the value of the requested command argument to the command as an MTime. More...
 
bool commandArgumentBool (unsigned int index, MStatus *ReturnStatus=NULL) const
 Gets the value of the requested command argument as a boolean. More...
 
int commandArgumentInt (unsigned int index, MStatus *ReturnStatus=NULL) const
 Gets the value of the requested command argument as an int. More...
 
double commandArgumentDouble (unsigned int index, MStatus *ReturnStatus=NULL) const
 Gets the value of the requested command argument as a double. More...
 
MString commandArgumentString (unsigned int index, MStatus *ReturnStatus=NULL) const
 Gets the value of the requested command argument as a string. More...
 
MDistance commandArgumentMDistance (unsigned int index, MStatus *ReturnStatus=NULL) const
 Gets the value of the requested command argument as a MDistance. More...
 
MAngle commandArgumentMAngle (unsigned int index, MStatus *ReturnStatus=NULL) const
 Gets the value of the requested command argument as a MAngle. More...
 
MTime commandArgumentMTime (unsigned int index, MStatus *ReturnStatus=NULL) const
 Gets the value of the requested command argument as a MTime. More...
 
MStatus getObjects (MStringArray &result) const
 Gets the list of objects passed to the command as an array of strings. More...
 

Static Public Member Functions

static const char * className ()
 Returns the name of this class. More...
 
- Static Public Member Functions inherited from MArgParser
static const char * className ()
 Returns the name of this class. More...
 

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]syntaxthe syntax object
[in]argListthe argument list
[out]ReturnStatusreturn 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

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

Parameters
[in]flagflag whose parameter is being requested
[in]indexindex of the parameter
[out]resultvalue of the parameter as an MSelectionList
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
+ Examples:
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.

Parameters
[in]indexindex of the command argument
[out]resultvalue of the argument as an MSelectionList
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getObjects ( MSelectionList result) const

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

Parameters
[out]resultlist of objects passed to the command
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed, since it doesn't fit in the minObjects() and maxObjects() of the MSyntax.
+ Examples:
MStatus getFlagArgument ( const char *  flag,
unsigned int  index,
bool &  result 
) const

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]flagflag whose parameter is being requested
[in]indexindex of the parameter to retrieve
[out]resultvalue of the parameter as a boolean
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getFlagArgument ( const char *  flag,
unsigned int  index,
int &  result 
) const

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]flagflag whose parameter is being requested
[in]indexindex of the parameter to retrieve
[out]resultvalue of the parameter as an int
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getFlagArgument ( const char *  flag,
unsigned int  index,
double &  result 
) const

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]flagflag whose parameter is being requested
[in]indexindex of the parameter to retrieve
[out]resultvalue of the parameter as a double
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getFlagArgument ( const char *  flag,
unsigned int  index,
MString result 
) const

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]flagflag whose parameter is being requested
[in]indexindex of the parameter to retrieve
[out]resultvalue of the parameter as an MString
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getFlagArgument ( const char *  flag,
unsigned int  index,
unsigned int &  result 
) const

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]flagflag whose parameter is being requested
[in]indexindex of the parameter to retrieve
[out]resultvalue of the parameter as an unsigned int
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getFlagArgument ( const char *  flag,
unsigned int  index,
MDistance result 
) const

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]flagflag whose parameter is being requested
[in]indexindex of the parameter to retrieve
[out]resultvalue of the parameter as an MDistance
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getFlagArgument ( const char *  flag,
unsigned int  index,
MAngle result 
) const

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]flagflag whose parameter is being requested
[in]indexindex of the parameter to retrieve
[out]resultvalue of the parameter as an MAngle
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getFlagArgument ( const char *  flag,
unsigned int  index,
MTime result 
) const

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]flagflag whose parameter is being requested
[in]indexindex of the parameter to retrieve
[out]resultvalue of the parameter as an MTime
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getCommandArgument ( unsigned int  index,
bool &  result 
) const

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]indexthe index of the argument of the command
[out]resultthe value of the argument as a boolean
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getCommandArgument ( unsigned int  index,
int &  result 
) const

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]indexthe index of the argument of the command
[out]resultthe value of the argument as a int
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getCommandArgument ( unsigned int  index,
double &  result 
) const

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]indexthe index of the argument of the command
[out]resultthe value of the argument as a double
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getCommandArgument ( unsigned int  index,
MString result 
) const

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]indexthe index of the argument of the command
[out]resultthe value of the argument as an MString
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getCommandArgument ( unsigned int  index,
MDistance result 
) const

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]indexthe index of the argument of the command
[out]resultthe value of the argument as an MDistance
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getCommandArgument ( unsigned int  index,
MAngle result 
) const

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]indexthe index of the argument of the command
[out]resultthe value of the argument as an MAngle
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getCommandArgument ( unsigned int  index,
MTime result 
) const

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]indexthe index of the argument of the command
[out]resultthe value of the argument as an MTime
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getObjects ( MStringArray result) const

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

Parameters
[out]resultthe list of objects passed to the command as an MStringArray
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
const char * className ( )
static

Returns the name of this class.

Returns
Name of this class.

The documentation for this class was generated from the following files:
  • MArgDatabase.h
  • MArgDatabase.cpp