CommandLine Class Reference
Class that parses the command line and allows for easy access to the commands.
More...
#include <Application/CommandLine.h>
List of all members.
Public Member Functions |
| void | Parse (int argc, char *argv[]) |
| | Parses the command line input.
|
| bool | FindCmd (const char *cmd, std::vector< std::string > *args=NULL) const |
| | Searches for a command.
|
| uint | GetCmdCount () const |
| | Gets the number of commands specified in the command line.
|
| int | Find (const char *arg) const |
| | Searches for an argument in the command line.
|
| const char * | Get (uint i) const |
| | Gets the i th argument from the command line.
|
| uint | GetArgCount () const |
| | Gets the number of arguments in the command line.
|
Detailed Description
Class that parses the command line and allows for easy access to the commands.
Commands are expected to be proceeded with '+' or '-' all strings after a command are assumed to be that commands arguments.
Member Function Documentation
| int CommandLine::Find |
( |
const char * |
arg |
) |
const |
Searches for an argument in the command line.
- Parameters:
-
| [in] | arg | the name of the argument to search for. |
- Returns:
- The index to the argument or -1 if the argument does not exist.
| bool CommandLine::FindCmd |
( |
const char * |
cmd, |
|
|
std::vector< std::string > * |
args = NULL | |
|
) |
| | const |
Searches for a command.
- Parameters:
-
| [in] | cmd | the name of the command to search for. |
| [out] | args | pointer to a vector that will store any arguments to cmd. |
- Returns:
- True if the command was found, false otherwise.
| const char * CommandLine::Get |
( |
uint |
i |
) |
const |
Gets the i th argument from the command line.
- Parameters:
-
- Returns:
- The i th command line argument.
| uint CommandLine::GetArgCount |
( |
|
) |
const |
Gets the number of arguments in the command line.
- Returns:
- The number of arguments in the command line.
| uint CommandLine::GetCmdCount |
( |
|
) |
const |
Gets the number of commands specified in the command line.
- Returns:
- The number of commands.
| void CommandLine::Parse |
( |
int |
argc, |
|
|
char * |
argv[] | |
|
) |
| | |
Parses the command line input.
- Parameters:
-
| [in] | argc | the length of the argv array. |
| [in] | argv | the array of input arguments. |
The documentation for this class was generated from the following files: