os/ossrv/lowlevellibsandfws/apputils/bsul/test/t_iniparser/LegacyParser.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // INIFILE.H
    15 // Declares the class CIniFile for accessing ini file.
    16 // 
    17 //
    18 
    19 /**
    20  @file
    21 */
    22 
    23 #ifndef INIFILE_H__
    24 #define INIFILE_H__
    25 
    26 #include <e32base.h>
    27 
    28 class CIniFile : public CBase 
    29 	{
    30 public:
    31 	enum TIniPanic
    32 		{
    33 		ESectionNameTooBig,
    34 		EVarNameTooBig
    35 		};
    36 
    37 public:
    38 	static CIniFile* NewL(const TDesC& aName);
    39 	static CIniFile* NewL(const TDesC& aName, const TDesC& aPath);
    40 	virtual ~CIniFile();
    41 
    42 public:
    43 	TBool FindVar(const TDesC &aSection, const TDesC &aVarName, TPtrC &aResult);
    44 	TBool FindVar(const TDesC &aSection, const TDesC &aVarName, TInt &aResult);
    45 
    46 private:
    47 	CIniFile();
    48 	void ConstructL(const TDesC& aName, const TDesC& aPath);
    49 
    50 private: // utility
    51 	void Panic(TIniPanic aPanic);
    52 
    53 protected: // owned
    54 	HBufC* iName; // full name of ini file
    55 	HBufC* iToken;
    56 	TPtr iPtr;
    57 	};
    58 
    59 #endif // INIFILE_H__