author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 14 May 2010 17:13:29 +0300 | |
changeset 109 | b3a1d9898418 |
parent 15 | 4122176ea935 |
child 257 | 3e88ff8f41d5 |
permissions | -rw-r--r-- |
0 | 1 |
/* |
15
4122176ea935
Revision: 200948 + Removing redundant base integration tests and fixing build errors
John Imhofe <john.imhofe@nokia.com>
parents:
0
diff
changeset
|
2 |
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
0 | 3 |
* All rights reserved. |
4 |
* This component and the accompanying materials are made available |
|
15
4122176ea935
Revision: 200948 + Removing redundant base integration tests and fixing build errors
John Imhofe <john.imhofe@nokia.com>
parents:
0
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
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 |
* |
|
15
4122176ea935
Revision: 200948 + Removing redundant base integration tests and fixing build errors
John Imhofe <john.imhofe@nokia.com>
parents:
0
diff
changeset
|
14 |
* Description: |
0 | 15 |
* |
16 |
*/ |
|
17 |
||
15
4122176ea935
Revision: 200948 + Removing redundant base integration tests and fixing build errors
John Imhofe <john.imhofe@nokia.com>
parents:
0
diff
changeset
|
18 |
|
0 | 19 |
/** |
20 |
@test |
|
21 |
@internalComponent |
|
22 |
||
23 |
This contains CT_FsData |
|
24 |
*/ |
|
25 |
||
26 |
#if (!defined __T_FS_DATA_H__) |
|
27 |
#define __T_FS_DATA_H__ |
|
28 |
||
29 |
// User Includes |
|
30 |
#include "DataWrapperBase.h" |
|
31 |
#include "T_DirData.h" |
|
32 |
||
33 |
// EPOC includes |
|
34 |
#include <e32std.h> |
|
35 |
#include <f32file.h> |
|
109
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
15
diff
changeset
|
36 |
#include <f32file_private.h> |
0 | 37 |
#include <f32fsys.h> |
38 |
||
39 |
// User includes |
|
40 |
#include "T_ActiveNotifyChange.h" |
|
41 |
||
42 |
const TInt KBufferStringLength = 256; |
|
43 |
||
44 |
||
45 |
class CT_FsData: public CDataWrapperBase |
|
46 |
{ |
|
47 |
public: |
|
48 |
static CT_FsData* NewL(); |
|
49 |
~CT_FsData(); |
|
50 |
||
51 |
/** |
|
52 |
* Process a command read from the ini file |
|
53 |
* |
|
54 |
* @param aCommand requiring command to be processed |
|
55 |
* @param aSection the section in the ini file requiring the command to be processed |
|
56 |
* @param aAsyncErrorIndex the index of asynchronous command error code belongs to. |
|
57 |
* |
|
58 |
* @leave system wide error |
|
59 |
* |
|
60 |
* @return ETrue if the command is processed |
|
61 |
*/ |
|
62 |
virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex); |
|
63 |
||
64 |
/** |
|
65 |
* Return a pointer to the object that the data wraps |
|
66 |
* |
|
67 |
* @return pointer to the object that the data wraps |
|
68 |
*/ |
|
69 |
virtual TAny* GetObject(); |
|
70 |
||
71 |
/** |
|
72 |
* Query to see if there are any outstanding requests |
|
73 |
* |
|
74 |
* @return ETrue if there are any outstanding requests |
|
75 |
*/ |
|
76 |
||
77 |
void RunL(CActive* aActive, TInt aIndex); |
|
78 |
void DoCancel(CActive* aActive, TInt aIndex); |
|
79 |
||
80 |
protected: |
|
81 |
CT_FsData(); |
|
82 |
void ConstructL(); |
|
83 |
||
84 |
private: |
|
85 |
||
86 |
virtual TBool DoCommandDrivesL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex); |
|
87 |
virtual TBool DoCommandFilesL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex); |
|
88 |
virtual TBool DoCommandMountsL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex); |
|
89 |
||
90 |
||
91 |
void DoCmdNewL(); |
|
92 |
void DoCmdClose(); |
|
93 |
void DoCmdDestructor(); |
|
94 |
||
95 |
// Mount commands |
|
96 |
void DoCmdAddFileSystem(const TDesC& aSection); |
|
97 |
void DoCmdMountFileSystem(const TDesC& aSection); |
|
98 |
void DoCmdMountFileSystemAndScan(const TDesC& aSection); |
|
99 |
void DoCmdDismountFileSystem(const TDesC& aSection); |
|
100 |
void DoCmdRemoveFileSystem(const TDesC& aSection); |
|
101 |
void DoCmdFileSystemName(const TDesC& aSection); |
|
102 |
void DoCmdAddExtension(const TDesC& aSection); |
|
103 |
void DoCmdMountExtension(const TDesC& aSection); |
|
104 |
void DoCmdDismountExtension(const TDesC& aSection); |
|
105 |
void DoCmdRemoveExtension(const TDesC& aSection); |
|
106 |
void DoCmdExtensionName(const TDesC& aSection); |
|
107 |
void DoCmdRemountDriveL(const TDesC& aSection); |
|
108 |
void DoCmdNotifyDismountL(const TDesC& aSection, const TInt aAsyncErrorIndex); |
|
109 |
void DoCmdNotifyDismountCancel(const TDesC& aSection); |
|
110 |
void DoCmdAllowDismount(const TDesC& aSection); |
|
111 |
void DoCmdSetStartupConfigurationL(const TDesC& aSection); |
|
112 |
void DoCmdAddCompositeMount(const TDesC& aSection); |
|
113 |
void DoCmdStartupInitCompleteL(TInt aAsyncErrorIndex); |
|
114 |
void DoCmdSetLocalDriveMappingL(const TDesC& aSection); |
|
115 |
void DoCmdSwapFileSystem(const TDesC& aSection); |
|
116 |
void DoCmdFinaliseDrives(); |
|
117 |
void DoCmdFileSystemSubType(const TDesC& aSection); |
|
118 |
||
119 |
// Misc commands |
|
120 |
void DoCmdConnect(const TDesC& aSection); |
|
121 |
void DoCmdVersion(const TDesC& aSection); |
|
122 |
void DoCmdNotifyChangeL(const TDesC& aSection, const TInt aAsyncErrorIndex); |
|
123 |
void DoCmdNotifyChangeCancel(const TDesC& aSection); |
|
124 |
void DoCmdNotifyDiskSpaceL(const TDesC& aSection, const TInt aAsyncErrorIndex); |
|
125 |
void DoCmdNotifyDiskSpaceCancel(const TDesC& aSection); |
|
126 |
void DoCmdIsRomAddress(const TDesC& aSection); |
|
127 |
void DoCmdResourceCountMarkStart(); |
|
128 |
void DoCmdResourceCountMarkEnd(); |
|
129 |
void DoCmdResourceCount(const TDesC& aSection); |
|
130 |
void DoCmdGetNotifyUser(const TDesC& aSection); |
|
131 |
void DoCmdSetNotifyUser(const TDesC& aSection); |
|
132 |
void DoCmdLoaderHeapFunctionL(const TDesC& aSection); |
|
133 |
void DoCmdSetNotifyChange(const TDesC& aSection); |
|
134 |
void DoCmdInitialisePropertiesFile(const TDesC& aSection); |
|
135 |
||
136 |
// Files commands |
|
137 |
void DoCmdRealName(const TDesC& aSection); |
|
138 |
void DoCmdSessionPath(const TDesC& aSection); |
|
139 |
void DoCmdSetSessionPath(const TDesC& aSection); |
|
140 |
void DoCmdParse(const TDesC& aSection); |
|
141 |
void DoCmdMkDir(const TDesC& aSection); |
|
142 |
void DoCmdMkDirAll(const TDesC& aSection); |
|
143 |
void DoCmdRmDir(const TDesC& aSection); |
|
144 |
void DoCmdGetDir(const TDesC& aSection); |
|
145 |
void DoCmdDelete(const TDesC& aSection); |
|
146 |
void DoCmdRename(const TDesC& aSection); |
|
147 |
void DoCmdReplace(const TDesC& aSection); |
|
148 |
void DoCmdAtt(const TDesC& aSection); |
|
149 |
void DoCmdSetAtt(const TDesC& aSection); |
|
150 |
void DoCmdModified(const TDesC& aSection); |
|
151 |
void DoCmdSetModified(const TDesC& aSection); |
|
152 |
void DoCmdEntryL(const TDesC& aSection); |
|
153 |
void DoCmdSetEntry(const TDesC& aSection); |
|
154 |
void DoCmdReadFileSectionL(const TDesC& aSection); |
|
155 |
void DoCmdIsFileOpen(const TDesC& aSection); |
|
156 |
void DoCmdGetShortName(const TDesC& aSection); |
|
157 |
void DoCmdGetLongName(const TDesC& aSection); |
|
158 |
void DoCmdIsFileInRom(const TDesC& aSection); |
|
159 |
void DoCmdIsValidName(const TDesC& aSection); |
|
160 |
void DoCmdSetSessionToPrivate(const TDesC& aSection); |
|
161 |
void DoCmdPrivatePath(const TDesC& aSection); |
|
162 |
void DoCmdCreatePrivatePath(const TDesC& aSection); |
|
163 |
||
164 |
// Drives commands |
|
165 |
void DoCmdDriveList(const TDesC& aSection); |
|
166 |
void DoCmdDriveL(const TDesC& aSection); |
|
167 |
void DoCmdVolumeL(const TDesC& aSection); |
|
168 |
void DoCmdSetVolumeLabel(const TDesC& aSection); |
|
169 |
void DoCmdSubst(const TDesC& aSection); |
|
170 |
void DoCmdSetSubst(const TDesC& aSection); |
|
171 |
void DoCmdGetMediaSerialNumber(const TDesC& aSection); |
|
172 |
void DoCmdIsValidDrive(const TDesC& aSection); |
|
173 |
void DoCmdCharToDrive(const TDesC& aSection); |
|
174 |
void DoCmdDriveToChar(const TDesC& aSection); |
|
175 |
void DoCmdCheckDisk(const TDesC& aSection); |
|
176 |
void DoCmdScanDrive(const TDesC& aSection); |
|
177 |
void DoCmdGetDriveName(const TDesC& aSection); |
|
178 |
void DoCmdSetDriveName(const TDesC& aSection); |
|
179 |
void DoCmdLockDrive(const TDesC& aSection); |
|
180 |
void DoCmdUnlockDrive(const TDesC& aSection); |
|
181 |
void DoCmdClearPassword(const TDesC& aSection); |
|
182 |
void DoCmdErasePassword(const TDesC& aSection); |
|
183 |
void DoCmdReserveDriveSpace(const TDesC& aSection); |
|
184 |
void DoCmdGetReserveAccess(const TDesC& aSection); |
|
185 |
void DoCmdReleaseReserveAccess(const TDesC& aSection); |
|
186 |
void DoCmdGetSystemDrive(const TDesC& aSection); |
|
187 |
void DoCmdSetSystemDrive(const TDesC& aSection); |
|
188 |
void DoCmdGetSystemDriveChar(const TDesC& aSection); |
|
189 |
void DoCmdVolumeIOParam(const TDesC& aSection); |
|
190 |
||
191 |
// Helpers |
|
192 |
void DoCleanup(); |
|
193 |
void DoCmdPromptL(const TDesC &aSection); |
|
194 |
inline RFs& CT_FsData::FileServer(){ return iFs2; } |
|
195 |
TBool VerifyTDriveInfoDataFromIniL(const TDesC& aSection, TDriveInfo& aDriveInfo); |
|
196 |
||
197 |
||
198 |
||
199 |
const TDesC& ConvertToStrAttMask(TUint aAttMask); |
|
200 |
TBool ConvertToSortKey(const TDesC& aSortKeyStr, TUint& aSortKey); |
|
201 |
TBool ConvertToNotifyType(const TDesC& aNotifyTypeStr, TNotifyType& aNotifyType); |
|
202 |
TBool ConvertToMediaAtts(const TDesC& aMediaAttStr, TUint& aMediaAtt); |
|
203 |
TBool ConvertToDriveAtts(const TDesC& aMediaAttStr, TUint& aMediaAtt); |
|
204 |
TBool GetDriveNumberFromConfig(const TDesC& aSection, const TDesC& aParameterName, TDriveNumber& aDriveNumber); |
|
205 |
TBool GetMediaTypeFromConfig(const TDesC& aSection, TMediaType& aMediaType); |
|
206 |
TBool GetMediaAttsFromConfig(const TDesC& aSection, TUint& aMediaAtt); |
|
207 |
TBool GetDriveAttsFromConfig(const TDesC& aSection, TUint& aDriveAtt); |
|
208 |
TBool GetBatteryStateFromConfig(const TDesC& aSection, TBatteryState& aBatteryState); |
|
209 |
TBool GetDrvMapOperationFromConfig(const TDesC& aSection, const TDesC& aParameterName, TLocalDriveMappingInfo::TDrvMapOperation& aOperation); |
|
210 |
public: |
|
211 |
TUint64 ThreadId(); |
|
212 |
||
213 |
private: |
|
214 |
/** RFs class instance that is tested */ |
|
215 |
RFs* iFs; |
|
216 |
||
217 |
/** RFs class instance for additional purpoces */ |
|
218 |
RFs iFs2; |
|
219 |
||
220 |
/** The request status for files/dir events */ |
|
221 |
RPointerArray<CT_ActiveNotifyChange> iNotifyChange; |
|
222 |
||
223 |
/** The request status for disk space events */ |
|
224 |
RPointerArray<CActiveCallback> iNotifyDiskSpace; |
|
225 |
||
226 |
/** The request status for dismounts a file system on a drive */ |
|
227 |
RPointerArray<CActiveCallback> iNotifyDismount; |
|
228 |
||
229 |
/** The request status for dismounts a file system on a drive */ |
|
230 |
RPointerArray<CActiveCallback> iStartupInitComplete; |
|
231 |
||
232 |
/** The volume label for a drive */ |
|
233 |
TVolumeInfo iVolumeInfo; |
|
234 |
||
235 |
/** Optional name of the volume */ |
|
236 |
TFileName iDriveName; |
|
237 |
TFileName iVolumeLabel; |
|
238 |
||
239 |
/** Extension name */ |
|
240 |
TFullName iExtensionName; |
|
241 |
||
242 |
/** IsFileInRom result */ |
|
243 |
TUint8* iIsFileInRom; |
|
244 |
||
245 |
/** FileSystemName retuned value */ |
|
246 |
TFullName iFileSystemName; |
|
247 |
||
248 |
/** LockDrive password */ |
|
249 |
TMediaPassword iPassword; |
|
250 |
}; |
|
251 |
||
252 |
#define GET_MANDATORY_STRING_PARAMETER(aParamName, aSection, aResult) GetCommandStringParameter(aParamName, aSection, aResult, (TText8*)__FILE__, __LINE__, ETrue) |
|
253 |
#define GET_MANDATORY_INT_PARAMETER(aParamName, aSection, aResult) GetCommandIntParameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, ETrue) |
|
254 |
#define GET_MANDATORY_INT64_PARAMETER(aParamName, aSection, aResult) GetCommandInt64Parameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, ETrue) |
|
255 |
#define GET_MANDATORY_BOOL_PARAMETER(aParamName, aSection, aResult) GetCommandBoolParameter(aParamName, aSection, aResult, (TText8*)__FILE__, __LINE__, ETrue) |
|
256 |
||
257 |
#define GET_OPTIONAL_STRING_PARAMETER(aParamName, aSection, aResult) GetCommandStringParameter(aParamName, aSection, aResult, (TText8*) __FILE__, __LINE__, EFalse) |
|
258 |
#define GET_OPTIONAL_INT_PARAMETER(aParamName, aSection, aResult) GetCommandIntParameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, EFalse) |
|
259 |
#define GET_OPTIONAL_INT64_PARAMETER(aParamName, aSection, aResult) GetCommandInt64Parameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, EFalse) |
|
260 |
#define GET_OPTIONAL_BOOL_PARAMETER(aParamName, aSection, aResult) GetCommandBoolParameter(aParamName, aSection, aResult,(TText8*) __FILE__, __LINE__, EFalse) |
|
261 |
||
262 |
#endif /* __T_FS_DATA_H__ */ |