sl@0: /* sl@0: * Copyright (c) 2007-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: * Name : inidata.h sl@0: * Part of : stdio server sl@0: * To read inifile. sl@0: * sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: #ifndef __INIDATA_H__ sl@0: #define __INIDATA_H__ sl@0: sl@0: #include sl@0: sl@0: class CIniData : public CBase sl@0: /* sl@0: * sl@0: * @publishedPartner sl@0: * @test sl@0: * sl@0: * Defines the interface to acess to ini data file sl@0: * sl@0: * The basic functions, FindVar(), SetValue(), AddValue() and WriteToFileL() sl@0: * Compulsory to call WriteToFileL() after calling any SetValue() or AddValue() sl@0: */ 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 CIniData* NewL(const TDesC& aName); sl@0: virtual ~CIniData(); sl@0: sl@0: 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: 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: sl@0: protected: sl@0: CIniData(); 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 /*__INIDATA_H__*/