sl@0: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // Local CTestIniData class, derived from CIniData.lib sl@0: // sl@0: // sl@0: sl@0: #if !defined(__CTESTINIDATA_H__) sl@0: #define __CTESTINIDATA_H__ sl@0: sl@0: #include sl@0: sl@0: enum TTestIniPanic sl@0: { sl@0: ESectionNameTooBig, sl@0: EKeyNameTooBig, sl@0: }; sl@0: sl@0: class CTestIniData : public CBase sl@0: { sl@0: public: sl@0: // Constructor, pass in name of ini file to open sl@0: // Default search path is 'c:\system\data' on target filesystem sl@0: // ie. 'NewL(_L("c:\\system\\data\\ttools.ini"))' is equivalent sl@0: // to 'NewL(_L("ttools.ini"))' sl@0: static CTestIniData* NewL(const TDesC& aName); sl@0: virtual ~CTestIniData(); sl@0: sl@0: // Panic sl@0: void Panic(TTestIniPanic aPanic); sl@0: sl@0: // Read text value reguardless of section sl@0: // Returns: True(Success) or false(Failure) sl@0: TBool FindVar(const TDesC &aKeyName, // Key to look for sl@0: TPtrC &aResult); // Buffer to store value sl@0: sl@0: // Read integer value reguardless of section sl@0: // Returns: True(Success) or false(Failure) sl@0: TBool FindVar(const TDesC &aKeyName, // Key to look for sl@0: TInt &aResult); // Int ref to store result sl@0: sl@0: // Read text value under section sl@0: // Returns: True(Success) or false(Failure) sl@0: TBool FindVar(const TDesC &aSection, // Section to look under sl@0: const TDesC &aKeyName, // Key to look for sl@0: TPtrC &aResult); // Buffer to store result sl@0: sl@0: // Read integer value under section sl@0: // Returns: True(Success) or false(Failure) sl@0: TBool FindVar(const TDesC &aSection, // Section to look under sl@0: const TDesC &aKeyName, // Key to look for sl@0: TInt &aResult); // Int ref to store result sl@0: sl@0: protected: sl@0: CTestIniData(); sl@0: void ConstructL(const TDesC& aName); sl@0: private: sl@0: HBufC* iName; sl@0: HBufC* iToken; sl@0: TPtr iPtr; sl@0: }; sl@0: sl@0: #endif