os/graphics/windowing/windowserver/test/t_genericplugin/inc/t_cinidata.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 /**
    17  @file
    18  @test
    19  @internalComponent
    20 */
    21 
    22 #ifndef __CINIDATA_H__
    23 #define __CINIDATA_H__
    24 
    25 #include <e32base.h>
    26 
    27 class CIniData : public CBase 
    28 /**
    29  *
    30  * @publishedPartner
    31  * @test
    32  *
    33  * Defines the interface to acess to ini data file
    34  *
    35  * The basic functions, FindVar(), SetValue(), AddValue() and WriteToFileL()
    36  * Compulsory to call WriteToFileL() after calling any SetValue() or AddValue()
    37  */
    38 	{
    39 public:
    40 	// Constructor, pass in name of ini file to open
    41 	// Default search path is 'c:\system\data' on target filesystem
    42 	// ie. 'NewL(_L("c:\\system\\data\\ttools.ini"))' is equivalent
    43 	// to 'NewL(_L("ttools.ini"))'
    44 	static CIniData* NewL(const TDesC& aName, char aDelimiter);
    45 	virtual ~CIniData();
    46 
    47 	TBool FindVar(const TDesC& aKeyName,	// Key to look for
    48 				  TPtrC& aResult);			// Buffer to store value
    49 
    50 	TBool FindVar(const TDesC& aKeyName, 	// Key to look for
    51 	    		  TInt& aResult);			// Int ref to store result
    52 
    53 	TBool FindVar(const TDesC& aSection,	// Section to look under
    54 			      const TDesC& aKeyName,	// Key to look for
    55 				  TPtrC& aResult);			// Buffer to store result
    56 
    57 	TBool FindVar(const TDesC& aSection,	// Section to look under
    58 				  const TDesC& aKeyName,	// Key to look for
    59 				  TInt& aResult);			// Int ref to store result
    60 protected:
    61 	CIniData();
    62 	void ConstructL(const TDesC& aName, char aDelimiter);
    63 private:
    64 	HBufC* iName;
    65 	HBufC* iToken;
    66 	TPtr iPtr;
    67 	char iDelimiter;
    68 	};
    69 
    70 #endif