Drag[en]gine Game Engine  1.21
deCmdLineArgs Class Reference

Command line arguments. More...

#include <deCmdLineArgs.h>

Public Member Functions

Constructors and Destructors
 deCmdLineArgs ()
 Create a new command line object. More...
 
 deCmdLineArgs (const deCmdLineArgs &copy)
 Create a copy of an argument list. More...
 
 ~deCmdLineArgs ()
 Clean up the command line object. More...
 
Management
int GetCount () const
 Number of arguments. More...
 
const decStringGetArgument (int index) const
 Argument at index. More...
 
int IndexOfArgument (const char *argument) const
 Index of first matching argument or -1 if not found. More...
 
bool HasArgument (const char *argument) const
 Determine if argument exists. More...
 
void AddArgument (const char *argument)
 Add an argument. More...
 
void RemoveArgument (int index)
 Remove an argument from index. More...
 
void RemoveAllArguments ()
 Remove all arguments. More...
 
void AddArgsSplit (const char *commandLine)
 Add arguments parsed from a string command line. More...
 
Operators
deCmdLineArgsoperator= (const deCmdLineArgs &copy)
 Copy an argument list to this argument list. More...
 

Detailed Description

Command line arguments.

Basically wraps a string list with some additional helper methods.

Constructor & Destructor Documentation

◆ deCmdLineArgs() [1/2]

deCmdLineArgs::deCmdLineArgs ( )

Create a new command line object.

◆ deCmdLineArgs() [2/2]

deCmdLineArgs::deCmdLineArgs ( const deCmdLineArgs copy)

Create a copy of an argument list.

◆ ~deCmdLineArgs()

deCmdLineArgs::~deCmdLineArgs ( )

Clean up the command line object.

Member Function Documentation

◆ AddArgsSplit()

void deCmdLineArgs::AddArgsSplit ( const char *  commandLine)

Add arguments parsed from a string command line.

Arguments are considered separated by a white space. Quoted text strings are considered one argument.

Exceptions
deeInvalidParamcommandLine is NULL.

◆ AddArgument()

void deCmdLineArgs::AddArgument ( const char *  argument)

Add an argument.

Exceptions
deeInvalidParamargument is NULL.

◆ GetArgument()

const decString& deCmdLineArgs::GetArgument ( int  index) const

Argument at index.

Exceptions
deeInvalidParamindex is less than 0 or larger than GetCount()-1.

◆ GetCount()

int deCmdLineArgs::GetCount ( ) const

Number of arguments.

◆ HasArgument()

bool deCmdLineArgs::HasArgument ( const char *  argument) const

Determine if argument exists.

Exceptions
deeInvalidParamargument is NULL.

◆ IndexOfArgument()

int deCmdLineArgs::IndexOfArgument ( const char *  argument) const

Index of first matching argument or -1 if not found.

Exceptions
deeInvalidParamargument is NULL.

◆ operator=()

deCmdLineArgs& deCmdLineArgs::operator= ( const deCmdLineArgs copy)

Copy an argument list to this argument list.

◆ RemoveAllArguments()

void deCmdLineArgs::RemoveAllArguments ( )

Remove all arguments.

◆ RemoveArgument()

void deCmdLineArgs::RemoveArgument ( int  index)

Remove an argument from index.

Exceptions
deeInvalidParamindex is less than 0 or larger than GetCount()-1.

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