epoc32/include/bacline.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@2
     4
// 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
     5
// which accompanies this distribution, and is available
williamr@2
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
//
williamr@2
    15
williamr@2
    16
#ifndef __BACLINE_H
williamr@2
    17
#define __BACLINE_H
williamr@2
    18
williamr@2
    19
#ifndef __E32BASE_H
williamr@2
    20
#include <e32base.h>
williamr@2
    21
#endif
williamr@2
    22
williamr@2
    23
/**
williamr@2
    24
Not available until Platform 003
williamr@2
    25
@internalComponent
williamr@2
    26
*/
williamr@2
    27
typedef TBuf<0x100> TBaCommand;
williamr@2
    28
williamr@2
    29
class CCommandLineArguments : public CBase
williamr@2
    30
/** Parses command line arguments.
williamr@2
    31
williamr@2
    32
The class provides functions to access the arguments that are supplied when 
williamr@2
    33
a program is launched as a new process. 
williamr@2
    34
williamr@2
    35
The program name is returned as argument 0. Other arguments are returned as 
williamr@2
    36
arguments 1, 2 etc. 
williamr@2
    37
williamr@2
    38
The Count() function indicates how many arguments there are, including the 
williamr@2
    39
program name. Arguments may be quoted to contain blanks and quotes.
williamr@2
    40
williamr@2
    41
The command line arguments and process name occupy 256 characters each. In 
williamr@2
    42
order to minimise the space used throughout the lifetime of a program, it 
williamr@2
    43
is recommended that the program parse the arguments shortly after initialisation, 
williamr@2
    44
save the argument values appropriately, and then destroy the CCommandLineArguments 
williamr@2
    45
object.
williamr@2
    46
williamr@2
    47
The main use of this class is in parsing the arguments of WINC command-line 
williamr@2
    48
utilities.
williamr@2
    49
williamr@2
    50
This class is not intended for user derivation 
williamr@2
    51
@publishedAll
williamr@2
    52
@released
williamr@2
    53
*/
williamr@2
    54
	{
williamr@2
    55
public:
williamr@2
    56
	// construct/destruct
williamr@2
    57
	IMPORT_C static CCommandLineArguments* NewLC();
williamr@2
    58
	IMPORT_C static CCommandLineArguments* NewL();
williamr@2
    59
	IMPORT_C ~CCommandLineArguments();
williamr@2
    60
	// extract
williamr@2
    61
	IMPORT_C TPtrC Arg(TInt aArg) const;
williamr@2
    62
	IMPORT_C TInt Count() const;
williamr@2
    63
private:
williamr@2
    64
	CCommandLineArguments();
williamr@2
    65
	void ConstructL();
williamr@2
    66
private:
williamr@2
    67
	CArrayFixFlat<TPtrC>* iArgs;
williamr@2
    68
	HBufC* iCommandLine;
williamr@2
    69
	TFileName iFileName;
williamr@2
    70
	};
williamr@2
    71
williamr@2
    72
#endif