|
||
class CCommandLineArguments : public CBase;
Parses command line arguments.
The class provides functions to access the arguments that are supplied when a program is launched as a new process.
The program name is returned as argument 0. Other arguments are returned as arguments 1, 2 etc.
The CCommandLineArguments::Count()const
function indicates how many arguments there are, including the program name. Arguments may be quoted to contain blanks and
quotes.
The command line arguments and process name occupy 256 characters each. In order to minimise the space used throughout the lifetime of a program, it is recommended that the program parse the arguments shortly after initialisation, save the argument values appropriately, and then destroy the CCommandLineArguments object.
The main use of this class is in parsing the arguments of WINC command-line utilities.
This class is not intended for user derivation
CBase
-
Base class for all classes to be instantiated on the heap.
CCommandLineArguments
- Parses command line arguments.
Defined in CCommandLineArguments
:
Arg(TInt)const
Returns a non-modifiable pointer descriptor representing the specified command-l...Count()const
Returns the number of command line arguments, including the program name.NewL()
Allocates and constructs a command line arguments parser. The function leaves if...NewLC()
Allocates and constructs a command line arguments parser, putting the returned p...~CCommandLineArguments()
Frees resources prior to destruction. Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.Extension_(TUint,TAny *&,TAny *)
Extension function operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...IMPORT_C static CCommandLineArguments* NewLC();
Allocates and constructs a command line arguments parser, putting the returned pointer onto the cleanup stack. The function leaves if there is insufficient memory.
|
IMPORT_C static CCommandLineArguments* NewL();
Allocates and constructs a command line arguments parser. The function leaves if there is insufficient memory.
|
IMPORT_C TPtrC Arg(TInt aArg) const;
Returns a non-modifiable pointer descriptor representing the specified command-line argument.
Arg(0) is the file name as specified on the command line. Arg(1), Arg(2) etc. are the arguments specified to the command.
The pointer descriptor is valid throughout the lifetime of the CCommandLineArguments object. If you wish to retain argument values after the CCommandLineArguments object is destroyed, you should copy the argument data into a different object.
|
|
IMPORT_C TInt Count() const;
Returns the number of command line arguments, including the program name.
|