wlanapitest/wlanhaitest/common/inc/DataWrapperBase.h
branchRCL_3
changeset 18 d3d7683d16f5
parent 0 c40eb8fe8501
equal deleted inserted replaced
17:a828660c511c 18:d3d7683d16f5
       
     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					GetStringFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TPtrC& aResult);
       
    43 	TBool					GetHexFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TInt& aResult);
       
    44 	TBool					GetUintFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TUint& aResult);
       
    45 	TBool 					KeyPress();
       
    46 	void 					Timedelay(TInt aTimeoutInSecs);
       
    47 	virtual void			InitialiseL();
       
    48 	inline RFs&				FileServer() { return iFs; }
       
    49 	inline CConsoleBase*	GetConsole() { return(Console::NewL(KConsname,TSize(KConsFullScreen,KConsFullScreen)));}
       
    50 	void 					GetValidationBool(const TDesC& aSection, TInt aValue, TBool aForceValidation, const TDesC& aErrorMessage);
       
    51 	void    				GetValidationInt(const TDesC& aSection, TInt aValue, TBool aForceValidation, const TDesC& aErrorMessage);
       
    52 	void 					GetValidationUint(const TDesC& aSection, TInt aValue, TBool aForceValidation, const TDesC& aErrorMessage);
       
    53 	TBool					GetArrayFromConfig(const TDesC& aSectName, const TDesC& aKeyName, RPointerArray<HBufC>& aResult);
       
    54 	TBool					GetEnumFromConfig(const TDesC& aSectName, const TDesC& aKeyName, const TEnumEntryTable* aTable, TInt& aResult);
       
    55 	
       
    56 protected:
       
    57 	CDataWrapperBase();
       
    58 	virtual ~CDataWrapperBase();
       
    59 
       
    60 private:
       
    61 	TBool	GetCommandStringParameterL(const TDesC& aSectName, const TDesC& aKeyName, TPtrC& aResult);
       
    62 	TBool 	KeyCheck();
       
    63 
       
    64 private:
       
    65 	// Included ini files
       
    66 	RPointerArray<CIniData>	iInclude;
       
    67 	RPointerArray<HBufC>	iBuffer;
       
    68 	RFs                     iFs;
       
    69 	RTimer					iTimer;
       
    70 	};
       
    71 
       
    72 #endif // DATA_WRAPPER_BASE_H