1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/f32test/testfsys/t_tfsys3.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,176 @@
1.4 +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// f32test\testfsys\t_tfsys3.cpp
1.18 +//
1.19 +//
1.20 +
1.21 +#include "t_tfsys3.h"
1.22 +
1.23 +
1.24 +const TInt KMajorVersionNumber=1;
1.25 +const TInt KMinorVersionNumber=0;
1.26 +
1.27 +CTestFileSystem::CTestFileSystem()
1.28 +//
1.29 +// Constructor
1.30 +//
1.31 + {
1.32 + __DECLARE_NAME(_S("CTestFileSystem3"));
1.33 + }
1.34 +
1.35 +CTestFileSystem::~CTestFileSystem()
1.36 +//
1.37 +// Destructor
1.38 +//
1.39 + {}
1.40 +
1.41 +TInt CTestFileSystem::Install()
1.42 +//
1.43 +// Install the file system
1.44 +//
1.45 + {
1.46 + iVersion=TVersion(KMajorVersionNumber,KMinorVersionNumber,KF32BuildVersionNumber);
1.47 + TPtrC name=_L("Test3");
1.48 + return(SetName(&name));
1.49 + }
1.50 +
1.51 +CMountCB* CTestFileSystem::NewMountL() const
1.52 +//
1.53 +// Create a new mount control block
1.54 +//
1.55 + {
1.56 + return (new(ELeave) CTestMountCB);
1.57 + }
1.58 +
1.59 +CFileCB* CTestFileSystem::NewFileL() const
1.60 +//
1.61 +// Create a new file
1.62 +//
1.63 + {
1.64 + return (new(ELeave) CTestFileCB);
1.65 + }
1.66 +
1.67 +CDirCB* CTestFileSystem::NewDirL() const
1.68 +//
1.69 +// create a new directory lister
1.70 +//
1.71 + {
1.72 + return (new(ELeave) CTestDirCB);
1.73 + }
1.74 +
1.75 +CFormatCB* CTestFileSystem::NewFormatL() const
1.76 +//
1.77 +// Create a new media formatter
1.78 +//
1.79 + {
1.80 + return (new(ELeave) CTestFormatCB);
1.81 + }
1.82 +
1.83 +TInt CTestFileSystem::DefaultPath(TDes& aPath) const
1.84 +//
1.85 +// Return the intial default path
1.86 +//
1.87 + {
1.88 + aPath=_L("C:\\");
1.89 + return (KErrNone);
1.90 + }
1.91 +
1.92 +
1.93 +/**
1.94 +Reports whether the specified interface is supported - if it is,
1.95 +the supplied interface object is modified to it
1.96 +
1.97 +@param aInterfaceId The interface of interest
1.98 +@param aInterface The interface object
1.99 +@return KErrNone if the interface is supported, otherwise KErrNotFound
1.100 +
1.101 +@see CFileSystem::GetInterface()
1.102 +*/
1.103 +TInt CTestFileSystem::GetInterface(TInt aInterfaceId, TAny*& aInterface,TAny* aInput)
1.104 + {
1.105 + switch(aInterfaceId)
1.106 + {
1.107 + case CFileSystem::EProxyDriveSupport: // The FAT Filesystem supports proxy drives
1.108 + return KErrNone;
1.109 +
1.110 + default:
1.111 + return(CFileSystem::GetInterface(aInterfaceId, aInterface, aInput));
1.112 + }
1.113 + }
1.114 +
1.115 +CFileSystem* CTestFileSystem::NewL()
1.116 +//
1.117 +//
1.118 +//
1.119 + {
1.120 + CFileSystem* testFSys = new(ELeave) CTestFileSystem;
1.121 + return testFSys;
1.122 + }
1.123 +
1.124 +
1.125 +CTestMountCB::CTestMountCB(){};
1.126 +CTestMountCB::~CTestMountCB(){};
1.127 +CTestDirCB::CTestDirCB(){};
1.128 +CTestDirCB::~CTestDirCB(){};
1.129 +CTestFileCB::CTestFileCB(){};
1.130 +CTestFileCB::~CTestFileCB(){};
1.131 +CTestFormatCB::CTestFormatCB(){};
1.132 +CTestFormatCB::~CTestFormatCB(){};
1.133 +
1.134 +
1.135 +extern "C" {
1.136 +
1.137 +EXPORT_C CFileSystem* CreateFileSystem()
1.138 +//
1.139 +// Create a new file system
1.140 +//
1.141 + {
1.142 + return(CTestFileSystem::NewL());
1.143 + }
1.144 +}
1.145 +
1.146 +TInt CTestMountCB::ClusterSize() const
1.147 + {
1.148 + return KTestClusterSize;
1.149 + }
1.150 +
1.151 +TInt CTestMountCB::SubType(TDes& aName) const
1.152 + {
1.153 + if(aName.MaxLength() < 12)
1.154 + return KErrArgument;
1.155 +
1.156 + aName = _L("Test3SubType");
1.157 + return KErrNone;
1.158 + }
1.159 +
1.160 +TInt CTestMountCB::GetInterface(TInt aInterfaceId, TAny*& aInterface,TAny* aInput)
1.161 + {
1.162 + switch(aInterfaceId)
1.163 + {
1.164 + case (CMountCB::EGetFileSystemSubType):
1.165 + {
1.166 + aInterface = (MFileSystemSubType*) (this);
1.167 + return KErrNone;
1.168 + }
1.169 + case (CMountCB::EGetClusterSize):
1.170 + {
1.171 + aInterface = (MFileSystemClusterSize*) (this);
1.172 + return KErrNone;
1.173 + }
1.174 + default:
1.175 + {
1.176 + return(CMountCB::GetInterface(aInterfaceId, aInterface, aInput));
1.177 + }
1.178 + }
1.179 + }