Public Member Functions
CommandArray Class Reference

## Detailed Description

This object represents a collection of commands.

The collection retrieved from Application::GetCommands contains the entire list of all the custom and built-in commands in the system. CommandArray::Filter can be used to reduce the list according to command categories. You can access a command by name via CommandArray::GetItem.

Warning:
  This specialized array is returned by Application::GetCommands, it is not meant to be created and modified in user-defined functions. If you want to add and remove arbitrary items to a collection, you must use a CRefArray instead.

Since:
  4.0

`#include <xsi_command.h>`

Inheritance diagram for CommandArray:
[legend]

List of all members.

## Public Member Functions
| CommandArray ()
| ~CommandArray ()
| CommandArray (const CRef &in_ref)
| CommandArray (const CommandArray &in_obj)
bool | IsA (siClassID in_ClassID) const
siClassID | GetClassID () const
CommandArray & | operator= (const CommandArray &in_obj)
CommandArray & | operator= (const CRef &in_ref)
Command | GetItem (LONG in_index) const
Command | GetItem (const CString &in_name) const
Command | operator[] (LONG in_index)
const Command | operator[] (LONG in_index) const
LONG | GetCount () const
CommandArray | Filter (CStringArray &in_keywords) const
CommandArray | Filter (CString &in_keyword) const

## Constructor & Destructor Documentation

CommandArray | ( |  | ) |

Default constructor.

~CommandArray | ( |  | ) |

Default destructor.

CommandArray | ( | const CRef & | in_ref | ) |

Constructor.

Parameters:

  in_ref | constant reference object.

CommandArray | ( | const CommandArray & | in_obj | ) |

Copy constructor.

Parameters:

  in_obj | constant class object.

## Member Function Documentation

bool IsA | ( | siClassID | in_ClassID | ) | const `[virtual]`

Returns true if a given class type is compatible with this API class.

Parameters:

  in_ClassID | class type.

Returns:
  true if the class is compatible, false otherwise.

Reimplemented from CBase.

siClassID GetClassID | ( |  | ) | const `[virtual]`

Returns the type of the API class.

Returns:
  The class type.

Implements CBase.

CommandArray& operator= | ( | const CommandArray & | in_obj | ) |

Creates an object from another object.

Parameters:

  in_obj | constant class object.

Returns:
  The new CommandArray object.

CommandArray& operator= | ( | const CRef & | in_ref | ) |

Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.

Parameters:

  in_ref | constant class object.

Returns:
  The new CommandArray object.

Command GetItem | ( | LONG | in_index | ) | const

Returns a Command object at a specified index in the array.

Parameters:

  in_index | The index of the Command.

Since:
  4.0

Command GetItem | ( | const CString & | in_name | ) | const

Returns a Command object based on its name.

Parameters:

  in_name | The name of the command, which is the user-friendly version of the command name (SIObject::GetName), not the scripting name (Command::GetScriptingName) of the command.

See also:
  Application::GetCommandByScriptingName

Since:
  4.0

Command operator[] | ( | LONG | in_index | ) |

Accessor to elements at a given index.

Parameters:

  in_index | Command object

Since:
  4.0

const Command operator[] | ( | LONG | in_index | ) | const

Accessor to elements at a given index. This function can only be called by constant objects, the returned value is read-only.

Parameters:

  in_index | constant Command object

Since:
  4.0

LONG GetCount | ( |  | ) | const

Returns the number of Command objects in the array.

Returns:
  The number of Command objects.

Since:
  4.0

CommandArray Filter | ( | CStringArray & | in_keywords | ) | const

Returns a new instance of the command array containing only elements that match the specified categories. See SIObject::GetCategories.

Tip:
  To find all custom commands call CommandArray::Filter() with the `Custom` keyword.

Parameters:

  in_keywords | Keywords to match

Since:
  4.0

CommandArray Filter | ( | CString & | in_keyword | ) | const

Convenience version of CommandArray::Filter() for the case when only a single keyword is being specified.

Parameters:

  in_keyword | Keyword to match

Since:
  4.0

The documentation for this class was generated from the following file:

- xsi_command.h