Update contrib.
1 // Copyright (c) 2006-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\testfsys\t_tfsys3.cpp
21 const TInt KMajorVersionNumber=1;
22 const TInt KMinorVersionNumber=0;
24 CTestFileSystem::CTestFileSystem()
29 __DECLARE_NAME(_S("CTestFileSystem3"));
32 CTestFileSystem::~CTestFileSystem()
38 TInt CTestFileSystem::Install()
40 // Install the file system
43 iVersion=TVersion(KMajorVersionNumber,KMinorVersionNumber,KF32BuildVersionNumber);
44 TPtrC name=_L("Test3");
45 return(SetName(&name));
48 CMountCB* CTestFileSystem::NewMountL() const
50 // Create a new mount control block
53 return (new(ELeave) CTestMountCB);
56 CFileCB* CTestFileSystem::NewFileL() const
61 return (new(ELeave) CTestFileCB);
64 CDirCB* CTestFileSystem::NewDirL() const
66 // create a new directory lister
69 return (new(ELeave) CTestDirCB);
72 CFormatCB* CTestFileSystem::NewFormatL() const
74 // Create a new media formatter
77 return (new(ELeave) CTestFormatCB);
80 TInt CTestFileSystem::DefaultPath(TDes& aPath) const
82 // Return the intial default path
91 Reports whether the specified interface is supported - if it is,
92 the supplied interface object is modified to it
94 @param aInterfaceId The interface of interest
95 @param aInterface The interface object
96 @return KErrNone if the interface is supported, otherwise KErrNotFound
98 @see CFileSystem::GetInterface()
100 TInt CTestFileSystem::GetInterface(TInt aInterfaceId, TAny*& aInterface,TAny* aInput)
104 case CFileSystem::EProxyDriveSupport: // The FAT Filesystem supports proxy drives
108 return(CFileSystem::GetInterface(aInterfaceId, aInterface, aInput));
112 CFileSystem* CTestFileSystem::NewL()
117 CFileSystem* testFSys = new(ELeave) CTestFileSystem;
122 CTestMountCB::CTestMountCB(){};
123 CTestMountCB::~CTestMountCB(){};
124 CTestDirCB::CTestDirCB(){};
125 CTestDirCB::~CTestDirCB(){};
126 CTestFileCB::CTestFileCB(){};
127 CTestFileCB::~CTestFileCB(){};
128 CTestFormatCB::CTestFormatCB(){};
129 CTestFormatCB::~CTestFormatCB(){};
134 EXPORT_C CFileSystem* CreateFileSystem()
136 // Create a new file system
139 return(CTestFileSystem::NewL());
143 TInt CTestMountCB::ClusterSize() const
145 return KTestClusterSize;
148 TInt CTestMountCB::SubType(TDes& aName) const
150 if(aName.MaxLength() < 12)
153 aName = _L("Test3SubType");
157 TInt CTestMountCB::GetInterface(TInt aInterfaceId, TAny*& aInterface,TAny* aInput)
161 case (CMountCB::EGetFileSystemSubType):
163 aInterface = (MFileSystemSubType*) (this);
166 case (CMountCB::EGetClusterSize):
168 aInterface = (MFileSystemClusterSize*) (this);
173 return(CMountCB::GetInterface(aInterfaceId, aInterface, aInput));