os/persistentdata/persistentstorage/dbms/SPConv/cn_cmdparse.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200 (2014-06-10)
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// CCommandLineArguments class
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
#ifndef __CN_CMDPARSE_H__
sl@0
    19
#define __CN_CMDPARSE_H__
sl@0
    20
sl@0
    21
#include <e32base.h>
sl@0
    22
sl@0
    23
/* Parses command line arguments.
sl@0
    24
sl@0
    25
The class provides functions to access the arguments that are supplied when 
sl@0
    26
a program is launched as a new process. 
sl@0
    27
sl@0
    28
The program name is returned as argument 0. Other arguments are returned as 
sl@0
    29
arguments 1, 2 etc. 
sl@0
    30
sl@0
    31
The Count() function indicates how many arguments there are, including the 
sl@0
    32
program name. Arguments may be quoted to contain blanks and quotes.
sl@0
    33
sl@0
    34
The command line arguments and process name occupy 256 characters each. In 
sl@0
    35
order to minimise the space used throughout the lifetime of a program, it 
sl@0
    36
is recommended that the program parse the arguments shortly after initialisation, 
sl@0
    37
save the argument values appropriately, and then destroy the CCommandLineArguments 
sl@0
    38
object.
sl@0
    39
sl@0
    40
The main use of this class is in parsing the arguments of command-line 
sl@0
    41
utilities. 
sl@0
    42
@internalComponent
sl@0
    43
*/
sl@0
    44
class CCommandLineArguments : public CBase
sl@0
    45
	{
sl@0
    46
public:
sl@0
    47
	static CCommandLineArguments* NewLC();
sl@0
    48
	static CCommandLineArguments* NewL();
sl@0
    49
	virtual ~CCommandLineArguments();
sl@0
    50
	TPtrC Arg(TInt aArg) const;
sl@0
    51
	TInt Count() const;
sl@0
    52
sl@0
    53
private:
sl@0
    54
	inline CCommandLineArguments();
sl@0
    55
	void ConstructL();
sl@0
    56
sl@0
    57
private:
sl@0
    58
	CArrayFixFlat<TPtrC>* iArgs;
sl@0
    59
	HBufC* iCommandLine;
sl@0
    60
	TFileName iFileName;
sl@0
    61
sl@0
    62
	};
sl@0
    63
sl@0
    64
#endif//__CN_CMDPARSE_H__