epoc32/include/bacline.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
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@4
     4
// under the terms of "Eclipse Public License v1.0"
williamr@2
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.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
class CCommandLineArguments : public CBase
williamr@2
    25
/** Parses command line arguments.
williamr@2
    26
williamr@2
    27
The class provides functions to access the arguments that are supplied when 
williamr@2
    28
a program is launched as a new process. 
williamr@2
    29
williamr@2
    30
The program name is returned as argument 0. Other arguments are returned as 
williamr@2
    31
arguments 1, 2 etc. 
williamr@2
    32
williamr@2
    33
The Count() function indicates how many arguments there are, including the 
williamr@2
    34
program name. Arguments may be quoted to contain blanks and quotes.
williamr@2
    35
williamr@2
    36
The command line arguments and process name occupy 256 characters each. In 
williamr@2
    37
order to minimise the space used throughout the lifetime of a program, it 
williamr@2
    38
is recommended that the program parse the arguments shortly after initialisation, 
williamr@2
    39
save the argument values appropriately, and then destroy the CCommandLineArguments 
williamr@2
    40
object.
williamr@2
    41
williamr@2
    42
The main use of this class is in parsing the arguments of WINC command-line 
williamr@2
    43
utilities.
williamr@2
    44
williamr@2
    45
This class is not intended for user derivation 
williamr@2
    46
@publishedAll
williamr@2
    47
@released
williamr@2
    48
*/
williamr@2
    49
	{
williamr@2
    50
public:
williamr@2
    51
	// construct/destruct
williamr@2
    52
	IMPORT_C static CCommandLineArguments* NewLC();
williamr@2
    53
	IMPORT_C static CCommandLineArguments* NewL();
williamr@2
    54
	IMPORT_C ~CCommandLineArguments();
williamr@2
    55
	// extract
williamr@2
    56
	IMPORT_C TPtrC Arg(TInt aArg) const;
williamr@2
    57
	IMPORT_C TInt Count() const;
williamr@2
    58
private:
williamr@2
    59
	CCommandLineArguments();
williamr@2
    60
	void ConstructL();
williamr@2
    61
private:
williamr@2
    62
	CArrayFixFlat<TPtrC>* iArgs;
williamr@2
    63
	HBufC* iCommandLine;
williamr@2
    64
	TFileName iFileName;
williamr@2
    65
	};
williamr@2
    66
williamr@2
    67
#endif