williamr@2: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: #ifndef __BACLINE_H williamr@2: #define __BACLINE_H williamr@2: williamr@2: #ifndef __E32BASE_H williamr@2: #include williamr@2: #endif williamr@2: williamr@2: /** williamr@2: Not available until Platform 003 williamr@2: @internalComponent williamr@2: */ williamr@2: typedef TBuf<0x100> TBaCommand; williamr@2: williamr@2: class CCommandLineArguments : public CBase williamr@2: /** Parses command line arguments. williamr@2: williamr@2: The class provides functions to access the arguments that are supplied when williamr@2: a program is launched as a new process. williamr@2: williamr@2: The program name is returned as argument 0. Other arguments are returned as williamr@2: arguments 1, 2 etc. williamr@2: williamr@2: The Count() function indicates how many arguments there are, including the williamr@2: program name. Arguments may be quoted to contain blanks and quotes. williamr@2: williamr@2: The command line arguments and process name occupy 256 characters each. In williamr@2: order to minimise the space used throughout the lifetime of a program, it williamr@2: is recommended that the program parse the arguments shortly after initialisation, williamr@2: save the argument values appropriately, and then destroy the CCommandLineArguments williamr@2: object. williamr@2: williamr@2: The main use of this class is in parsing the arguments of WINC command-line williamr@2: utilities. williamr@2: williamr@2: This class is not intended for user derivation williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: { williamr@2: public: williamr@2: // construct/destruct williamr@2: IMPORT_C static CCommandLineArguments* NewLC(); williamr@2: IMPORT_C static CCommandLineArguments* NewL(); williamr@2: IMPORT_C ~CCommandLineArguments(); williamr@2: // extract williamr@2: IMPORT_C TPtrC Arg(TInt aArg) const; williamr@2: IMPORT_C TInt Count() const; williamr@2: private: williamr@2: CCommandLineArguments(); williamr@2: void ConstructL(); williamr@2: private: williamr@2: CArrayFixFlat* iArgs; williamr@2: HBufC* iCommandLine; williamr@2: TFileName iFileName; williamr@2: }; williamr@2: williamr@2: #endif