diff -r a828660c511c -r d3d7683d16f5 wlanapitest/wlanhaitest/common/inc/DataWrapperBase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanapitest/wlanhaitest/common/inc/DataWrapperBase.h Wed Sep 01 12:41:05 2010 +0100 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef DATA_WRAPPER_BASE_H +#define DATA_WRAPPER_BASE_H + +// EPOC includes +#include +#define SECS_TO_MS(x) (x*1000000) + +_LIT(KConsname, "Test Console"); + +class CDataWrapperBase : public CDataWrapper + { +public: + class TEnumEntryTable + { + public: + const TDesC& iString; + TInt iValue; + }; + +public: + TBool GetBoolFromConfig(const TDesC& aSectName,const TDesC& aKeyName,TBool& aResult); + TBool GetIntFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TInt& aResult); + TBool GetStringFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TPtrC& aResult); + TBool GetHexFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TInt& aResult); + TBool GetUintFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TUint& aResult); + TBool KeyPress(); + void Timedelay(TInt aTimeoutInSecs); + virtual void InitialiseL(); + inline RFs& FileServer() { return iFs; } + inline CConsoleBase* GetConsole() { return(Console::NewL(KConsname,TSize(KConsFullScreen,KConsFullScreen)));} + void GetValidationBool(const TDesC& aSection, TInt aValue, TBool aForceValidation, const TDesC& aErrorMessage); + void GetValidationInt(const TDesC& aSection, TInt aValue, TBool aForceValidation, const TDesC& aErrorMessage); + void GetValidationUint(const TDesC& aSection, TInt aValue, TBool aForceValidation, const TDesC& aErrorMessage); + TBool GetArrayFromConfig(const TDesC& aSectName, const TDesC& aKeyName, RPointerArray& aResult); + TBool GetEnumFromConfig(const TDesC& aSectName, const TDesC& aKeyName, const TEnumEntryTable* aTable, TInt& aResult); + +protected: + CDataWrapperBase(); + virtual ~CDataWrapperBase(); + +private: + TBool GetCommandStringParameterL(const TDesC& aSectName, const TDesC& aKeyName, TPtrC& aResult); + TBool KeyCheck(); + +private: + // Included ini files + RPointerArray iInclude; + RPointerArray iBuffer; + RFs iFs; + RTimer iTimer; + }; + +#endif // DATA_WRAPPER_BASE_H