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