First public contribution.
1 // Copyright (c) 2002-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\emptyext.cpp
15 // extension which simply records/prints out accesses to each function
22 class CEmptyExtProxyDrive : public CBaseExtProxyDrive
25 static CEmptyExtProxyDrive* NewL(CProxyDrive* aProxyDrive, CMountCB* aMount);
26 ~CEmptyExtProxyDrive();
28 virtual TInt Initialise();
29 virtual TInt Dismounted();
30 virtual TInt Enlarge(TInt aLength);
31 virtual TInt ReduceSize(TInt aPos, TInt aLength);
32 virtual TInt Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt anOffset);
33 virtual TInt Read(TInt64 aPos,TInt aLength,TDes8& aTrg);
34 virtual TInt Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt anOffset);
35 virtual TInt Write(TInt64 aPos,const TDesC8& aSrc);
36 virtual TInt Caps(TDes8& anInfo);
37 virtual TInt Format(TFormatInfo& anInfo);
39 CEmptyExtProxyDrive(CProxyDrive* aProxyDrive, CMountCB* aMount);
53 class CEmptyProxyDriveFactory : public CProxyDriveFactory
56 CEmptyProxyDriveFactory();
57 virtual TInt Install();
58 virtual CProxyDrive* NewProxyDriveL(CProxyDrive* aProxy,CMountCB* aMount);
61 CEmptyExtProxyDrive* CEmptyExtProxyDrive::NewL(CProxyDrive* aProxyDrive, CMountCB* aMount)
66 CEmptyExtProxyDrive* temp=new(ELeave) CEmptyExtProxyDrive(aProxyDrive,aMount);
71 CEmptyExtProxyDrive::CEmptyExtProxyDrive(CProxyDrive* aProxyDrive, CMountCB* aMount):CBaseExtProxyDrive(aProxyDrive,aMount)
73 RDebug::Print(_L("CEmptyExtProxyDrive::CEmptyExtProxyDrive"));
76 CEmptyExtProxyDrive::~CEmptyExtProxyDrive()
81 // print out the figures obtained
82 RDebug::Print(_L("Initialise = %d"),iInitialise);
83 RDebug::Print(_L("Dismounted = %d"),iDismounted);
84 RDebug::Print(_L("Enlarge = %d"),iEnlarge);
85 RDebug::Print(_L("ReduceSize = %d"),iReduceSize);
86 RDebug::Print(_L("Read Thread = %d"),iReadThread);
87 RDebug::Print(_L("Read = %d"),iRead);
88 RDebug::Print(_L("Write Thread = %d"),iWriteThread);
89 RDebug::Print(_L("Write = %d"),iWrite);
90 RDebug::Print(_L("Format = %d"),iFormat);
93 TInt CEmptyExtProxyDrive::Initialise()
98 RDebug::Print(_L("CEmptyExtProxyDrive::Initialise()"));
100 return(CBaseExtProxyDrive::Initialise());
103 TInt CEmptyExtProxyDrive::Dismounted()
108 RDebug::Print(_L("CEmptyExtProxyDrive::Dismounted()"));
110 return(CBaseExtProxyDrive::Dismounted());
113 TInt CEmptyExtProxyDrive::Enlarge(TInt aLength)
119 return(CBaseExtProxyDrive::Enlarge(aLength));
123 TInt CEmptyExtProxyDrive::ReduceSize(TInt aPos, TInt aLength)
129 return(CBaseExtProxyDrive::ReduceSize(aPos,aLength));
132 TInt CEmptyExtProxyDrive::Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt anOffset)
138 return(CBaseExtProxyDrive::Read(aPos,aLength,aTrg,aThreadHandle,anOffset));
141 TInt CEmptyExtProxyDrive::Read(TInt64 aPos,TInt aLength,TDes8& aTrg)
147 return(CBaseExtProxyDrive::Read(aPos,aLength,aTrg));
150 TInt CEmptyExtProxyDrive::Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt anOffset)
156 return(CBaseExtProxyDrive::Write(aPos,aLength,aSrc,aThreadHandle,anOffset));
159 TInt CEmptyExtProxyDrive::Write(TInt64 aPos,const TDesC8& aSrc)
165 return(CBaseExtProxyDrive::Write(aPos,aSrc));
168 TInt CEmptyExtProxyDrive::Caps(TDes8& anInfo)
174 return(CBaseExtProxyDrive::Caps(anInfo));
177 TInt CEmptyExtProxyDrive::Format(TFormatInfo& anInfo)
183 return(CBaseExtProxyDrive::Format(anInfo));
187 CEmptyProxyDriveFactory::CEmptyProxyDriveFactory()
192 RDebug::Print(_L("CEmptyProxyDriveFactory::CEmptyProxyDriveFactory"));
195 TInt CEmptyProxyDriveFactory::Install()
200 _LIT(KEmptyName,"Empty");
201 return(SetName(&KEmptyName));
204 CProxyDrive* CEmptyProxyDriveFactory::NewProxyDriveL(CProxyDrive* aProxy,CMountCB* aMount)
209 return(CEmptyExtProxyDrive::NewL(aProxy,aMount));
214 EXPORT_C CProxyDriveFactory* CreateFileSystem()
216 // Create a new file system
219 return(new CEmptyProxyDriveFactory());