usbmgmt/usbmgr/inifile/inc/inifile.h
changeset 0 c9bc50fca66e
equal deleted inserted replaced
-1:000000000000 0:c9bc50fca66e
       
     1 /*
       
     2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    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__