os/mm/mmapitest/devsoundhaitest/common/inc/DataWrapperBase.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 *
    16 */
    17 
    18 
    19 
    20 #ifndef DATA_WRAPPER_BASE_H
    21 #define DATA_WRAPPER_BASE_H
    22 
    23 //	EPOC includes
    24 #include <datawrapper.h>
    25 #define SECS_TO_MS(x)  (x*1000000)
    26 
    27 _LIT(KConsname,				"Test Console");
    28 
    29 class CDataWrapperBase : public CDataWrapper
    30 	{
    31 public:
    32 	class TEnumEntryTable
    33 		{
    34 	public:
    35 		const TDesC&	iString;
    36 		TInt			iValue;
    37 		};
    38 
    39 public:
    40 	TBool					GetBoolFromConfig(const TDesC& aSectName,const TDesC& aKeyName,TBool& aResult);
    41 	TBool					GetIntFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TInt& aResult);
    42 	TBool GetRealFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TReal& aResult);
    43 	TBool					GetStringFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TPtrC& aResult);
    44 	TBool					GetHexFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TInt& aResult);
    45 	TBool					GetUintFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TUint& aResult);
    46 	TBool					GetArrayRectFromConfig(const TDesC& aSectName, const TDesC& aKeyName, RPointerArray<HBufC>& aResult);
    47 	TBool 					KeyPress();
    48 	void 					Timedelay(TInt aTimeoutInSecs);
    49 	virtual void			InitialiseL();
    50 	inline RFs&				FileServer() { return iFs; }
    51 	inline CConsoleBase*	GetConsole() { return(Console::NewL(KConsname,TSize(KConsFullScreen,KConsFullScreen)));}
    52 	TBool					GetEnumFromConfig(const TDesC& aSectName, const TDesC& aKeyName, const TEnumEntryTable* aTable, TInt& aResult);
    53 
    54 protected:
    55 	CDataWrapperBase();
    56 	virtual ~CDataWrapperBase();
    57 
    58 private:
    59 	TBool	GetCommandStringParameterL(const TDesC& aSectName, const TDesC& aKeyName, TPtrC& aResult);
    60 	TBool 	KeyCheck();
    61 
    62 private:
    63 	// Included ini files
    64 	RPointerArray<CIniData>	iInclude;
    65 	RPointerArray<HBufC>	iBuffer;
    66 	RFs                     iFs;
    67 	RTimer					iTimer;
    68 	};
    69 
    70 #endif // DATA_WRAPPER_BASE_H