|
1 /* |
|
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "T_TestFSY.h" |
|
19 |
|
20 /*@{*/ |
|
21 _LIT(KDefaultPath, "C:\\"); |
|
22 /*@}*/ |
|
23 |
|
24 CTestFileSystem::CTestFileSystem() |
|
25 // |
|
26 // Constructor |
|
27 // |
|
28 { |
|
29 } |
|
30 |
|
31 CMountCB* CTestFileSystem::NewMountL() const |
|
32 // |
|
33 // Create a new mount control block |
|
34 // |
|
35 { |
|
36 return (new(ELeave) CTestMountCB); |
|
37 } |
|
38 |
|
39 CFileCB* CTestFileSystem::NewFileL() const |
|
40 // |
|
41 // Create a new file |
|
42 // |
|
43 { |
|
44 return (new(ELeave) CTestFileCB); |
|
45 } |
|
46 |
|
47 CDirCB* CTestFileSystem::NewDirL() const |
|
48 // |
|
49 // create a new directory lister |
|
50 // |
|
51 { |
|
52 return (new(ELeave) CTestDirCB); |
|
53 } |
|
54 |
|
55 CFormatCB* CTestFileSystem::NewFormatL() const |
|
56 // |
|
57 // Create a new media formatter |
|
58 // |
|
59 { |
|
60 return (new(ELeave) CTestFormatCB); |
|
61 } |
|
62 |
|
63 TInt CTestFileSystem::DefaultPath(TDes& aPath) const |
|
64 // |
|
65 // Return the intial default path |
|
66 // |
|
67 { |
|
68 aPath=KDefaultPath; |
|
69 return KErrNone; |
|
70 } |
|
71 |
|
72 void CTestFileSystem::DriveInfo(TDriveInfo& anInfo,TInt aDriveNumber) const |
|
73 // |
|
74 // Return drive info - iDriveAtt and iBatteryState are already set |
|
75 // |
|
76 { |
|
77 TLocalDriveCapsV2Buf localDriveCaps; |
|
78 DriveNumberToLocalDrive(aDriveNumber).Caps(localDriveCaps); |
|
79 anInfo.iMediaAtt=localDriveCaps().iMediaAtt; |
|
80 anInfo.iType=localDriveCaps().iType; |
|
81 anInfo.iDriveAtt=localDriveCaps().iDriveAtt; |
|
82 } |
|
83 |
|
84 TBusLocalDrive& CTestFileSystem::DriveNumberToLocalDrive(TInt aDriveNumber) const |
|
85 // |
|
86 // Return the local drive associated with aDriveNumber |
|
87 // |
|
88 { |
|
89 return(GetLocalDrive(aDriveNumber)); |
|
90 } |