1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/genericopenlibs/openenvcore/backend/inc/inidata.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,68 @@
1.4 +/*
1.5 +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +* Name : inidata.h
1.19 +* Part of : stdio server
1.20 +* To read inifile.
1.21 +*
1.22 +*
1.23 +*/
1.24 +
1.25 +
1.26 +
1.27 +#ifndef __INIDATA_H__
1.28 +#define __INIDATA_H__
1.29 +
1.30 + #include <e32base.h>
1.31 +
1.32 + class CIniData : public CBase
1.33 + /*
1.34 + *
1.35 + * @publishedPartner
1.36 + * @test
1.37 + *
1.38 + * Defines the interface to acess to ini data file
1.39 + *
1.40 + * The basic functions, FindVar(), SetValue(), AddValue() and WriteToFileL()
1.41 + * Compulsory to call WriteToFileL() after calling any SetValue() or AddValue()
1.42 + */
1.43 + {
1.44 + public:
1.45 + // Constructor, pass in name of ini file to open
1.46 + // Default search path is 'c:\system\data' on target filesystem
1.47 + // ie. 'NewL(_L("c:\\system\\data\\ttools.ini"))' is equivalent
1.48 + // to 'NewL(_L("ttools.ini"))'
1.49 + static CIniData* NewL(const TDesC& aName);
1.50 + virtual ~CIniData();
1.51 +
1.52 +
1.53 + TBool FindVar(const TDesC &aSection, // Section to look under
1.54 + const TDesC &aKeyName, // Key to look for
1.55 + TPtrC &aResult); // Buffer to store result
1.56 +
1.57 + TBool FindVar(const TDesC &aSection, // Section to look under
1.58 + const TDesC &aKeyName, // Key to look for
1.59 + TInt &aResult); // Int ref to store result
1.60 +
1.61 +
1.62 + protected:
1.63 + CIniData();
1.64 + void ConstructL(const TDesC& aName);
1.65 + private:
1.66 + HBufC* iName;
1.67 + HBufC* iToken;
1.68 + TPtr iPtr;
1.69 + };
1.70 +
1.71 +#endif /*__INIDATA_H__*/