Update contrib.
1 // Copyright (c) 2005-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 the License "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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // f32test\ext\t_testext.h
18 #ifndef __TEST_EXT_H__
19 #define __TEST_EXT_H__
23 //#define TESTEXT_DEBUG
25 #if (defined(_DEBUG) || defined(_DEBUG_RELEASE)) && defined(TESTEXT_DEBUG)
26 #define __PRINT(t) {RDebug::Print(t);}
27 #define __PRINT1(t,a) {RDebug::Print(t,a);}
28 #define __PRINT2(t,a,b) {RDebug::Print(t,a,b);}
32 #define __PRINT2(t,a,b)
35 #define EExtCustom (KMaxTInt/2)
39 This is the test proxy drive extension base class.
40 Test proxy drives of specific file system should derive from this base class.
43 class CTestProxyDrive : public CBaseExtProxyDrive
48 ESetEvent = EExtCustom,
54 ETestCmdEnd = EExtCustom + 100
58 ENone, ENext, EDeterministic, ERandom
62 CTestProxyDrive(CProxyDrive* aProxyDrive, CMountCB* aMount);
63 virtual ~CTestProxyDrive();
66 // Derived functions from CBaseExtProxyDrive
67 // Commented out because they are not changed. Sub-classes reimplement them
69 // virtual TInt Initialise();
70 // virtual TInt Dismounted();
71 // virtual TInt Enlarge(TInt aLength);
72 // virtual TInt ReduceSize(TInt aPos, TInt aLength);
73 // virtual TInt Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt aOffset,TInt aFlags);
74 // virtual TInt Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt anOffset);
75 // virtual TInt Read(TInt64 aPos,TInt aLength,TDes8& aTrg);
76 // virtual TInt Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt aOffset,TInt aFlags);
77 // virtual TInt Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt anOffset);
78 // virtual TInt Write(TInt64 aPos,const TDesC8& aSrc);
79 // virtual TInt Caps(TDes8& anInfo);
80 // virtual TInt Format(TFormatInfo& anInfo);
81 // virtual TInt Format(TInt64 aPos,TInt aLength);
82 // virtual TInt SetMountInfo(const TDesC8* aMountInfo,TInt aMountInfoThreadHandle=KCurrentThreadHandle);
83 // virtual TInt ForceRemount(TUint aFlags=0);
84 // virtual TInt Unlock(TMediaPassword &aPassword, TBool aStorePassword);
85 // virtual TInt Lock(TMediaPassword &aOldPassword, TMediaPassword &aNewPassword, TBool aStorePassword);
86 // virtual TInt Clear(TMediaPassword &aPassword);
87 // virtual TInt ErasePassword();
88 virtual TInt ControlIO(const RMessagePtr2& aMessage,TInt aCommand,TAny* aParam1,TAny* aParam2);
89 virtual TInt GetLastErrorInfo(TDes8& aErrorInfo);
93 Return a pointer to a specified interface extension - to allow future extension of this class without breaking
95 @param aInterfaceId Interface identifier of the interface to be retrieved.
96 @param aInterface A reference to a pointer that retrieves the specified interface.
97 @param aInput An arbitrary input argument.
98 @return KErrNone If the interface is supported, KErrNotSupported otherwise.
100 // virtual TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput);
104 TInt SetEvent(TInt aType, TInt aValue);
105 TInt Mark(TInt aSector);
106 TInt Unmark(TInt aSector);
108 TBool IsMarked(TInt aSector) const;
109 TBool CheckEvent(TInt64 aPos, TInt aLength);
110 virtual void DoInitL() = 0;
111 virtual TBool DoCheckEvent(TInt64 aPos, TInt aLength) = 0;
112 virtual TInt DoControlIO(const RMessagePtr2& aMessage,TInt aCommand,TAny* aParam1,TAny* aParam2) = 0;
115 CMountCB* iMount; // in CProxyDrive
118 TBool iMountInitialised;
122 TErrorInfo::TReasonCode iLastErrorReason;