First public contribution.
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
19 #ifndef DATA_WRAPPER_BASE_H
20 #define DATA_WRAPPER_BASE_H
23 #include <test/datawrapper.h>
24 #define SECS_TO_MS(x) (x*1000000)
26 _LIT(KConsname, "Test Console");
28 #define GETFROMCONFIGOPTIONAL(aType, aSectName, aKeyName, aResult, aLogMessage) \
29 if ( !Get##aType##FromConfig(aSectName, aKeyName, aResult) ) \
31 WARN_PRINTF3(aLogMessage, &aKeyName, aResult); \
34 #define GETFROMCONFIGMANDATORY(aType, aSectName, aKeyName, aResult, aLogMessage, aDataOk) \
35 if ( !Get##aType##FromConfig(aSectName, aKeyName, aResult) ) \
37 ERR_PRINTF2(aLogMessage, &aKeyName); \
38 SetBlockResult(EFail); \
42 #define GETSTRINGFROMCONFIGOPTIONAL(aSectName, aKeyName, aResult, aLogMessage) \
43 if ( !GetStringFromConfig(aSectName, aKeyName, aResult) ) \
45 WARN_PRINTF3(aLogMessage, &aKeyName, &aResult); \
48 #define GETSTRINGFROMCONFIGMANDATORY(aSectName, aKeyName, aResult, aLogMessage, aDataOk) \
49 if ( !GetStringFromConfig(aSectName, aKeyName, aResult) ) \
51 ERR_PRINTF2(aLogMessage, &aKeyName); \
52 SetBlockResult(EFail); \
56 class CDataWrapperBase : public CDataWrapper
67 TBool GetBoolFromConfig(const TDesC& aSectName,const TDesC& aKeyName,TBool& aResult);
68 TBool GetIntFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TInt& aResult);
69 TBool GetStringFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TPtrC& aResult);
70 TBool GetHexFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TInt& aResult);
71 TBool GetUintFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TUint& aResult);
72 TBool GetArrayRectFromConfig(const TDesC& aSectName, const TDesC& aKeyName, RPointerArray<HBufC>& aResult);
73 TBool GetEnumFromConfig(const TDesC& aSectName, const TDesC& aKeyName, const TEnumEntryTable* aTable, TInt& aResult);
75 void Timedelay(TInt aTimeoutInSecs);
76 virtual void InitialiseL();
77 inline RFs& FileServer() { return iFs; }
78 inline CConsoleBase* GetConsoleL() { return(Console::NewL(KConsname,TSize(KConsFullScreen,KConsFullScreen)));}
82 virtual ~CDataWrapperBase();
85 TBool GetCommandStringParameterL(const TDesC& aSectName, const TDesC& aKeyName, TPtrC& aResult);
90 RPointerArray<CIniData> iInclude;
91 RPointerArray<HBufC> iBuffer;
96 #endif // DATA_WRAPPER_BASE_H