author | hgs |
Mon, 01 Nov 2010 20:11:36 +0000 | |
changeset 299 | b5a01337d018 |
parent 286 | 48e57fb1237e |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 1995-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". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// f32\inc\f32fsys.h |
|
15 |
// |
|
16 |
// WARNING: This file contains some APIs which are internal and are subject |
|
17 |
// to change without notice. Such APIs should therefore not be used |
|
18 |
// outside the Kernel and Hardware Services package. |
|
19 |
// |
|
20 |
||
21 |
/** |
|
22 |
@file |
|
23 |
@publishedPartner |
|
24 |
@released |
|
25 |
*/ |
|
26 |
||
27 |
#if !defined(__F32FSYS_H__) |
|
28 |
#define __F32FSYS_H__ |
|
29 |
#if !defined(__F32FILE_H__) |
|
30 |
#include <f32file.h> |
|
31 |
#endif |
|
32 |
#include <e32atomics.h> |
|
33
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
33 |
#include <d32locd.h> |
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
34 |
|
0 | 35 |
// |
36 |
#if defined(_UNICODE) |
|
37 |
#define KFileSystemUidValue KFileSystemUidValue16 |
|
38 |
#define KFileServerUidValue KFileServerUidValue16 |
|
39 |
#define KFileServerDllUidValue KFileServerDllUidValue16 |
|
40 |
#else |
|
41 |
#define KFileSystemUidValue KFileSystemUidValue8 |
|
42 |
#define KFileServerUidValueKFileServerUidValue8 |
|
43 |
#define KFileServerDllUidValueKFileServerDllUidValue8 |
|
44 |
#endif |
|
45 |
||
46 |
||
47 |
/** |
|
48 |
Filesystem error code 1 : indicates an item cannot be found, |
|
49 |
because it has been hidden. |
|
50 |
*/ |
|
51 |
const TInt KErrHidden=(1); |
|
52 |
||
53 |
/** |
|
54 |
Filesystem error code 2 : in the context of file operations, a path |
|
55 |
was not found, because it has been hidden. |
|
56 |
*/ |
|
57 |
const TInt KErrPathHidden=(2); |
|
58 |
||
59 |
||
60 |
const TInt KFileShareLockGranularity=2; |
|
61 |
const TInt KAsyncRequestArrayGranularity=2; |
|
62 |
||
63 |
/** |
|
64 |
@publishedPartner |
|
65 |
@released |
|
66 |
||
67 |
File system UID value 16. |
|
68 |
*/ |
|
69 |
const TInt KFileSystemUidValue16=0x100039df; |
|
70 |
||
71 |
||
72 |
||
73 |
||
74 |
/** |
|
75 |
@publishedPartner |
|
76 |
@released |
|
77 |
||
78 |
File system UID value 8. |
|
79 |
*/ |
|
80 |
const TInt KFileSystemUidValue8=0x1000008f; |
|
81 |
||
82 |
||
83 |
||
84 |
||
85 |
/** |
|
86 |
@publishedPartner |
|
87 |
@released |
|
88 |
||
89 |
File server UID value 16. |
|
90 |
*/ |
|
91 |
const TInt KFileServerUidValue16=0x100039e3; |
|
92 |
||
93 |
||
94 |
||
95 |
||
96 |
/** |
|
97 |
@publishedPartner |
|
98 |
@released |
|
99 |
||
100 |
File server UID value 8. |
|
101 |
*/ |
|
102 |
const TInt KFileServerUidValue8=0x100000bb; |
|
103 |
||
104 |
||
105 |
||
106 |
||
107 |
/** |
|
108 |
@publishedPartner |
|
109 |
@released |
|
110 |
||
111 |
File server DLL UID value 16. |
|
112 |
*/ |
|
113 |
const TInt KFileServerDllUidValue16=0x100039e4; |
|
114 |
||
115 |
||
116 |
||
117 |
||
118 |
/** |
|
119 |
@publishedPartner |
|
120 |
@released |
|
121 |
||
122 |
File server DLL UID value 8. |
|
123 |
*/ |
|
124 |
const TInt KFileServerDllUidValue8=0x100000bd; |
|
125 |
||
126 |
||
127 |
||
128 |
||
129 |
/** |
|
130 |
@publishedPartner |
|
131 |
@released |
|
132 |
||
133 |
Local file system UID value. |
|
134 |
*/ |
|
135 |
const TInt KLocalFileSystemUidValue=0x100000d6; |
|
136 |
||
137 |
||
138 |
||
139 |
||
140 |
/** |
|
141 |
@publishedPartner |
|
142 |
@released |
|
143 |
||
144 |
Estart component UID value. |
|
145 |
*/ |
|
146 |
const TInt KEstartUidValue=0x10272C04; |
|
147 |
||
148 |
||
149 |
||
150 |
/** |
|
151 |
@publishedPartner |
|
152 |
@released |
|
153 |
Maximum length of a volume name. |
|
154 |
*/ |
|
155 |
const TInt KMaxVolumeNameLength=11; |
|
156 |
||
157 |
||
158 |
||
159 |
||
160 |
/** |
|
161 |
@publishedPartner |
|
162 |
@released |
|
163 |
||
164 |
First local drive indicator. |
|
165 |
*/ |
|
166 |
const TInt KFirstLocalDrive=EDriveC; |
|
167 |
||
168 |
||
169 |
const TInt KMaxExtensionCount=2; |
|
170 |
// |
|
171 |
const TInt KDriveInvalid=-1; |
|
172 |
// |
|
173 |
_LIT(KMediaPWrdFile, "?:\\sys\\data\\mmcstore"); |
|
174 |
// |
|
175 |
||
176 |
/** |
|
177 |
@internalTechnology |
|
178 |
*/ |
|
179 |
const TUint KSystemDriveKey = 0x10283049; |
|
180 |
||
181 |
||
182 |
/** |
|
183 |
@publishedPartner |
|
184 |
@released |
|
185 |
||
186 |
Enumeration that specifies whether, on opening a file: |
|
187 |
- an existing file is opened |
|
188 |
- a new file is created |
|
189 |
- an existing file is replaced. |
|
190 |
*/ |
|
191 |
enum TFileOpen {EFileOpen,EFileCreate,EFileReplace}; |
|
192 |
||
193 |
||
194 |
||
195 |
||
196 |
/** |
|
197 |
@publishedPartner |
|
198 |
@released |
|
199 |
||
200 |
The file share mode. |
|
201 |
*/ |
|
202 |
typedef TFileMode TShare; |
|
203 |
||
204 |
||
205 |
||
206 |
||
207 |
class CMountCB; |
|
208 |
class CFileSystem; |
|
209 |
class CFileCB; |
|
210 |
class CDirCB; |
|
211 |
class CFileShare; |
|
212 |
class CSessionFs; |
|
213 |
class CFsPlugin; |
|
214 |
class CFileBody; |
|
215 |
class CMountBody; |
|
216 |
class CFsMessageRequest; |
|
217 |
class CProxyDrive; |
|
218 |
class CFormatCB; |
|
219 |
||
220 |
// |
|
221 |
class CFsObjectCon; |
|
222 |
class CFileCache; |
|
223 |
// |
|
224 |
class CExtNotifyMediaChange; |
|
225 |
// |
|
226 |
||
227 |
/** |
|
228 |
@publishedPartner |
|
229 |
@released |
|
230 |
||
231 |
Implements reference counting to track concurrent references to itself. |
|
232 |
||
233 |
An object of this type arranges automatic destruction of itself when the final |
|
234 |
reference is removed. |
|
235 |
||
236 |
A reference counting object is any object which has CFsObject as its base class. |
|
237 |
Constructing a CFsObject derived type or calling its Open() member function |
|
238 |
adds a reference to that object by adding one to the reference count; calling |
|
239 |
its Close() member function removes a reference by subtracting one from the |
|
240 |
reference count; when the last user of the object calls Close(), the reference |
|
241 |
count becomes zero and the object is automatically destroyed. |
|
242 |
*/ |
|
243 |
class CFsObject : public CBase |
|
244 |
||
245 |
{ |
|
246 |
public: |
|
247 |
IMPORT_C CFsObject(); |
|
248 |
IMPORT_C virtual TInt Open(); |
|
249 |
IMPORT_C virtual void Close(); |
|
250 |
IMPORT_C TInt SetName(const TDesC* aName); |
|
251 |
IMPORT_C TName Name() const; |
|
252 |
IMPORT_C virtual TBool IsCorrectThread(); |
|
253 |
inline CFsObjectCon* Container() const; |
|
254 |
protected: |
|
255 |
void DoClose(); |
|
256 |
TInt UniqueID() const; |
|
257 |
inline TInt Inc(); |
|
258 |
inline TInt Dec(); |
|
259 |
IMPORT_C ~CFsObject(); |
|
260 |
private: |
|
261 |
TInt iAccessCount; |
|
262 |
CFsObjectCon* iContainer; |
|
263 |
HBufC* iName; |
|
264 |
friend class CFsObjectCon; |
|
265 |
friend class CFsObjectIx; |
|
266 |
}; |
|
267 |
||
268 |
||
269 |
||
270 |
||
271 |
class CFsRequest; |
|
272 |
class CFsInternalRequest; |
|
273 |
||
274 |
/** |
|
275 |
Implements a request dispatcher. |
|
276 |
||
277 |
Base class for file server resources. |
|
278 |
for example subsessions that are opened, such as RFile etc, that need closing are closed by |
|
279 |
issuing a subsession close request, handled by this object. |
|
280 |
||
281 |
@publishedPartner |
|
282 |
@released |
|
283 |
*/ |
|
284 |
class CFsDispatchObject : public CFsObject |
|
285 |
{ |
|
286 |
public: |
|
287 |
CFsDispatchObject(); |
|
288 |
/** |
|
289 |
Returns the drive number. |
|
290 |
@return Drive number. |
|
291 |
*/ |
|
292 |
TInt DriveNumber() const {return(iDriveNumber);} |
|
293 |
IMPORT_C void Close(); |
|
294 |
IMPORT_C virtual TBool IsCorrectThread(); |
|
295 |
protected: |
|
296 |
void DoInitL(TInt aDrvNumber); |
|
297 |
void Dispatch(); |
|
298 |
~CFsDispatchObject(); |
|
299 |
private: |
|
300 |
CFsInternalRequest* iRequest; |
|
301 |
TInt iDriveNumber; |
|
302 |
friend class TFsCloseObject; |
|
303 |
friend class CFileShare; // needed to override the close operation so that the file cache can be flushed on a close |
|
304 |
}; |
|
305 |
||
306 |
||
307 |
||
308 |
||
309 |
/** |
|
310 |
Notifier class must be unique to each thread so one per drive or threaded plugin should be used |
|
311 |
allocated in the file system. No longer global |
|
312 |
||
313 |
@publishedPartner |
|
314 |
@released |
|
315 |
*/ |
|
316 |
NONSHARABLE_CLASS(CAsyncNotifier) : public CBase |
|
317 |
{ |
|
318 |
public: |
|
319 |
IMPORT_C static CAsyncNotifier* New(); |
|
320 |
IMPORT_C ~CAsyncNotifier(); |
|
321 |
IMPORT_C TInt Notify(const TDesC& aLine1,const TDesC& aLine2,const TDesC& aButton1,const TDesC& aButton2,TInt& aButtonVal); |
|
322 |
inline void SetMount(CMountCB* aMount) { iMount = aMount; }; |
|
323 |
protected: |
|
324 |
CAsyncNotifier(); |
|
325 |
TInt Connect(); |
|
326 |
private: |
|
327 |
RNotifier iNotifier; |
|
328 |
CMountCB* iMount; |
|
329 |
}; |
|
330 |
||
331 |
||
332 |
||
333 |
||
334 |
class CProxyDriveFactory; |
|
335 |
||
336 |
/** |
|
337 |
@publishedPartner |
|
338 |
@released |
|
339 |
||
340 |
Structure containing information related to a single drive extension. |
|
341 |
*/ |
|
342 |
struct TExtensionInfo |
|
343 |
{ |
|
344 |
TBool iIsPrimary; ///< Is the primary drive extension for a given drive |
|
345 |
CProxyDriveFactory* iFactory; ///< Pointer to the drive extension's object factory |
|
346 |
}; |
|
347 |
||
348 |
||
349 |
||
350 |
||
351 |
/** |
|
352 |
@publishedPartner |
|
353 |
@released |
|
354 |
||
355 |
Represents information related to the Drive extension(s) in use for a given drive. |
|
356 |
*/ |
|
357 |
struct TDriveExtInfo |
|
358 |
{ |
|
359 |
TDriveExtInfo(); |
|
360 |
||
361 |
TInt iCount; ///< Number of drive extensions in use |
|
362 |
||
363 |
TExtensionInfo iInfo[KMaxExtensionCount]; ///< Drive extension related information |
|
364 |
}; |
|
365 |
||
366 |
||
367 |
||
368 |
||
369 |
/** |
|
370 |
@publishedPartner |
|
371 |
@released |
|
372 |
||
373 |
Represents a drive in the file server. |
|
374 |
||
375 |
Note that drives may act as substitutes for paths on other drives, |
|
376 |
in which case any access to this drive letter will be translated into |
|
377 |
a reference to the assigned path. In this way drives can act as short |
|
378 |
cuts to paths on other drives. |
|
379 |
*/ |
|
380 |
class TDrive |
|
381 |
{ |
|
382 |
public: |
|
383 |
TDrive(); |
|
384 |
void CreateL(TInt aDriveNumber); |
|
385 |
TInt CheckMount(); |
|
386 |
TInt CheckMountAndEntryName(const TDesC& aName); |
|
387 |
TInt FinaliseMount(); |
|
388 |
TInt FinaliseMount(TInt aOperation, TAny* aParam1=NULL, TAny* aParam2=NULL); |
|
389 |
TInt MountControl(TInt aLevel, TInt aOption, TAny* aParam); |
|
390 |
void MountFileSystem(TBool aForceMount, TUint32 aFsNameHash = 0); |
|
391 |
void FlushCachedFileInfoL(); |
|
392 |
TInt FlushCachedFileInfo(TBool aPurgeCache = EFalse); |
|
393 |
void PurgeDirty(CMountCB& aMount); |
|
394 |
void DriveInfo(TDriveInfo& anInfo); |
|
395 |
TInt Volume(TVolumeInfo& aVolume); |
|
396 |
TInt SetVolume(const TDesC& aName); |
|
397 |
TInt MkDir(const TDesC& aName); |
|
398 |
TInt RmDir(const TDesC& aName); |
|
399 |
TInt Delete(const TDesC& aName); |
|
400 |
TInt Rename(const TDesC& anOldName,const TDesC& aNewName); |
|
401 |
TInt Replace(const TDesC& anOldName,const TDesC& aNewName); |
|
402 |
TInt Entry(const TDesC& aName,TEntry& anEntry); |
|
403 |
TInt SetEntry(const TDesC& aName,const TTime& aTime,TUint aMask,TUint aVal); |
|
404 |
TInt FileTemp(CFsRequest* aRequest,TInt& aHandle,const TDesC& aPath,TDes& aName,TUint aMode); |
|
405 |
TInt FileOpen(CFsRequest* aRequest,TInt& aHandle,const TDesC& aName,TUint aMode,TFileOpen anOpen); |
|
406 |
TInt DirOpen(CSessionFs* aSession,TInt& aHandle,const TDesC& aName,TUint anAtt,const TUidType& aUidType); |
|
407 |
CFormatCB* FormatOpenL(CFsRequest* aRequest, TInt& aFmtHandle, TFormatMode aFmtMode, const TLDFormatInfo* apLDFormatInfo, const TVolFormatParam* apVolFormatParam); |
|
408 |
||
409 |
TInt CheckDisk(); |
|
410 |
TInt CheckDisk(TInt aOperation, TAny* aParam1=NULL, TAny* aParam2=NULL); |
|
411 |
||
412 |
TInt ScanDrive(); |
|
413 |
TInt ScanDrive(TInt aOperation, TAny* aParam1=NULL, TAny* aParam2=NULL); |
|
414 |
||
415 |
TInt ReadFileSection(const TDesC& aName,TInt aPos,TAny* aTrg,TInt aLength,const RMessagePtr2& aMessage); |
|
416 |
TInt ReadFileSection64(const TDesC& aName,TInt64 aPos,TAny* aTrg,TInt aLength,const RMessagePtr2& aMessage); |
|
417 |
TInt GetShortName(const TDesC& aLongName,TDes& aShortName); |
|
418 |
TInt GetLongName(const TDesC& aShortName,TDes& aLongName); |
|
419 |
TInt IsFileOpen(const TDesC& aFileName,CFileCB*& aFileCB); |
|
420 |
TInt IsFileInRom(const TDesC& aFileName,TUint8*& aFileStart); |
|
421 |
TInt LockDevice(TMediaPassword& aOld,TMediaPassword& aNew,TBool aStore); |
|
422 |
TInt UnlockDevice(TMediaPassword& aPassword,TBool aStore); |
|
423 |
TInt ClearDevicePassword(TMediaPassword& aPassword); |
|
424 |
TInt EraseDevicePassword(); |
|
425 |
TInt FreeDiskSpace(TInt64& aFreeDiskSpace); |
|
426 |
TInt ForceRemountDrive(const TDesC8* aMountInfo,TInt aMountInfoMessageHandle,TUint aFlags); |
|
427 |
TBool IsWriteProtected(); |
|
428 |
TInt MountExtension(CProxyDriveFactory* aFactory,TBool aIsPrimary); |
|
429 |
TInt DismountExtension(CProxyDriveFactory* aFactory,TBool aIsPrimary); |
|
430 |
TInt ExtensionName(TDes& aExtensionName,TInt aPos); |
|
431 |
TInt ControlIO(const RMessagePtr2& aMessage,TInt aCommand,TAny* aParam1,TAny* aParam2); |
|
432 |
void SetAtt(TUint aValue); |
|
433 |
IMPORT_C TUint Att(); |
|
434 |
IMPORT_C TBool GetNotifyUser(); |
|
435 |
IMPORT_C void Dismount(); |
|
436 |
IMPORT_C TBool IsWriteableResource() const; |
|
437 |
IMPORT_C TBool IsCurrentWriteFunction() const; |
|
438 |
inline TInt GetReason() const; |
|
439 |
inline void SetChanged(TBool aValue); |
|
440 |
inline TBool IsChanged() const; |
|
441 |
inline TInt DriveNumber() const; |
|
442 |
inline TBool IsMounted() const; |
|
443 |
inline TBool IsLocal() const; |
|
444 |
inline TBool IsRom() const; |
|
445 |
inline TBool IsRemovable() const; |
|
446 |
inline TBool IsSubsted() const; |
|
447 |
inline CMountCB& CurrentMount() const; |
|
448 |
inline TBool IsCurrentMount(CMountCB& aMount) const; |
|
449 |
inline TDrive& SubstedDrive() const; |
|
450 |
inline void SetSubstedDrive(TDrive* aDrive); |
|
451 |
inline HBufC& Subst() const; |
|
452 |
inline void SetSubst(HBufC* aSubst); |
|
453 |
inline CFsObjectCon& Mount() const; |
|
454 |
inline CFileSystem& FSys(); |
|
455 |
inline CFileSystem*& GetFSys(); |
|
456 |
inline TDriveExtInfo& ExtInfo(); |
|
457 |
inline void SetNotifyOn(); |
|
458 |
inline void SetNotifyOff(); |
|
459 |
inline TInt ReservedSpace() const; |
|
460 |
inline void SetReservedSpace(const TInt aReservedSpace); |
|
461 |
||
462 |
inline void SetRugged(TBool aIsRugged); |
|
463 |
inline TBool IsRugged() const; |
|
464 |
||
465 |
inline TBool IsSynchronous() const; |
|
466 |
inline void SetSynchronous(TBool aIsSynch); |
|
467 |
||
468 |
TInt DismountProxyDrive(); |
|
469 |
TInt ForceUnmountFileSystemForFormatting(); |
|
470 |
||
286 | 471 |
void DismountClientAdded(); |
472 |
void DismountClientRemoved(); |
|
473 |
TInt DismountClientCount(); |
|
474 |
TInt DeferredDismountCheck(); |
|
475 |
||
0 | 476 |
void DismountLock(); |
477 |
TInt DismountUnlock(); |
|
478 |
TInt DismountLocked() const; |
|
479 |
void SetDismountDeferred(TBool aPending); |
|
480 |
void ForceDismount(); |
|
481 |
TInt ActiveMounts() const; |
|
482 |
void ReactivateMounts(); |
|
483 |
TInt ClampFile(const TDesC& aName,TAny* aHandle); |
|
484 |
TInt UnclampFile(CMountCB* aMount, RFileClamp* aHandle); |
|
485 |
TInt ClampsOnDrive(); |
|
486 |
inline TBool DismountDeferred() const; |
|
487 |
TInt DeferredDismount(); |
|
488 |
#if defined(_DEBUG) || defined(_DEBUG_RELEASE) |
|
489 |
TInt ClearDeferredDismount(); |
|
490 |
#endif |
|
491 |
void SetClampFlag(TBool aClamped); |
|
492 |
TBool ClampFlag(); |
|
493 |
inline void Lock(); |
|
494 |
inline void UnLock(); |
|
495 |
void MultiSlotDriveCheck(); |
|
496 |
||
497 |
TInt RequestFreeSpaceOnMount(TUint64 aFreeSpaceRequired); |
|
498 |
TInt MountedVolumeSize(TUint64& aSize); |
|
499 |
||
500 |
TBool ReMount(CMountCB& aMount); |
|
501 |
||
502 |
private: |
|
503 |
||
504 |
void DoMountFileSystemL(CMountCB*& apMount, TBool aForceMount, TUint32 aFsNameHash); |
|
505 |
||
506 |
void SetVolumeL(const TDesC& aName,HBufC*& aBuf); |
|
507 |
void DirOpenL(CSessionFs* aSession,TInt& aHandle,const TDesC& aName,TUint anAtt,const TUidType& aUidType,CDirCB*& aDir); |
|
508 |
void FileOpenL(CFsRequest* aRequest,TInt& aHandle,const TDesC& aName,TUint aMode,TFileOpen anOpen,CFileCB*& aFileCB,CFileShare*& aFileShare); |
|
509 |
TInt CheckMountAndEntryNames(const TDesC& anOldName,const TDesC& aNewName); |
|
510 |
CFileCB* LocateFileByPath(const TDesC& aPath); |
|
511 |
TInt CheckDirectories(const TDesC& anOldName,const TDesC& aNewName); |
|
512 |
void DoEntryL(const TDesC& aName,TEntry& anEntry); |
|
513 |
void ReadSectionL(const TDesC& aName,TInt64 aPos,TAny* aTrg,TInt aLength,const RMessagePtr2& aMessage); |
|
514 |
TInt ValidateShare(CFileCB& aFile,TShare aReqShare); |
|
176 | 515 |
TInt CheckAttributes(TUint& aSetAttMask,TUint& aClearAttMask); |
0 | 516 |
TBool IsExtensionMounted(CProxyDriveFactory* aFactory); |
517 |
CFileCB* LocateFile(const TDesC& aName); |
|
518 |
CFileCache* LocateClosedFile(const TDesC& aName, TBool aResurrect = ETrue); |
|
519 |
TBool ReMount(); |
|
520 |
IMPORT_C TBool IsDriveThread() const; |
|
521 |
IMPORT_C TBool IsMainThread() const; |
|
522 |
IMPORT_C void DriveFault(TBool aDriveError) const; |
|
523 |
void DoDismount(); |
|
524 |
||
525 |
private: |
|
526 |
||
527 |
//-- intrinsic TDrive flags. Used in iDriveFlags. |
|
528 |
enum |
|
529 |
{ |
|
530 |
ENotifyOff = 0x01, |
|
286 | 531 |
EDismountDeferred= 0x02, // Dismount initiated, waiting for clients to respond with EFsAllowDismount or files to become unclamped |
0 | 532 |
ENotRugged = 0x04, |
533 |
EClampPresent = 0x08, |
|
534 |
EDriveIsSynch = 0x10, //-- is set on mount when the drive is synchronous (doesn't have its own thread) |
|
535 |
}; |
|
536 |
||
537 |
private: |
|
538 |
TInt iDriveNumber; |
|
539 |
TUint iAtt; |
|
540 |
TBool iChanged; |
|
541 |
TInt iReason; |
|
542 |
TInt iMountNumber; |
|
543 |
CFileSystem* iFSys; |
|
544 |
CMountCB* iCurrentMount; |
|
545 |
TDrive* iSubstedDrive; |
|
546 |
HBufC* iSubst; |
|
547 |
CFsObjectCon* iMount; |
|
548 |
RFastLock iLock; |
|
549 |
TDriveExtInfo iExtInfo; |
|
550 |
TInt iDriveFlags; ///< intrinsic TDrive flags |
|
551 |
TInt iReservedSpace; |
|
552 |
TInt iDismountLock; |
|
553 |
TInt iMountFailures; // number of times the mount has failed |
|
554 |
TInt iLastMountError; |
|
286 | 555 |
|
556 |
TInt iDismountClientCount; // number of EFsAllowDismount requests pending following a EFsDismountNotifyClients request |
|
557 |
CFsInternalRequest* iDeferredDismountRequest; |
|
0 | 558 |
|
559 |
||
560 |
friend class LocalDrives; // for access to iChanged flag |
|
561 |
friend class CExtNotifyMediaChange; // for access to iChanged flag |
|
148 | 562 |
|
563 |
#if defined(_USE_CONTROLIO) || defined(_DEBUG) || defined(_DEBUG_RELEASE) |
|
564 |
friend class TFsControlIo; // for access to LocateDrives() |
|
565 |
#endif |
|
0 | 566 |
}; |
299 | 567 |
|
568 |
#ifdef SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION |
|
569 |
typedef TFsNotification::TFsNotificationType TNotificationType; |
|
570 |
#else |
|
571 |
typedef TInt TNotificationType; |
|
572 |
#endif |
|
573 |
__ASSERT_COMPILE(sizeof(TNotificationType) == sizeof(TInt)); |
|
574 |
||
575 |
class CFsNotificationInfoBody; //Forward-declaration |
|
576 |
class CFsClientMessageRequest; //Forward-declaration |
|
577 |
class TParsePtrC; //Forward-declaration |
|
578 |
template <class T> class CFsPool; //Forward-declaration |
|
579 |
||
580 |
class CFsNotificationInfo : public CBase |
|
581 |
{ |
|
582 |
public: |
|
583 |
||
584 |
/** |
|
585 |
* For construction from File systems / CMountCBs |
|
586 |
* |
|
587 |
* Provides a CFsNotificationInfo to populate. Populate with the change information. |
|
588 |
* Supply this object to CMountCB::IssueNotification. |
|
589 |
* |
|
590 |
* Once CMountCB::IssueNotification has been called, |
|
591 |
* free the object by passing it to CFsNotificationInfo::Free |
|
592 |
* (i.e. Do not call delete on the object) |
|
593 |
* |
|
594 |
* @param aMount The mount control block which is issuing this notification |
|
595 |
* @param aFunction The function as defined in TFsMessage, f32plugin.h, such as EFsFileWrite. |
|
596 |
* |
|
597 |
* @return A CFsNotificationInfo* which may be populated with notification info. |
|
598 |
* Will return NULL in error conditions. |
|
599 |
* |
|
600 |
* @see CMountCB::IssueNotification |
|
601 |
* @see CFsNotificationInfo::Free |
|
602 |
*/ |
|
603 |
IMPORT_C static CFsNotificationInfo* Allocate(const CMountCB& aMount, TInt aFunction); |
|
604 |
||
605 |
/** |
|
606 |
* Free CFsNotificationInfo objects allocated by CFsNotificationInfo::Allocate with this function. |
|
607 |
* |
|
608 |
* On return aNotificationInfo will be set to NULL. |
|
609 |
*/ |
|
610 |
IMPORT_C static void Free(CFsNotificationInfo*& aNotificationInfo); |
|
611 |
||
612 |
//Set data: |
|
613 |
||
614 |
/** |
|
615 |
* Set the source name for the changes. |
|
616 |
* This is the name of the file/directory that has changed. |
|
617 |
* |
|
618 |
* "drive-letter:" is not to be included. |
|
619 |
* |
|
620 |
* e.g. "x:\\myfile.txt" is incorrect |
|
621 |
* "\\myfile.txt" is correct. |
|
622 |
*/ |
|
623 |
IMPORT_C TInt SetSourceName(const TDesC& aSrc); |
|
624 |
||
625 |
/** |
|
626 |
* Set the new name for the file. |
|
627 |
* This is the new name of the file in the case of a rename. |
|
628 |
* |
|
629 |
* "drive-letter:" is not to be included. |
|
630 |
*/ |
|
631 |
IMPORT_C TInt SetNewName(const TDesC& aDest); |
|
632 |
||
633 |
/** |
|
634 |
* In the case of a File Write or File Set Size operation being notified, |
|
635 |
* the new file size of the file must be provided. |
|
636 |
*/ |
|
637 |
IMPORT_C TInt SetFilesize(TInt64 aFilesize); |
|
638 |
||
639 |
/** |
|
640 |
* In the case of a change of attributes, the set and cleared attributes must be provided. |
|
641 |
* (If these are not known, then the current attributes can be provided to aSet and |
|
642 |
* inverse of the current attributes can be provided to aCleared. |
|
643 |
*/ |
|
644 |
IMPORT_C TInt SetAttributes(TUint aSet,TUint aCleared); |
|
645 |
||
646 |
/** |
|
647 |
* Set the UID of the process that has caused the change. |
|
648 |
* |
|
649 |
*/ |
|
650 |
IMPORT_C TInt SetUid(const TUid& aUid); |
|
651 |
||
652 |
||
653 |
||
654 |
//******************************************** |
|
655 |
// File server internal : |
|
656 |
//******************************************** |
|
657 |
||
658 |
static CFsNotificationInfo* Allocate(CFsMessageRequest& aRequest); |
|
659 |
static CFsNotificationInfo* Allocate(TInt aFunction, TInt aDrive); |
|
660 |
||
661 |
//Initialise notification object pool |
|
662 |
static TInt Initialise(); |
|
663 |
||
664 |
//Getters |
|
665 |
TInt SetDriveNumber(TInt aDriveNumber); |
|
666 |
void SetRequest(CFsRequest*); |
|
667 |
TInt Function(); |
|
668 |
TInt DriveNumber(); |
|
669 |
TParsePtrC& Source(); |
|
670 |
TParsePtrC& NewName(); |
|
671 |
CFsRequest* Request(); |
|
672 |
TInt64* Data(); |
|
673 |
TUid& Uid(); |
|
674 |
TNotificationType& NotificationType(); |
|
675 |
TBool DestDriveIsSet(); |
|
676 |
||
677 |
/* |
|
678 |
* This is the source length including the drive and colon |
|
679 |
* which isn't actually saved as part of the stored source |
|
680 |
*/ |
|
681 |
TInt SourceSize(); |
|
682 |
/* |
|
683 |
* This is the new name length including the drive and colon |
|
684 |
* which may (or may not (- see below)) be actually part of the stored newname. |
|
685 |
* |
|
686 |
* "Drive:" is stored when the notification request originates from a |
|
687 |
* file server client and the drive could be different to the source's drive. |
|
688 |
* |
|
689 |
* In the case of a request originating from a CMountCB::IssueNotification call, |
|
690 |
* the CMountCB does not know about drive letters and only operates on a single |
|
691 |
* drive so in this case the "drive:" is missing. |
|
692 |
*/ |
|
693 |
TInt NewNameSize(); |
|
694 |
||
695 |
static void NotificationType(TInt aFunction,TNotificationType& aNotificationType); |
|
696 |
static void PathName(CFsClientMessageRequest& aRequest, TParsePtrC& aName); |
|
697 |
static void NewPathName(CFsClientMessageRequest& aRequest, TParsePtrC& aName); |
|
698 |
static TInt NotificationSize(CFsNotificationInfo& aRequest); |
|
699 |
static TInt TypeToIndex(TNotificationType aType); |
|
700 |
static TNotificationType NotificationType(TInt& aIndex); |
|
701 |
static TInt DriveNumber(const TPtrC& aPath); |
|
702 |
static void Attributes(CFsMessageRequest& aRequest, TUint& aSet, TUint& aClear); |
|
703 |
static TInt64 FileSize(CFsMessageRequest& aRequest); |
|
704 |
static TInt ValidateNotification(CFsNotificationInfo& aNotificationInfo); |
|
705 |
static void SetData(CFsMessageRequest* aRequest, CFsNotificationInfo* aNotificationInfo); |
|
706 |
static TUint NotifyType(TInt aFunction); |
|
707 |
||
708 |
private: |
|
709 |
//Don't delete instances, free them. |
|
710 |
virtual ~CFsNotificationInfo(); |
|
711 |
CFsNotificationInfo& operator=(CFsNotificationInfo& aNotification); //to prevent copying |
|
712 |
||
713 |
// called from New |
|
714 |
CFsNotificationInfo(); |
|
715 |
||
716 |
//Used to populate NotificationInfoPool |
|
717 |
static CFsNotificationInfo* New(); |
|
718 |
||
719 |
//Called after construction/allocation from pool |
|
720 |
TInt Init(TInt aFunction, TInt aDriveNumber); |
|
721 |
||
722 |
//Resets notification |
|
723 |
void CleanNotification(); |
|
724 |
||
725 |
CFsNotificationInfoBody* iBody; |
|
726 |
friend class FsNotify; |
|
727 |
friend class CFsPool<CFsNotificationInfo>; //For access to ~CFsNotificationInfo for compilation purposes |
|
728 |
}; |
|
729 |
||
0 | 730 |
|
731 |
class CFileCB; |
|
732 |
class CDirCB; |
|
733 |
||
33
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
734 |
__ASSERT_COMPILE(sizeof(TVolFormatParam) != sizeof(TLDFormatInfo)); |
0 | 735 |
|
736 |
||
737 |
||
738 |
/** |
|
739 |
@publishedPartner |
|
740 |
@released |
|
741 |
||
742 |
A file server interface class representing a mount. |
|
743 |
||
744 |
An instance of this object is referred to as a mount control block. |
|
745 |
||
746 |
A mount control block needs to be created for a specific volume (partition) on |
|
747 |
a drive in order to be able to access that volume. Volumes may be permanent |
|
748 |
or represent removable media. Note that removable media may also be mounted directly onto |
|
749 |
a device with no drive. Volumes can be formatted, unlike drives. |
|
750 |
||
751 |
The volume represented is either a currently mounted volume in the system or, |
|
752 |
in the case of removable volumes, a volume that has been removed but still has |
|
753 |
subsession objects open. |
|
754 |
||
755 |
A plug-in file system implements this class. |
|
756 |
*/ |
|
757 |
class CMountCB : public CFsDispatchObject |
|
758 |
{ |
|
759 |
public: |
|
760 |
IMPORT_C CMountCB(); |
|
761 |
IMPORT_C ~CMountCB(); |
|
762 |
IMPORT_C TBool operator!=(const CMountCB& aMount) const; |
|
763 |
IMPORT_C TBool MatchEntryAtt(TUint anAtt,TUint aMatt) const; |
|
764 |
IMPORT_C void SetDiskSpaceChange(TInt64 aFreeDiskSpace); |
|
765 |
IMPORT_C void InitL(TDrive& aDrive, CFileSystem* apFileSystem); |
|
766 |
||
767 |
inline TDrive& Drive() const; |
|
768 |
inline void SetDrive(TDrive* aDrive); |
|
769 |
inline HBufC& VolumeName() const; |
|
770 |
inline void SetVolumeName(HBufC* aName); |
|
771 |
inline TBool GetNotifyUser() const; |
|
772 |
inline void SetNotifyOn(); |
|
773 |
inline void SetNotifyOff(); |
|
774 |
inline void IncLock(); |
|
775 |
inline void DecLock(); |
|
776 |
inline TInt LockStatus() const; |
|
777 |
inline TBool IsCurrentMount() const; |
|
778 |
inline TBool Locked() const; |
|
779 |
inline TInt64 Size() const; |
|
780 |
inline TInt LocalDrive(TBusLocalDrive*& aLocalDrive); |
|
781 |
inline TInt ProxyDrive(CProxyDrive*& aProxyDrive); |
|
782 |
inline TInt LocalBufferSupport(CFileCB* aFile = NULL); |
|
783 |
inline TInt AddToCompositeMount(TInt aMountIndex); |
|
784 |
||
785 |
// Pure virtual |
|
786 |
||
787 |
/** |
|
788 |
Attempts to set the mount control block properties using |
|
789 |
the current mount (i.e. volume) on the associated drive. |
|
790 |
||
791 |
The function should set the volume name (iVolumeName), |
|
792 |
the unique ID (iUniqueID) and the volume size (iSize) |
|
793 |
by reading and processing the current mount. |
|
794 |
||
795 |
When aForceMount is set to ETrue, the properties of a corrupt volume should |
|
796 |
be forcibly stored. The classic case of when this is desirable is when |
|
797 |
a corrupt volume needs to be formatted. |
|
798 |
||
799 |
The function should leave, on error detection, with an appropriate error code. |
|
800 |
||
801 |
@param aForceMount Indicates whether the properties of a corrupt |
|
802 |
volume should be stored. |
|
803 |
||
804 |
@leave KErrCorrupt The properties of the current mount on the drive were |
|
805 |
not successfully mounted due to corruption of volume information, |
|
806 |
assuming that aForceMount is not set. |
|
807 |
*/ |
|
808 |
virtual void MountL(TBool aForceMount) =0; |
|
809 |
||
810 |
||
811 |
/** |
|
812 |
Checks whether the mount control block represents the current mount on |
|
813 |
the associated drive. |
|
814 |
||
815 |
The function should read mount information from the current volume, |
|
816 |
and check it against the mount information from this mount - typically |
|
817 |
iVolumeName and iUniqueID. If the mount information matches, the function |
|
818 |
should return KErrNone, otherwise it should return KErrGeneral. |
|
819 |
||
820 |
Called by the associated TDrive object when the drive has no current mounts, |
|
821 |
which is the case on first access to the drive and following a volume |
|
822 |
change on a drive associated with removable media. In this circumstance, |
|
823 |
this function is called systematically on every mount control block owned |
|
824 |
by the drive. If ReMount() calls for all existing mount |
|
825 |
control blocks fail, the drive creates a new mount control block and calls |
|
826 |
CMountCB::MountL() on that object; the new object is added to the list of |
|
827 |
mount control blocks owned by the drive. |
|
828 |
||
829 |
@return KErrNone if the mount represented by this object is found to be |
|
830 |
the current mount; |
|
831 |
KErrGeneral if this object is found not to represent |
|
832 |
the current mount; |
|
833 |
otherwise one of the other sytem wide error codes. |
|
834 |
*/ |
|
835 |
virtual TInt ReMount() =0; |
|
836 |
||
837 |
||
838 |
/** |
|
839 |
Carries out any clean-up necessary for a volume dismount. |
|
840 |
||
841 |
Dismounting a volume will always succeed, so the function does not need |
|
842 |
to return an error value. Any cached information should be discarded and no |
|
843 |
attempt should be made to access the volume. For removable media it may be |
|
844 |
that the media has already been removed. This function is called when |
|
845 |
a media change is detected. |
|
846 |
*/ |
|
847 |
virtual void Dismounted() =0; |
|
848 |
||
849 |
||
850 |
/** |
|
851 |
Gets volume information. |
|
852 |
||
853 |
The only information that the function has to supply is the free space, |
|
854 |
TVolumeInfo::iFree, since the remaining members have already been set by |
|
855 |
the calling function. |
|
856 |
||
857 |
The function should leave, on error detection, with |
|
858 |
an appropriate error code. |
|
859 |
||
860 |
@param aVolume On return, a reference to the filled volume |
|
861 |
information object. |
|
862 |
*/ |
|
863 |
virtual void VolumeL(TVolumeInfo& aVolume) const =0; |
|
864 |
||
865 |
||
866 |
/** |
|
867 |
Sets the volume name for the mount, thus writing the new volume name |
|
868 |
to the corresponding volume. |
|
869 |
||
870 |
This function should leave on error detection. |
|
871 |
||
872 |
@param aName A reference to a descriptor containing the new volume name. |
|
873 |
||
874 |
@leave KErrBadName If the specified volume name is longer than the maximum |
|
875 |
allowed length for a volume name |
|
876 |
*/ |
|
877 |
virtual void SetVolumeL(TDes& aName) =0; |
|
878 |
||
879 |
||
880 |
/** |
|
881 |
Creates a new directory on the mount. |
|
882 |
||
883 |
The directory to be created is identified through its full name in aName. |
|
884 |
The full name is in the form: |
|
885 |
@code |
|
886 |
\\dirA\\dirB\\dirC\\dirD |
|
887 |
@endcode |
|
888 |
where dirD is the new directory to be created in \\dirA\\dirB\\dirC\\. |
|
889 |
This means that dirC is the leaf directory in which dirD will be created. |
|
890 |
||
891 |
The function should leave, on error detection, with an appropriate |
|
892 |
error code. |
|
893 |
||
894 |
@param aName A reference to a descriptor containing the full name of |
|
895 |
the directory to be created. |
|
896 |
||
897 |
@leave KErrPathNotFound Part of the path in aName does not exist. |
|
898 |
@leave KErrAlreadyExists dirD already exists in \\dirA\\dirB\\dirC\\ |
|
899 |
@leave KErrAccessDenied dirD already exists but is not a directory. |
|
900 |
@leave KErrDirFull There is no room in \\dirA\\dirB\\dirC\\ for the new entry, |
|
901 |
which is especially applicable to the root directory. |
|
902 |
*/ |
|
903 |
virtual void MkDirL(const TDesC& aName) =0; |
|
904 |
||
905 |
||
906 |
/** |
|
907 |
Removes the directory specified by aName (its full name) from the volume. |
|
908 |
||
909 |
The directory specified by aName is in the form: |
|
910 |
@code |
|
911 |
\\dirA\\dirB\\dirC\\dirD |
|
912 |
@endcode |
|
913 |
where dirD is the directory to be removed from \\dirA\\dirB\\dirC\\. |
|
914 |
This means that dirC is the leaf directory from which dirD should be removed. |
|
915 |
||
916 |
The function can assume that the directory exists and is not read-only. |
|
917 |
||
918 |
The function should leave with a suitable error code if it cannot complete |
|
919 |
successfully for any reason. |
|
920 |
||
921 |
@param aName A reference to a descriptor containing the full name of |
|
922 |
the directory to be removed. |
|
923 |
||
924 |
@leave KErrInUse dirD contains entries other than the parent (..) |
|
925 |
and current (.) entries. |
|
926 |
*/ |
|
927 |
virtual void RmDirL(const TDesC& aName) =0; |
|
928 |
||
929 |
||
930 |
/** |
|
931 |
Deletes the specified file from the mount. |
|
932 |
||
933 |
The function can assume that the file is closed. |
|
934 |
||
935 |
The file name specified by aName is of the form: |
|
936 |
@code |
|
937 |
\\dirA\\dirB\\dirC\\file.ext |
|
938 |
@endcode |
|
939 |
||
940 |
The extension is optional. |
|
941 |
||
942 |
The function should leave on error detection, with |
|
943 |
an appropriate error code. |
|
944 |
||
945 |
@param aName A reference to a descriptor containing the full path name |
|
946 |
of the file that will be removed. |
|
947 |
||
948 |
@leave KErrAccessDenied aName specifies a file whose attributes state that |
|
949 |
the file is read-only or aName specifies a directory. |
|
950 |
*/ |
|
951 |
virtual void DeleteL(const TDesC& aName) =0; |
|
952 |
||
953 |
||
954 |
/** |
|
955 |
Renames or moves a single file or directory on the mount. |
|
956 |
||
957 |
It can be used to move a file or directory since both |
|
958 |
anOldName and anNewName specify the respective entries with full names; |
|
959 |
for example, |
|
960 |
@code |
|
961 |
\\dirA\\dirB\\dirC\\oldEntryName |
|
962 |
@endcode |
|
963 |
||
964 |
and |
|
965 |
||
966 |
@code |
|
967 |
\\dirE\\dirF\\dirG\\newEntryName |
|
968 |
@endcode |
|
969 |
||
970 |
If oldEntryName is a file, it can be assumed that it is closed. |
|
971 |
If oldEntryName is a directory, it can be assumed that there are no |
|
972 |
open files in this directory. Furthermore, if newEntryName specifies |
|
973 |
a directory, it can be assumed that it is not a subdirectory of oldEntryName. |
|
974 |
||
975 |
The function should leave with an appropriate error code if it cannot |
|
976 |
complete successfully for any reason. |
|
977 |
||
978 |
@param anOldName A reference to a descriptor containing the full entry |
|
979 |
name of the entry to be renamed. |
|
980 |
||
981 |
@param anNewName A reference to a descriptor containing the new full entry |
|
982 |
name for the entry to be renamed. |
|
983 |
||
984 |
@leave KErrAlreadyExists The new entry already exists. |
|
985 |
*/ |
|
986 |
virtual void RenameL(const TDesC& anOldName,const TDesC& anNewName) =0; |
|
987 |
||
988 |
||
989 |
/** |
|
990 |
Replaces one file on the mount with another. |
|
991 |
||
992 |
The function can assume that both anOldName and, if it exists, anNewName |
|
993 |
contain the full file names of files, and that these files are not open. |
|
994 |
||
995 |
If the file aNewName does not exist it should be created. |
|
996 |
||
997 |
The file anOldName should have its contents, attributes, and the universal |
|
998 |
date and time of its last modification, copied to the file aNewName, |
|
999 |
overwriting any existing contents and attribute details. |
|
1000 |
Finally anOldName should be deleted. |
|
1001 |
||
1002 |
The function should leave with an appropriate error code if it cannot |
|
1003 |
complete successfully for any reason. |
|
1004 |
||
1005 |
@param anOldName A reference to a descriptor containing the full file name |
|
1006 |
of the file to replace the file specified by anNewName |
|
1007 |
@param anNewName A reference to a descriptor containing the new full file |
|
1008 |
name for the entry to be replaced. |
|
1009 |
*/ |
|
1010 |
virtual void ReplaceL(const TDesC& anOldName,const TDesC& anNewName) =0; |
|
1011 |
||
1012 |
||
1013 |
/** |
|
1014 |
Gets the entry details for the specified file or directory. |
|
1015 |
||
1016 |
anEntry should be filled with details from the file or directory with the |
|
1017 |
full name aName. aName is of the form |
|
1018 |
@code |
|
1019 |
\\dirA\\dirB\\dirC\\entry. |
|
1020 |
@endcode |
|
1021 |
||
1022 |
Note that anEntry.iType (the entry UID) should only be set for a file whose |
|
1023 |
size is greater than or equal to sizeof(TCheckedUid). |
|
1024 |
||
1025 |
The function should leave with an appropriate error code if it cannot |
|
1026 |
complete successfully for any reason. |
|
1027 |
||
1028 |
@param aName A reference to a descriptor containing the full name of |
|
1029 |
the entry whose details are required. |
|
1030 |
@param anEntry On return, a reference to the filled entry object. |
|
1031 |
||
1032 |
@leave KErrPathNotFound The entry, aName, cannot be found. |
|
1033 |
*/ |
|
1034 |
virtual void EntryL(const TDesC& aName,TEntry& anEntry) const =0; |
|
1035 |
||
1036 |
||
1037 |
/** |
|
1038 |
Sets entry details for a specified file or directory. |
|
1039 |
||
1040 |
The entry identfied by the full name descriptor aName should have |
|
1041 |
its modification time and its attributes mask updated as required. |
|
1042 |
||
1043 |
The entry receives a new universal modified time from aTime. |
|
1044 |
The entry attributes are set with aSetAttMask and cleared |
|
1045 |
with aClearAttMask: |
|
1046 |
the bits that are set in aSetAttMask should be set |
|
1047 |
in the entry attribute mask; |
|
1048 |
the bits that are set in aClearAttMask |
|
1049 |
should be cleared from the entry attribute mask. |
|
1050 |
||
1051 |
The function can assume that aSetAttMask and aClearAttMask do not change |
|
1052 |
the type of attribute (i.e. volume or directory). Furthermore, if aName |
|
1053 |
specifies a file, it can be assumed that this file is closed. |
|
1054 |
||
1055 |
The function should leave with an appropriate error code on error detection. |
|
1056 |
||
1057 |
@param aName A reference to a descriptor containing the full name of |
|
1058 |
the entry to be updated. |
|
1059 |
@param aTime A reference to the time object holding the new universal |
|
1060 |
modified time for aName. |
|
1061 |
@param aSetAttMask Attribute mask for setting the entry's attributes. |
|
1062 |
@param aClearAttMask Attribute mask for clearing the entry's attributes. |
|
1063 |
*/ |
|
1064 |
virtual void SetEntryL(const TDesC& aName,const TTime& aTime,TUint aSetAttMask,TUint aClearAttMask) =0; |
|
1065 |
||
1066 |
||
1067 |
/** |
|
1068 |
Customises the opening of a new or existing file on the mount. |
|
1069 |
||
1070 |
The function is called internally (via TDrive::FileOpen()) as a result of |
|
1071 |
a call by the client, and the file is created, if necessary, and opened by |
|
1072 |
the calling function. However this function implements any replacement |
|
1073 |
functionality, as well as any other behaviour particular to the file system. |
|
1074 |
||
1075 |
If anOpen specifies EFileReplace (rather than EFileCreate or EFileOpen) then, |
|
1076 |
if replacement functionality is required, the data contained in the file |
|
1077 |
should be discarded, the archive attribute should be set, and the size of |
|
1078 |
the file should be set to zero. Note that it can be assumed that if anOpen |
|
1079 |
specifies EFileReplace then the file already exists. |
|
1080 |
||
1081 |
After successful completion of the function, the file control block pointer |
|
1082 |
will be added to the file server's global files container. |
|
1083 |
||
1084 |
The function should leave with a suitable error code if it cannot be completed |
|
1085 |
successfully. |
|
1086 |
||
1087 |
@param aName The full name of the file that will be opened. |
|
1088 |
@param aMode The file share mode. The following share modes are available: |
|
1089 |
EFileShareExclusive; |
|
1090 |
EFileShareReadersOnly; |
|
1091 |
EFileShareAny; |
|
1092 |
EFileShareReadersOrWriters; |
|
1093 |
EFileStream; |
|
1094 |
EFileStreamText; |
|
1095 |
EFileRead; |
|
1096 |
EFileWrite. |
|
1097 |
@param anOpen IndicatES how the file will be opened. It can be one of |
|
1098 |
the following: |
|
1099 |
EFileOpen; |
|
1100 |
EFileCreate; |
|
1101 |
EFileReplace. |
|
1102 |
@param aFile Pointer to the file control block which will, on success, |
|
1103 |
represent the open file. |
|
1104 |
||
1105 |
@leave KErrAccessDenied aName may specify a directory, or the function may |
|
1106 |
be attempting to open a file on a ROM drive. |
|
1107 |
*/ |
|
1108 |
virtual void FileOpenL(const TDesC& aName,TUint aMode,TFileOpen anOpen,CFileCB* aFile) =0; |
|
1109 |
||
1110 |
||
1111 |
/** |
|
1112 |
Customises the opening of a directory on the mount. |
|
1113 |
||
1114 |
The function is called internally, and the directory will have been created |
|
1115 |
and initialised by the calling function. Any customisation specific to |
|
1116 |
a file system should be implemented in this function. |
|
1117 |
||
1118 |
Note that aName is of the form |
|
1119 |
@code |
|
1120 |
\\dirA\\dirB\\dirC\\file.ext |
|
1121 |
@endcode |
|
1122 |
||
1123 |
where \\dirA\\dirB\\dirC\\ is the directory to be opened and file.ext is |
|
1124 |
an optional entry name and extension. |
|
1125 |
||
1126 |
After successful completion of the function, the directory control block |
|
1127 |
pointer will be added to the file server global directories container. |
|
1128 |
||
1129 |
The function should leave with a suitable error code if it cannot complete |
|
1130 |
successfully for any reason. |
|
1131 |
||
1132 |
@param aName A reference to a descriptor containing the full name of |
|
1133 |
the directory that will be opened. |
|
1134 |
@param aDir Points to a directory control block which will, on success, |
|
1135 |
represent the open directory. |
|
1136 |
*/ |
|
1137 |
virtual void DirOpenL(const TDesC& aName,CDirCB* aDir) =0; |
|
1138 |
||
1139 |
||
1140 |
/** |
|
1141 |
Reads the specified length of data from the specified position on |
|
1142 |
the volume directly into the client thread. |
|
1143 |
||
1144 |
It can be assumed that if this function is called, |
|
1145 |
then there has been a successful mount. |
|
1146 |
||
1147 |
This function should leave with an appropriate error code when |
|
1148 |
an error is detected. |
|
1149 |
||
1150 |
@param aPos Start position in the volume for the read operation, |
|
1151 |
in bytes. |
|
1152 |
@param aLength The number of bytes to be read. |
|
1153 |
@param aTrg A pointer to the buffer into which data is to be read. |
|
1154 |
@param anOffset The offset at which to start adding data to the read buffer. |
|
1155 |
@param aMessage |
|
1156 |
*/ |
|
1157 |
virtual void RawReadL(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt anOffset,const RMessagePtr2& aMessage) const = 0; |
|
1158 |
||
1159 |
||
1160 |
/** |
|
1161 |
Writes a specified length of data from the client thread to the volume |
|
1162 |
at the specified position. |
|
1163 |
||
1164 |
It can be assumed that if this function is called, then there has been |
|
1165 |
a successful mount. |
|
1166 |
||
1167 |
This function should leave with an appropriate error code when |
|
1168 |
an error is detected. |
|
1169 |
||
1170 |
@param aPos Start position in the volume for the write operation, |
|
1171 |
in bytes. |
|
1172 |
@param aLength The number of bytes to be written. |
|
1173 |
@param aSrc Pointer to the buffer from which data will be written. |
|
1174 |
@param anOffset The offset in the buffer at which to start writing data. |
|
1175 |
@param aMessage |
|
1176 |
*/ |
|
1177 |
virtual void RawWriteL(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt anOffset,const RMessagePtr2& aMessage) = 0; |
|
1178 |
||
1179 |
||
1180 |
/** |
|
1181 |
Gets the short name of the file or directory with the given full name. |
|
1182 |
||
1183 |
This function is used in circumstances where a file system mangles |
|
1184 |
Symbian OS natural names, in order to be able to store them on |
|
1185 |
a file system that is not entirely compatible. |
|
1186 |
||
1187 |
The function should leave with a suitable error code if it cannot complete |
|
1188 |
successfully for any reason. |
|
1189 |
||
1190 |
@param aLongName A reference to a descriptor containing the full name |
|
1191 |
of the entry. |
|
1192 |
@param aShortName On return, a reference to a descriptor containing |
|
1193 |
the short name of the entry. |
|
1194 |
||
1195 |
@leave KErrNotFound The entry specified by its long name cannot be found. |
|
1196 |
*/ |
|
1197 |
virtual void GetShortNameL(const TDesC& aLongName,TDes& aShortName) = 0; |
|
1198 |
||
1199 |
||
1200 |
/** |
|
1201 |
Gets the long name of the file or directory associated with |
|
1202 |
the given short name. |
|
1203 |
||
1204 |
This function is used in circumstances where a file system mangles |
|
1205 |
Symbian OS natural names in order to be able to store them on |
|
1206 |
a file system that is not entirely compatible. |
|
1207 |
||
1208 |
The function should leave with a suitable error code if it cannot complete |
|
1209 |
successfully for any reason. |
|
1210 |
||
1211 |
@param aShorName A reference to a descriptor containing the short name |
|
1212 |
of the entry. |
|
1213 |
||
1214 |
@param aLongName On return, a reference to a descriptor containing |
|
1215 |
the long name of the entry. |
|
1216 |
||
1217 |
@leave KErrNotFound The entry specified by its short name cannot be found. |
|
1218 |
*/ |
|
1219 |
virtual void GetLongNameL(const TDesC& aShorName,TDes& aLongName) = 0; |
|
1220 |
||
1221 |
||
1222 |
/** |
|
1223 |
Reads a specified section of the file, regardless of the file's lock state. |
|
1224 |
||
1225 |
The function should leave with a suitable error code if it cannot complete |
|
1226 |
successfully for any reason. |
|
1227 |
||
1228 |
@param aName A reference to a descriptor containing the full name of |
|
1229 |
the file to be read from |
|
1230 |
@param aPos The byte position to start reading from. |
|
1231 |
@param aTrg A pointer to the buffer into which data is to be read. |
|
1232 |
@param aLength The length of data to be read, in bytes. |
|
1233 |
@param aMessage |
|
1234 |
||
1235 |
@leave KErrEof aPos is past the end of the file. |
|
1236 |
*/ |
|
1237 |
virtual void ReadSectionL(const TDesC& aName,TInt aPos,TAny* aTrg,TInt aLength,const RMessagePtr2& aMessage)=0; |
|
1238 |
||
1239 |
||
1240 |
/** |
|
1241 |
Checks the integrity of the file system on the volume and returns an appropriate error value. |
|
1242 |
The default implementation must be overridden by a derived class. |
|
1243 |
||
1244 |
@return KErrNone if the file system is stable; otherwise one of the other system wide error codes. |
|
1245 |
The default implementation returns KErrNotSupported. |
|
1246 |
*/ |
|
1247 |
virtual TInt CheckDisk() {return(KErrNotSupported);} |
|
1248 |
||
1249 |
/** |
|
1250 |
The same as original CheckDisk(), but with some parameters. |
|
1251 |
*/ |
|
1252 |
virtual TInt CheckDisk(TInt aOperation, TAny* aParam1=NULL, TAny* aParam2=NULL); |
|
1253 |
||
1254 |
||
1255 |
/** |
|
1256 |
Scans through and corrects errors found in the volume. |
|
1257 |
||
1258 |
The default implementation must be overridden by a derived class. |
|
1259 |
||
1260 |
@return KErrNone if no errors are found or all errors are corrected; otherwise one of the other system wide error codes. |
|
1261 |
The default implementation returns KErrNotSupported. |
|
1262 |
*/ |
|
1263 |
virtual TInt ScanDrive() {return(KErrNotSupported);} |
|
1264 |
||
1265 |
/** |
|
1266 |
The same as original ScanDrive(), but with some parameters. |
|
1267 |
*/ |
|
1268 |
virtual TInt ScanDrive(TInt aOperation, TAny* aParam1=NULL, TAny* aParam2=NULL); |
|
1269 |
||
1270 |
IMPORT_C virtual void IsFileInRom(const TDesC& aFileName,TUint8*& aFileStart); |
|
1271 |
||
1272 |
||
1273 |
/** |
|
1274 |
Low-level control IO |
|
1275 |
*/ |
|
1276 |
virtual TInt ControlIO( const RMessagePtr2& /*aMessage*/,TInt /*aCommand*/,TAny* /*aParam1*/,TAny* /*aParam2*/) {return(KErrNotSupported);} |
|
1277 |
||
1278 |
||
1279 |
/** |
|
1280 |
Locks a media which supports password protection and replaces |
|
1281 |
the old password with a new one. |
|
1282 |
||
1283 |
If aStore is set to ETrue, then the new password should be saved to |
|
1284 |
the password store file, KMediaPWrdFile, using the exported file server |
|
1285 |
function WriteToDisk(). |
|
1286 |
||
1287 |
The password file is used to initialise the password store on boot up, |
|
1288 |
so the user does not need to be prompted for the password again if |
|
1289 |
it is saved here. |
|
1290 |
||
1291 |
The default implementation must be overridden in a derived class. |
|
1292 |
||
1293 |
@param aOld A reference to the old password. |
|
1294 |
@param aNew A reference to the new password. |
|
1295 |
@param aStore ETrue if the new password is to be saved to |
|
1296 |
the password file store; EFalse if not. |
|
1297 |
||
1298 |
@return KErrNone if successful; otherwise another of the system wide |
|
1299 |
error codes. The default implementation returns KErrNotSupported. |
|
1300 |
*/ |
|
1301 |
virtual TInt Lock(TMediaPassword& /*aOld*/,TMediaPassword& /*aNew*/,TBool /*aStore*/) {return(KErrNotSupported);} |
|
1302 |
||
1303 |
||
1304 |
/** |
|
1305 |
Unlocks a media which supports password protection. |
|
1306 |
||
1307 |
If aStore is set to ETrue then the password should be saved to |
|
1308 |
the password store file specified by KMediaPWrdFile using the exported file |
|
1309 |
server function WriteToDisk(). |
|
1310 |
||
1311 |
The password file is used to initialise the password store on boot up, |
|
1312 |
so the user does not need to be prompted for the password again if |
|
1313 |
it is saved here. |
|
1314 |
||
1315 |
The default implementation must be overridden in a derived class. |
|
1316 |
||
1317 |
@param aPassword A reference to the password. |
|
1318 |
@param aStore ETrue if the password is to be saved to |
|
1319 |
the password store file; EFalse otherwise. |
|
1320 |
||
1321 |
@return KErrNone if successful; otherwise another of the system wide |
|
1322 |
error codes. The default implementation returns KErrNotSupported. |
|
1323 |
*/ |
|
1324 |
virtual TInt Unlock(TMediaPassword& /*aPassword*/,TBool /*aStore*/) {return(KErrNotSupported);} |
|
1325 |
||
1326 |
||
1327 |
/** |
|
1328 |
Clears a password from a media that supports write protection. |
|
1329 |
||
1330 |
The default implementation must be overridden in a derived class. |
|
1331 |
||
1332 |
@param aPassword A reference to the password to be cleared. |
|
1333 |
||
1334 |
@return KErrNone if successful; otherwise another of the system wide |
|
1335 |
error codes. The default implementation returns KErrNotSupported. |
|
1336 |
*/ |
|
1337 |
virtual TInt ClearPassword(TMediaPassword& /*aPassword*/) {return(KErrNotSupported);} |
|
1338 |
||
1339 |
||
1340 |
/** |
|
1341 |
*/ |
|
1342 |
virtual TInt ForceRemountDrive(const TDesC8* /*aMountInfo*/,TInt /*aMountInfoMessageHandle*/,TUint /*aFlags*/) {return(KErrNotSupported);} |
|
1343 |
||
1344 |
||
1345 |
/** |
|
1346 |
Legacy method: finalise the mount and put it to the consistent state. |
|
1347 |
*/ |
|
1348 |
virtual void FinaliseMountL() {return;} |
|
1349 |
||
1350 |
/** |
|
1351 |
finalise the mount and put it to the consistent state. |
|
1352 |
||
1353 |
@param aOperation describes finalisation operation, see RFs::TFinaliseDrvMode |
|
1354 |
@param aParam1 not used, for future expansion |
|
1355 |
@param aParam2 not used, for future expansion |
|
1356 |
*/ |
|
1357 |
virtual void FinaliseMountL(TInt aOperation, TAny* aParam1=NULL, TAny* aParam2=NULL); |
|
1358 |
||
1359 |
||
1360 |
protected: |
|
1361 |
/** Mount Control levels or operations to perform */ |
|
1362 |
enum TMntCtlLevel |
|
1363 |
{ |
|
1364 |
//-- reserved generic mount (CMountCB) control codes |
|
1365 |
||
1366 |
EMountStateQuery, ///< query mount state, see TMntCtlOption, ESQ_IsMountFinalised |
|
1367 |
EMountVolParamQuery, ///< mount-specific queries for volume parameters. See ESQ_RequestFreeSpace, ESQ_GetCurrentFreeSpace |
|
1368 |
ECheckFsMountable, ///< extended mount functionality, checks if this file system can be mounted on specified drive. See CheckFileSystemMountable() |
|
1369 |
||
1370 |
//-- starting from the next code someone may define some specific mount type control codes, like ESpecificMountCtl+17 |
|
1371 |
ESpecificMountCtl = 0x40000000, |
|
1372 |
||
1373 |
//-- starting from the next code someone may define some specific File System control codes |
|
1374 |
ESpecificFsCtl = 0x40001000, |
|
1375 |
||
1376 |
EMountFsParamQuery, ///< File System parameters queries; File System properties can be "static" i.e not requiring properly mounted volume. See ESpecificFsCtlOpt |
|
1377 |
||
1378 |
}; |
|
1379 |
||
1380 |
/** Mount Control options that makes sense only for certain control codes, see TMntCtlLevel */ |
|
1381 |
enum TMntCtlOption |
|
1382 |
{ |
|
1383 |
//-- reserved generic mount (CMountCB) control options codes |
|
1384 |
||
1385 |
/** query if the mount is finalised, corresponds to the EMountStateQuery control code only. @see IsMountFinalised() */ |
|
1386 |
ESQ_IsMountFinalised, |
|
1387 |
||
1388 |
//----------------------------------------------------------------------------------------------------------------------------- |
|
1389 |
||
1390 |
//-- starting from the next code someone may define some specific mount type control options |
|
1391 |
ESpecificMountCtlOpt = 0x40000000, |
|
1392 |
||
1393 |
/** Corresponds to EMountVolParamQuery. Request a certain amount of free space on the volume. @see RequestFreeSpace() */ |
|
1394 |
ESQ_RequestFreeSpace, |
|
1395 |
||
1396 |
/** Corresponds to EMountVolParamQuery. A request to obtain the _current_ amount of free space on the volume asynchronously, without blocking. */ |
|
1397 |
ESQ_GetCurrentFreeSpace, |
|
1398 |
||
1399 |
/** Corresponds to EMountVolParamQuery. A request to obtain size of the mounted volume without blocking (CMountCB::VolumeL() can block). */ |
|
1400 |
ESQ_MountedVolumeSize, |
|
1401 |
||
1402 |
//----------------------------------------------------------------------------------------------------------------------------- |
|
1403 |
||
1404 |
//-- starting from the next code someone may define some specific File System control options |
|
1405 |
ESpecificFsCtlOpt = 0x40001000, |
|
1406 |
||
1407 |
/** Get Maximum file size, which is supported by the file system that has produced this mount. */ |
|
1408 |
ESQ_GetMaxSupportedFileSize, |
|
1409 |
||
1410 |
}; |
|
1411 |
||
1412 |
||
1413 |
public: |
|
1414 |
||
1415 |
/** |
|
1416 |
Generic mount control method. |
|
1417 |
@param aLevel specifies the operation to perfrom on the mount |
|
1418 |
@param aOption specific option for the given operation |
|
1419 |
@param aParam pointer to generic parameter, its meaning depends on aLevel and aOption |
|
1420 |
||
1421 |
@return standard error code. Default imlementation returns KErrNotSupported |
|
1422 |
*/ |
|
1423 |
virtual TInt MountControl(TInt aLevel, TInt aOption, TAny* aParam); |
|
1424 |
||
1425 |
||
1426 |
/** |
|
1427 |
Erase a password from a media that supports write protection. |
|
1428 |
||
1429 |
The default implementation must be overridden in a derived class. |
|
1430 |
||
1431 |
@return KErrNone if successful; otherwise another of the system wide |
|
1432 |
error codes. The default implementation returns KErrNotSupported. |
|
1433 |
*/ |
|
1434 |
virtual TInt ErasePassword() {return(KErrNotSupported);} |
|
1435 |
||
1436 |
/** |
|
1437 |
An interface class which may optionally be returned by a file system |
|
1438 |
by calling GetInterface(EFileAccessor, ...) |
|
1439 |
*/ |
|
1440 |
class MFileAccessor |
|
1441 |
{ |
|
1442 |
public: |
|
1443 |
virtual TInt GetFileUniqueId(const TDesC& aName, TInt64& aUniqueId) = 0; |
|
1444 |
virtual TInt Spare3(TInt aVal, TAny* aPtr1, TAny* aPtr2) = 0; |
|
1445 |
virtual TInt Spare2(TInt aVal, TAny* aPtr1, TAny* aPtr2) = 0; |
|
1446 |
virtual TInt Spare1(TInt aVal, TAny* aPtr1, TAny* aPtr2) = 0; |
|
1447 |
}; |
|
1448 |
||
1449 |
/** |
|
1450 |
@prototype |
|
1451 |
||
1452 |
CMountCB::MFileExtendedInterface interface provides extended interface for CMountCB to |
|
1453 |
read a specified section of large file (size greater than 2GB - 1). |
|
1454 |
||
1455 |
The interface could be retrieved by calling CMountCB::GetInterface() with |
|
1456 |
EFileExtendedInterface as an argument. |
|
1457 |
||
1458 |
Sub classes of CMountCB who does support large file access will need to multiple-inherit |
|
1459 |
with this class and implement the interface. The implementation of the interface will be |
|
1460 |
retrieved via GetInterface() and provided to user by non-virtual APIs to avoid breaking |
|
1461 |
binary compatibility. |
|
1462 |
||
1463 |
NOTE: Do not try to delete CMountCB::MFileExtendedInterface interface pointer! |
|
1464 |
||
1465 |
@see CMountCB::GetInterface() |
|
1466 |
*/ |
|
1467 |
||
1468 |
class MFileExtendedInterface |
|
1469 |
{ |
|
1470 |
public: |
|
1471 |
/** |
|
1472 |
Reads a specified section of the file, regardless of the file's lock state. |
|
1473 |
||
1474 |
The function should leave with a suitable error code if it cannot complete |
|
1475 |
successfully for any reason. |
|
1476 |
||
1477 |
This function should be implemented in file systems supporting files |
|
1478 |
of size greater than 2GB - 1. |
|
1479 |
||
1480 |
@param aName A reference to a descriptor containing the full name of |
|
1481 |
the file to be read from |
|
1482 |
@param aPos The byte position to start reading from. |
|
1483 |
@param aTrg A pointer to the buffer into which data is to be read. |
|
1484 |
@param aLength The length of data to be read, in bytes. |
|
1485 |
@param aMessage |
|
1486 |
||
1487 |
@leave KErrEof aPos is past the end of the file. |
|
1488 |
||
1489 |
@see CMountCB::ReadSectionL() |
|
1490 |
*/ |
|
1491 |
virtual void ReadSection64L(const TDesC& aName, TInt64 aPos, TAny* aTrg, TInt aLength, const RMessagePtr2& aMessage) = 0; |
|
1492 |
}; |
|
1493 |
||
1494 |
/** |
|
1495 |
Enumeration of the aInterfaceIDs used in GetInterface. |
|
1496 |
*/ |
|
1497 |
enum TInterfaceIds |
|
1498 |
{ |
|
1499 |
EAddFsToCompositeMount = 0, |
|
1500 |
EGetLocalDrive = 1, |
|
1501 |
EFileAccessor = 2, |
|
1502 |
EGetFileSystemSubType = 3, |
|
1503 |
EGetClusterSize = 4, |
|
1504 |
ELocalBufferSupport = 5, |
|
1505 |
EAddToCompositeMount = 6, |
|
1506 |
EGetProxyDrive = 7, |
|
1507 |
EFileExtendedInterface = 8 |
|
1508 |
}; |
|
1509 |
||
1510 |
// File clamping support |
|
1511 |
TInt ClampFile(const TInt aDriveNo,const TDesC& aName,TAny* aHandle); |
|
1512 |
TInt UnclampFile(RFileClamp* aHandle); |
|
1513 |
IMPORT_C TInt IsFileClamped(const TInt64 aUniqueId); |
|
1514 |
TInt NoOfClamps(); |
|
1515 |
||
1516 |
// File accessor support |
|
1517 |
TInt GetFileUniqueId(const TDesC& aName, TInt64& aUniqueId); |
|
1518 |
TInt Spare3(TInt aVal, TAny* aPtr1, TAny* aPtr2); |
|
1519 |
TInt Spare2(TInt aVal, TAny* aPtr1, TAny* aPtr2); |
|
1520 |
TInt Spare1(TInt aVal, TAny* aPtr1, TAny* aPtr2); |
|
1521 |
||
1522 |
// Extensions of interface |
|
1523 |
TInt FileSystemSubType(TDes& aName); |
|
1524 |
TInt FileSystemClusterSize(); |
|
1525 |
void FileSystemName(TDes& aName); |
|
1526 |
||
1527 |
// Large file support |
|
1528 |
void ReadSection64L(const TDesC& aName,TInt64 aPos,TAny* aTrg,TInt aLength,const RMessagePtr2& aMessage); |
|
1529 |
||
1530 |
inline TInt CheckFileSystemMountable(); |
|
1531 |
inline TInt RequestFreeSpace(TUint64 &aFreeSpaceBytes); |
|
1532 |
inline TInt MountedVolumeSize(TUint64& aVolSizeBytes); |
|
1533 |
inline TInt GetCurrentFreeSpaceAvailable(TInt64 &aFreeSpaceBytes); |
|
1534 |
inline TInt IsMountFinalised(TBool &aFinalised); |
|
1535 |
inline TInt GetMaxSupportedFileSize(TUint64 &aSize); |
|
1536 |
||
1537 |
protected: |
|
1538 |
inline void SetMountNumber(TInt aMountNumber); |
|
1539 |
inline void SetDismounted(TBool aDismounted=ETrue); |
|
1540 |
inline TInt MountNumber() const; |
|
1541 |
inline TBool IsDismounted() const; |
|
1542 |
||
1543 |
void SetProxyDriveDismounted(); |
|
1544 |
TBool ProxyDriveDismounted(); |
|
1545 |
||
1546 |
IMPORT_C CFileSystem* FileSystem() const; |
|
1547 |
||
1548 |
/** |
|
1549 |
Return a pointer to a specified interface extension - to allow future extension of this class without breaking |
|
1550 |
binary compatibility. |
|
1551 |
@param aInterfaceId Interface identifier of the interface to be retrieved. |
|
1552 |
@param aInterface A reference to a pointer that retrieves the specified interface. |
|
1553 |
@param aInput An arbitrary input argument. |
|
1554 |
@return KErrNone If the interface is supported, KErrNotSupported otherwise. |
|
1555 |
*/ |
|
1556 |
IMPORT_C virtual TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput); |
|
1557 |
||
1558 |
// calls GetInterface() with tracepoints added |
|
1559 |
TInt GetInterfaceTraced(TInt aInterfaceId,TAny*& aInterface,TAny* aInput); |
|
1560 |
||
299 | 1561 |
public: |
1562 |
/* |
|
1563 |
* This function is provided for file systems to issue notifications to file server clients |
|
1564 |
* that have registered for notifications using the RFs::NotifyChange and CFsNotify client-side APIs. |
|
1565 |
* |
|
1566 |
* @param aNotificationInfo This object should contain the relevant Source (and if appropriate, NewName) |
|
1567 |
* as well as any other required information. |
|
1568 |
* |
|
1569 |
* The Source provided should be a fullpath of the form: |
|
1570 |
* \[path\]directory\ - in the case of changes to a directory |
|
1571 |
* \[path\]filename.ext - in the case of changes to a file |
|
1572 |
* |
|
1573 |
* The drive letter information is not to be included. |
|
1574 |
* |
|
1575 |
* In the case of 'File Write' or 'File Set Size' operations, the resulting file size must be set. |
|
1576 |
* @see CFsNotificationInfo::SetFileSize |
|
1577 |
* |
|
1578 |
* In the case of a attributes change, the attributes set and cleared must be set. |
|
1579 |
* @see CFsNotificationInfo::SetAttributes |
|
1580 |
* |
|
1581 |
* All CFsNotificationInfo objects must have a Uid set. This is the Uid of the |
|
1582 |
* process which caused the change. i.e. A photo browser may wish to know if it was the camera app |
|
1583 |
* or the photo editor which has caused a change. @see CFsNotificationInfo::SetUID |
|
1584 |
* |
|
1585 |
* @see class TFsNotification. |
|
1586 |
* |
|
1587 |
* @return Symbian Standard error code. KErrNone on success. |
|
1588 |
*/ |
|
1589 |
IMPORT_C TInt IssueNotification(CFsNotificationInfo* aNotificationInfo); |
|
1590 |
||
0 | 1591 |
private: |
1592 |
void SetFileSystem(CFileSystem* aFS); |
|
1593 |
||
1594 |
//-- these factory methods mus be used to produce objects representing files, directories etc. as soon as all these objects are |
|
1595 |
//-- associated with the mount, not the file sytem (file system is a factory for corresponding mounts) |
|
1596 |
//-- corresponding CFileSystem:: methods must not be used. |
|
1597 |
//-- CMountCB has a reference to the CFileSystem that produced it. |
|
1598 |
CFileCB* NewFileL() const; |
|
1599 |
CDirCB* NewDirL() const; |
|
1600 |
CFormatCB* NewFormatL() const; |
|
1601 |
||
1602 |
protected: |
|
1603 |
||
1604 |
TInt iMountNumber; ///< Unique mount number set by the TDrive object representing the drive on which the object resides. |
|
1605 |
TUint iUniqueID; ///< volume Unique ID. Set in MountL(). |
|
1606 |
TInt64 iSize; ///< Size of the volume. First set in MountL(). |
|
1607 |
||
1608 |
/** |
|
1609 |
A list of all open files on that mount. |
|
1610 |
Set by the TDrive object representing the drive of which the mount resides. |
|
1611 |
*/ |
|
1612 |
TDblQue<CFileCB> iMountQ; |
|
1613 |
||
1614 |
friend class TDrive; |
|
1615 |
friend class TFsAddCompositeMount; |
|
1616 |
||
1617 |
private: |
|
1618 |
TInt iLockMount; |
|
1619 |
TDrive* iDrive; |
|
1620 |
HBufC* iVolumeName; |
|
1621 |
CMountBody* iBody; ///< used for extending CMountCB functionality |
|
1622 |
}; |
|
1623 |
||
1624 |
||
1625 |
/** |
|
1626 |
@internalTechnology |
|
1627 |
||
1628 |
MFileSystemSubType interface provides extended interface for CMountCB to retrieve sub type |
|
1629 |
of mounted file systems. |
|
1630 |
||
1631 |
The interface could be retrieved by calling CMountCB::GetInterface() with EGetFileSystemSubType |
|
1632 |
as an argument. |
|
1633 |
||
1634 |
If the file system does not support sub types, MFileSystemSubType cannot be retieved. |
|
1635 |
Sub classes of CMountCB who does support sub types will need to multiple-inherit with |
|
1636 |
this class and implement the interface. The implementation of the interface will be |
|
1637 |
retrieved via GetInterface() and provided to user by non-virtual APIs to avoid breaking |
|
1638 |
binary compatibility. |
|
1639 |
||
1640 |
NOTE: Do not try to delete MFileSystemSubType interface pointer! |
|
1641 |
||
1642 |
@see CMountCB::GetInterface() |
|
1643 |
*/ |
|
1644 |
class MFileSystemSubType |
|
1645 |
{ |
|
1646 |
public: |
|
1647 |
/** |
|
1648 |
Retrieves file system's sub type name (E.g. FAT16), if the file system does not have sub |
|
1649 |
types (E.g. Rofs), return the file system's name. |
|
1650 |
@param aName Returned descriptor contains file system name or sub type name. |
|
1651 |
@return KErrNone if successful. |
|
1652 |
*/ |
|
1653 |
virtual TInt SubType(TDes& aName) const = 0; |
|
1654 |
}; |
|
1655 |
||
1656 |
/** |
|
1657 |
@internalTechnology |
|
1658 |
||
1659 |
MFileSystemClusterSize interface provides extended interface for CMountCB to retrieve cluster size |
|
1660 |
of mounted file systems. |
|
1661 |
||
1662 |
The interface could be retrieved by calling CMountCB::GetInterface() with EGetClusterSize |
|
1663 |
as an argument. |
|
1664 |
||
1665 |
If the file system does not support clustering, MFileSystemClusterSize cannot be retieved. |
|
1666 |
Sub classes of CMountCB who does support clustering will need to multiple-inherit with |
|
1667 |
this class and implement the interface. The implementation of the interface will be |
|
1668 |
retrieved via GetInterface() and provided to user by non-virtual APIs to avoid breaking |
|
1669 |
binary compatibility. |
|
1670 |
||
1671 |
NOTE: Do not try to delete MFileSystemSubType interface pointer! |
|
1672 |
||
1673 |
@see CMountCB::GetInterface() |
|
1674 |
*/ |
|
1675 |
class MFileSystemClusterSize |
|
1676 |
{ |
|
1677 |
public: |
|
1678 |
/** |
|
1679 |
Retrieves file system's cluster size |
|
1680 |
@return None-zero cluster size if successful. |
|
1681 |
*/ |
|
1682 |
virtual TInt ClusterSize() const = 0; |
|
1683 |
}; |
|
1684 |
||
1685 |
||
1686 |
class CFileShare; |
|
1687 |
||
1688 |
||
1689 |
||
1690 |
/** |
|
1691 |
@internalTechnology |
|
1692 |
*/ |
|
1693 |
class TAsyncReadRequest |
|
1694 |
{ |
|
1695 |
public: |
|
1696 |
TAsyncReadRequest(TInt64 aEndPos, CFileShare* aOwningShareP, CFsRequest* aRequestP); |
|
1697 |
TBool CompleteIfMatching(CFileShare* aOwningShareP, TRequestStatus* aStatusP, TInt aError); |
|
1698 |
private: |
|
1699 |
TAsyncReadRequest(); |
|
1700 |
public: |
|
1701 |
TInt64 iEndPos; // The request is completed file length >= iEndPos. |
|
1702 |
CFileShare* iOwningShareP; // The share that owns this outstanding request. |
|
1703 |
const TRequestStatus* iStatusP; // Used to identify the request when cancelling. |
|
1704 |
CSessionFs* iSessionP; // The owning session of the original request. |
|
1705 |
RMessage2 iMessage; // The message to be completed when data is available. |
|
1706 |
}; |
|
1707 |
||
1708 |
||
1709 |
/** |
|
1710 |
@internalTechnology |
|
1711 |
@released |
|
1712 |
||
1713 |
File share lock |
|
1714 |
||
1715 |
The lock specifies the lowest and highest position in the file to be locked. |
|
1716 |
Note that files may have many locks on it, but overlapping sections cannot be locked. |
|
1717 |
This is used by a file control block, a CFileCB object. |
|
1718 |
||
1719 |
@see CFileCB |
|
1720 |
*/ |
|
1721 |
class TFileShareLock |
|
1722 |
{ |
|
1723 |
public: |
|
1724 |
TFileShareLock(const CFileShare* aOwner, TUint64 aPosLow, TUint64 aPosHigh); |
|
1725 |
||
1726 |
||
1727 |
inline TUint64 PosLow() const; |
|
1728 |
inline TUint64 PosHigh() const; |
|
1729 |
inline TBool MatchOwner(const CFileShare* aShare) const; |
|
1730 |
||
1731 |
TBool MatchByPos(TUint64 aPosLow, TUint64 aPosHigh) const; |
|
1732 |
||
1733 |
private: |
|
1734 |
TFileShareLock(); |
|
1735 |
TFileShareLock(const TFileShareLock&); |
|
1736 |
TFileShareLock& operator=(const TFileShareLock&); |
|
1737 |
||
1738 |
private: |
|
1739 |
||
1740 |
const CFileShare* iOwner; ///<The owning file share object. |
|
1741 |
TUint64 iPosLow; ///<The start of the section of the file to be locked. |
|
1742 |
TUint64 iPosHigh; ///<The end of the section of the file to be locked. |
|
1743 |
||
1744 |
friend class CFileCB; |
|
1745 |
}; |
|
1746 |
||
1747 |
/** @internalTechnology */ |
|
1748 |
typedef RArray<TFileShareLock> TFileLocksArray; |
|
1749 |
||
1750 |
||
1751 |
/** |
|
1752 |
@publishedPartner |
|
1753 |
@released |
|
1754 |
||
1755 |
A file server interface class representing an open file. |
|
1756 |
||
1757 |
An instance of this object is referred to as a file control block. |
|
1758 |
||
1759 |
A file control block needs to be created for a specific file to be able to |
|
1760 |
access that file within a directory. |
|
1761 |
||
1762 |
A plug-in file system implements this class. |
|
1763 |
*/ |
|
1764 |
class CFileCB : public CFsDispatchObject |
|
1765 |
{ |
|
1766 |
public: |
|
1767 |
IMPORT_C CFileCB(); |
|
1768 |
IMPORT_C ~CFileCB(); |
|
1769 |
||
1770 |
IMPORT_C void InitL(TDrive* aDrive,TDrive* aCreatedDrive, HBufC* aName); |
|
1771 |
||
1772 |
inline void SetMount(CMountCB * aMount); |
|
1773 |
inline TDrive& Drive() const; |
|
1774 |
inline TDrive& CreatedDrive() const; |
|
1775 |
inline CMountCB& Mount() const; |
|
1776 |
inline HBufC& FileName() const; |
|
1777 |
inline HBufC& FileNameF() const; |
|
1778 |
inline TInt UniqueID() const; |
|
1779 |
TInt FindLock(TInt aPosLow,TInt aPosHigh); |
|
1780 |
TInt AddLock(CFileShare* aFileShare,TInt aPos,TInt aLength); |
|
1781 |
TInt RemoveLock(CFileShare* aFileShare,TInt aPos,TInt aLength); |
|
1782 |
TInt CheckLock(CFileShare* aFileShare,TInt aPos,TInt aLength); |
|
1783 |
void RemoveLocks(CFileShare* aFileShare); |
|
1784 |
inline TShare Share() const; |
|
1785 |
inline void SetShare(TShare aShare); |
|
1786 |
inline TInt Size() const; |
|
1787 |
inline void SetSize(TInt aSize); |
|
1788 |
inline TInt Att() const; |
|
1789 |
inline void SetAtt(TInt aAtt); |
|
1790 |
inline TTime Modified() const; |
|
1791 |
inline void SetModified(TTime aModified); |
|
1792 |
inline TBool FileCorrupt() const; |
|
1793 |
inline void SetFileCorrupt(TBool aFileCorrupt); |
|
1794 |
inline TBool BadPower() const; |
|
1795 |
inline void SetBadPower(TBool aBadPower); |
|
1796 |
inline TUint32 NameHash() const; |
|
1797 |
TInt CheckMount(); |
|
1798 |
inline TInt BlockMap(SBlockMapInfo& aInfo, TInt64& aStartPos, TInt64 aEndPos=-1); |
|
1799 |
inline TInt LocalDrive(TBusLocalDrive*& aLocalDrive); |
|
1800 |
||
1801 |
TBool LocalBufferSupport() const; |
|
1802 |
void SetLocalBufferSupport(TBool aEnabled); |
|
1803 |
||
1804 |
/** File caching support methods */ |
|
1805 |
||
1806 |
CFileCache* FileCache() const; |
|
1807 |
TInt FairSchedulingLen() const; |
|
1808 |
void ResetReadAhead(); |
|
1809 |
||
1810 |
void SetDeleteOnClose(); |
|
1811 |
TBool DeleteOnClose() const; |
|
1812 |
||
1813 |
||
1814 |
void SetNotifyAsyncReadersPending(TBool aNotifyAsyncReadersPending); |
|
1815 |
TBool NotifyAsyncReadersPending() const; |
|
1816 |
TInt CancelAsyncReadRequest(CFileShare* aShareP, TRequestStatus* aStatusP); |
|
1817 |
||
1818 |
/** Extended API support methods */ |
|
1819 |
||
1820 |
TBool ExtendedFileInterfaceSupported(); |
|
1821 |
void ReadL(TInt64 aPos,TInt& aLength,TDes8* aDes,const RMessagePtr2& aMessage, TInt aOffset); |
|
1822 |
void WriteL(TInt64 aPos,TInt& aLength,const TDesC8* aDes,const RMessagePtr2& aMessage, TInt aOffset); |
|
1823 |
void SetSizeL(TInt64 aSize); |
|
1824 |
||
1825 |
IMPORT_C TInt64 Size64() const; |
|
1826 |
IMPORT_C void SetSize64(TInt64 aSize, TBool aDriveLocked); |
|
1827 |
IMPORT_C void SetMaxSupportedSize(TUint64 aMaxFileSize); |
|
148 | 1828 |
IMPORT_C TBool DirectIOMode(const RMessagePtr2& aMessage); |
0 | 1829 |
|
1830 |
||
1831 |
TInt64 CachedSize64() const; |
|
1832 |
void SetCachedSize64(TInt64 aSize); |
|
1833 |
TInt FindLock64(TInt64 aPosLow,TInt64 aPosHigh); |
|
1834 |
TInt AddLock64(CFileShare* aFileShare,TInt64 aPos,TInt64 aLength); |
|
1835 |
TInt RemoveLock64(CFileShare* aFileShare,TInt64 aPos,TInt64 aLength); |
|
1836 |
TInt CheckLock64(CFileShare* aFileShare,TInt64 aPos,TInt64 aLength); |
|
1837 |
||
148 | 1838 |
/** Sequential mode */ |
1839 |
||
1840 |
IMPORT_C TBool IsSequentialMode() const; |
|
1841 |
void SetSequentialMode(TBool aSequential); |
|
1842 |
||
1843 |
/** |
|
1844 |
The FileShare List contains the file shares of an open file. |
|
1845 |
*/ |
|
1846 |
TDblQue<CFileShare>& FileShareList() const; |
|
1847 |
void AddShare(CFileShare& aFileShare); |
|
1848 |
||
0 | 1849 |
/** |
1850 |
Renames the file with the full file name provided. |
|
1851 |
||
1852 |
Because the full name of the file includes the path, the function can |
|
1853 |
also be used to move the file. |
|
1854 |
||
1855 |
It can be assumed that no other sub-session has access to the file: |
|
1856 |
i.e. the file has not been opened in EFileShareAny share mode. |
|
1857 |
It can also be assumed that the file has been opened for writing. |
|
1858 |
||
1859 |
The function should leave with KErrAlreadyExists if aNewName already exists. |
|
1860 |
An appropriate error code should also be generated if the function leaves |
|
1861 |
before completion for any other reason. |
|
1862 |
||
1863 |
@param aNewName The new full name of the file. |
|
1864 |
||
1865 |
@see CFileCB::iFileName |
|
1866 |
*/ |
|
1867 |
virtual void RenameL(const TDesC& aNewName) =0; |
|
1868 |
||
1869 |
||
1870 |
/** |
|
1871 |
Reads a specified number of bytes from the open file starting at |
|
1872 |
the specified postition, and writes the result into a descriptor. |
|
1873 |
||
1874 |
It can be assumed that aPos is inside the file and aLength > 0. |
|
1875 |
The file should only be read up to its end regardless of |
|
1876 |
the value of aPos + aLength. The number of bytes read should be stored |
|
1877 |
in aLength on return. |
|
1878 |
||
1879 |
If the function leaves before completion for any reason it should generate |
|
1880 |
an appropriate error code, and in this situation, |
|
1881 |
the arguments are not valid on return. |
|
1882 |
||
1883 |
@param aPos Represents a position relative to the start of the file |
|
1884 |
where ReadL() should start to read. |
|
1885 |
@param aLength On entry, specifies the number of bytes to be read |
|
1886 |
from the file. On return, this should contain the number |
|
1887 |
of bytes read, but this is not valid if the function leaves. |
|
1888 |
@param aDes Pointer to a descriptor into which the data should be written. |
|
1889 |
@param aMessage |
|
1890 |
*/ |
|
1891 |
virtual void ReadL(TInt aPos,TInt& aLength,const TAny* aDes,const RMessagePtr2& aMessage) =0; |
|
1892 |
||
1893 |
||
1894 |
/** |
|
1895 |
Writes data to the open file. |
|
1896 |
||
1897 |
iModified and iSize are set by the file server after this function |
|
1898 |
has completed successfully. |
|
1899 |
||
1900 |
It can be assumed that aPos is within the file range and aLength > 0. |
|
1901 |
When aPos + aLength is greater than the file size then the file should |
|
1902 |
be enlarged using SetSizeL(). The number of bytes written should be |
|
1903 |
returned through the argument aLength. |
|
1904 |
||
1905 |
If the function leaves before completion for any reason it should generate |
|
1906 |
an appropriate error code, and in this situation the arguments are |
|
1907 |
not valid on return. |
|
1908 |
||
1909 |
@param aPos Represents a position relative to the start of the file |
|
1910 |
where WriteL() should start to write. |
|
1911 |
@param aLength Specifies the number of bytes to be written to the file. |
|
1912 |
On return, the number of bytes written, but this is not |
|
1913 |
valid if the function leaves. |
|
1914 |
@param aDes Pointer to a descriptor containing the data to be written |
|
1915 |
to the file. |
|
1916 |
@param aMessage |
|
1917 |
||
1918 |
@see CFileCB::iModified |
|
1919 |
@see CFileCB::iSize |
|
1920 |
@see CFileCB::SetSizeL |
|
1921 |
||
1922 |
@leave KErrDiskFull The operation cannot be completed because the disk is full. |
|
1923 |
*/ |
|
1924 |
virtual void WriteL(TInt aPos,TInt& aLength,const TAny* aDes,const RMessagePtr2& aMessage) =0; |
|
1925 |
||
1926 |
||
1927 |
/** |
|
1928 |
Extends or truncates the file by re-setting the file size. |
|
1929 |
||
1930 |
The function should not change iModified and iSize attributes of |
|
1931 |
the file object: this is done by the file server. |
|
1932 |
If the file is extended, nothing should be written in the extended area. |
|
1933 |
||
1934 |
The function should leave with a suitable error code on error detection. |
|
1935 |
||
1936 |
@param aSize The new file size in number of bytes. |
|
1937 |
||
1938 |
@leave KErrDiskFull The operation cannot be completed because the disk is full. |
|
1939 |
||
1940 |
@see CFileCB::iModified |
|
1941 |
@see CFileCB::iSize |
|
1942 |
*/ |
|
1943 |
virtual void SetSizeL(TInt aSize) =0; |
|
1944 |
||
1945 |
||
1946 |
/** |
|
1947 |
Sets the attribute mask, iAtt, and the modified time of the file, iModified. |
|
1948 |
||
1949 |
If aMask|aVal does not equal zero, then aMask should be OR'ed with iAtt, |
|
1950 |
whilst the inverse of aVal should be AND'ed with iAtt. |
|
1951 |
If the modified flag is set in aMask then iModified should be set to aTime. |
|
1952 |
||
1953 |
The function should leave with a suitable error code on error detection. |
|
1954 |
||
1955 |
@param aTime The new modified time, if the modified flag is set in aMask. |
|
1956 |
@param aMask Bit mask containing bits set (to 1) that are to be set (to 1) |
|
1957 |
in iAtt. |
|
1958 |
@param aVal Bitmask containing bits set (to 1) that are to be unset (to 0) |
|
1959 |
in iAtt. |
|
1960 |
||
1961 |
@see CFileCB::iModified |
|
1962 |
@see CFileCB::iAtt |
|
1963 |
*/ |
|
1964 |
virtual void SetEntryL(const TTime& aTime,TUint aMask,TUint aVal) =0; |
|
1965 |
||
1966 |
||
1967 |
/** |
|
1968 |
Flushes, to disk, the cached information necessary for the integrity |
|
1969 |
of recently written data, such as the file size. |
|
1970 |
||
1971 |
The function should leave with a suitable error code on error detection. |
|
1972 |
*/ |
|
1973 |
virtual void FlushDataL() =0; |
|
1974 |
||
1975 |
||
1976 |
/** |
|
1977 |
Flushes, to disk, all cached file data (e.g. attributes, modification time, |
|
1978 |
file size). |
|
1979 |
||
1980 |
The modified bit in the file attributes mask should be cleared if |
|
1981 |
the flush was successful. |
|
1982 |
||
1983 |
The function should leave with a suitable error code on error detection. |
|
1984 |
*/ |
|
1985 |
virtual void FlushAllL() =0; |
|
1986 |
IMPORT_C virtual TInt Address(TInt& aPos) const; |
|
1987 |
IMPORT_C void SetArchiveAttribute(); |
|
1988 |
||
1989 |
/** |
|
1990 |
Block Map API interface |
|
1991 |
*/ |
|
1992 |
class MBlockMapInterface |
|
1993 |
{ |
|
1994 |
public: |
|
1995 |
virtual TInt BlockMap(SBlockMapInfo& aInfo, TInt64& aStartPos, TInt64 aEndPos)=0; |
|
1996 |
}; |
|
1997 |
||
1998 |
/** |
|
1999 |
An interface class which may optionally be returned by a file system |
|
2000 |
by calling GetInterface(EExtendedFileInterface, ...) |
|
2001 |
The purpose of this interface is twofold: |
|
2002 |
- to support fair scheduling (by use of the aOffset parameter) |
|
2003 |
- to enable large file support |
|
2004 |
*/ |
|
2005 |
class MExtendedFileInterface |
|
2006 |
{ |
|
2007 |
public: |
|
2008 |
/** |
|
2009 |
Functionally equivalent to CFileCB::ReadL(), but supports large files and fair scheduling |
|
2010 |
||
2011 |
Reads a specified number of bytes from the open file starting at |
|
2012 |
the specified postition, and writes the result into a descriptor. |
|
2013 |
||
2014 |
@param aPos Represents a position relative to the start of the file |
|
2015 |
where ReadL() should start to read. |
|
2016 |
Note that the filesystem may not support positions above KMaxTInt, |
|
2017 |
in which case it leaves with KErrNotSupported. |
|
2018 |
@param aLength On entry, specifies the number of bytes to be read |
|
2019 |
from the file. On return, this contains the number |
|
2020 |
of bytes read, this value is not valid if the function leaves. |
|
2021 |
@param aDes Pointer to a descriptor into which the data is written. |
|
2022 |
@param aMessage A reference to a client message or an RLocalMessage. |
|
2023 |
@param aOffset The offset into the descriptor where the data is to be written. |
|
2024 |
This is non-zero if the read was fair-scheduled |
|
2025 |
||
2026 |
@see CFileCB::ReadL |
|
2027 |
@see RLocalMessage |
|
2028 |
*/ |
|
2029 |
virtual void ReadL(TInt64 aPos,TInt& aLength,TDes8* aDes,const RMessagePtr2& aMessage, TInt aOffset) = 0; |
|
2030 |
||
2031 |
/** |
|
2032 |
Functionally equivalent to CFileCB::WriteL(), but supports large files and fair scheduling |
|
2033 |
||
2034 |
Writes data to the open file. |
|
2035 |
||
2036 |
@param aPos Represents a position relative to the start of the file |
|
2037 |
where WriteL() starts to write. |
|
2038 |
Note that the filesystem may not support positions above KMaxTInt, |
|
2039 |
in which case it leaves with KErrNotSupported. |
|
2040 |
@param aLength Specifies the number of bytes to be written to the file. |
|
2041 |
On return this is the number of bytes written, this value is not |
|
2042 |
valid if the function leaves. |
|
2043 |
@param aDes Pointer to a descriptor containing the data to be written |
|
2044 |
to the file. |
|
2045 |
@param aMessage A reference to a client message or an RLocalMessage |
|
2046 |
@param aOffset The offset into the descriptor where the data is to be read from. |
|
2047 |
This is non-zero if the read was fair-scheduled |
|
2048 |
||
2049 |
@see CFileCB::WriteL |
|
2050 |
@see RLocalMessage |
|
2051 |
*/ |
|
2052 |
virtual void WriteL(TInt64 aPos,TInt& aLength,const TDesC8* aDes,const RMessagePtr2& aMessage, TInt aOffset) = 0; |
|
2053 |
||
2054 |
/** |
|
2055 |
Functionally equivalent to CFileCB::SetSizeL(), but supports large files |
|
2056 |
||
2057 |
Extends or truncates the file by re-setting the file size. |
|
2058 |
||
2059 |
The function does not change the iModified and iSize attributes of |
|
2060 |
the file object: this is done by the file server. |
|
2061 |
If the file is extended, nothing is written in the extended area. |
|
2062 |
||
2063 |
The function leaves with a suitable error code when an error is to detected. |
|
2064 |
||
2065 |
@param aSize The new file size in bytes. |
|
2066 |
||
2067 |
@leave KErrDiskFull The operation cannot be completed because the disk is full. |
|
2068 |
||
2069 |
@see CFileCB::SetSizeL |
|
2070 |
@see CFileCB::iModified |
|
2071 |
@see CFileCB::iSize |
|
2072 |
*/ |
|
2073 |
virtual void SetSizeL(TInt64 aSize) = 0; |
|
2074 |
}; |
|
2075 |
||
2076 |
||
2077 |
protected: |
|
2078 |
||
2079 |
/** |
|
2080 |
Return a pointer to a specified interface extension - to allow future extension of this class without breaking |
|
2081 |
binary compatibility. |
|
2082 |
@param aInterfaceId Interface identifier of the interface to be retrieved. |
|
2083 |
@param aInterface A reference to a pointer that retrieves the specified interface. |
|
2084 |
@param aInput An arbitrary input argument. |
|
2085 |
@return KErrNone If the interface is supported, KErrNotSupported otherwise. |
|
2086 |
*/ |
|
2087 |
IMPORT_C virtual TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput); |
|
2088 |
||
2089 |
// calls GetInterface() with tracepoints added |
|
2090 |
TInt GetInterfaceTraced(TInt aInterfaceId,TAny*& aInterface,TAny* aInput); |
|
2091 |
||
2092 |
||
2093 |
enum TInterfaceIds |
|
2094 |
{ |
|
2095 |
EBlockMapInterface = 0, |
|
2096 |
EGetLocalDrive = 1, |
|
2097 |
EExtendedFileInterface |
|
2098 |
}; |
|
2099 |
||
2100 |
TUint64 MaxSupportedSize(void) const; |
|
2101 |
||
2102 |
||
2103 |
inline TFileLocksArray& FileLocks(); |
|
2104 |
||
2105 |
||
2106 |
||
2107 |
private: |
|
2108 |
||
2109 |
void DemoteShare(CFileShare* aFileShare); |
|
2110 |
void PromoteShare(CFileShare* aFileShare); |
|
2111 |
||
2112 |
RArray<TAsyncReadRequest>& AsyncReadRequests(); |
|
2113 |
TInt AddAsyncReadRequest(CFileShare* aFileShareP, TInt64 aPos, TInt aLength, CFsRequest* aRequestP); |
|
2114 |
void NotifyAsyncReaders(); |
|
2115 |
||
2116 |
protected: |
|
2117 |
||
2118 |
/** |
|
2119 |
Inititally, the mode that the file was opened with, which defines the level |
|
2120 |
of access allowed to the file. Set by the TDrive object |
|
2121 |
(representing the drive on which the file resides) when the file |
|
2122 |
control block is created. |
|
2123 |
*/ |
|
2124 |
TShare iShare; |
|
2125 |
||
2126 |
||
2127 |
/** |
|
2128 |
The size of the file. This is the low 32 bit part of the file size. |
|
2129 |
The upper 32 bit part of the file size is saved on the file server side |
|
2130 |
for File Systems supporting file size > 4GB - 1. |
|
2131 |
File Systems supporting file size > 4GB - 1 shall use CFileCB::Size64() |
|
2132 |
to query the file size and CFileCB::SetSize64() to set file size. |
|
2133 |
*/ |
|
2134 |
TInt iSize; |
|
2135 |
||
2136 |
||
2137 |
/** |
|
2138 |
The attributes of the file. |
|
2139 |
*/ |
|
2140 |
TInt iAtt; |
|
2141 |
||
2142 |
||
2143 |
/** |
|
2144 |
The universal time at which the file was last modified. |
|
2145 |
*/ |
|
2146 |
TTime iModified; |
|
2147 |
||
2148 |
||
2149 |
/** |
|
2150 |
Indicates whether the file that the object represents is corrupt: |
|
2151 |
true if it is corrupt, false otherwise. |
|
2152 |
*/ |
|
2153 |
TBool iFileCorrupt; |
|
2154 |
||
2155 |
||
2156 |
/** |
|
2157 |
Indicates whether a recent access to the file that the object represents |
|
2158 |
failed due to KErrBadPower. |
|
2159 |
*/ |
|
2160 |
TBool iBadPower; |
|
2161 |
||
2162 |
public: |
|
2163 |
||
2164 |
/** |
|
148 | 2165 |
The full name of the file, including its extension. |
0 | 2166 |
*/ |
2167 |
HBufC* iFileName; |
|
2168 |
||
2169 |
/** |
|
148 | 2170 |
The full name of the file, including its extension - Folded. |
0 | 2171 |
*/ |
2172 |
HBufC* iFileNameF; |
|
2173 |
||
2174 |
private: |
|
2175 |
TUint32 iNameHash; |
|
2176 |
TDrive* iCreatedDrive; |
|
2177 |
TDrive* iDrive; |
|
2178 |
CMountCB* iMount; |
|
148 | 2179 |
TFileLocksArray* iFileLocks; // An array of file position locks |
0 | 2180 |
TDblQueLink iMountLink; |
148 | 2181 |
CFileBody* iBody; |
0 | 2182 |
|
2183 |
friend class TDrive; |
|
2184 |
friend class CMountCB; |
|
2185 |
friend class CFileShare; |
|
2186 |
friend class TFsFileRead; |
|
2187 |
friend class TFsFileWrite; |
|
2188 |
friend class TFsFileSetSize; |
|
2189 |
friend class TFsFileReadCancel; |
|
2190 |
friend class TFsFileDuplicate; |
|
2191 |
friend class TFsFileRename; |
|
2192 |
friend class CCompFileCB; |
|
2193 |
friend class CFileCache; |
|
2194 |
}; |
|
2195 |
||
2196 |
||
2197 |
/** |
|
2198 |
Helper class to construct a dummy RMessage2 object. This allows the file server to |
|
2199 |
read and write local buffers to a file system's CFileCB-derived interface. |
|
2200 |
||
2201 |
@internalTechnology |
|
2202 |
*/ |
|
2203 |
class RLocalMessage : public RMessage2 |
|
2204 |
{ |
|
2205 |
public: |
|
2206 |
inline RLocalMessage(); |
|
2207 |
||
2208 |
inline void InitHandle(); |
|
2209 |
inline void SetFunction(TInt aFunction); |
|
2210 |
inline void SetArgs(TIpcArgs& aArgs); |
|
2211 |
inline TInt Arg(TInt aIndex) const; |
|
2212 |
}; |
|
2213 |
||
2214 |
||
2215 |
/** |
|
2216 |
@publishedPartner |
|
2217 |
@released |
|
2218 |
||
2219 |
A file server interface class representing an open file that is being shared. |
|
2220 |
For example multiple reading of the same file. |
|
2221 |
||
2222 |
@see CFileCB |
|
2223 |
@see TFileMode |
|
2224 |
*/ |
|
2225 |
NONSHARABLE_CLASS(CFileShare) : public CFsDispatchObject |
|
2226 |
{ |
|
2227 |
public: |
|
2228 |
CFileShare(CFileCB* aFileCB); |
|
2229 |
~CFileShare(); |
|
2230 |
TInt CheckMount(); |
|
2231 |
void InitL(); |
|
2232 |
inline CFileCB& File(); |
|
2233 |
||
299 | 2234 |
// For serialising async requests |
0 | 2235 |
TBool RequestStart(CFsMessageRequest* aRequest); |
2236 |
void RequestEnd(CFsMessageRequest* aRequest); |
|
2237 |
TBool RequestInProgress() const; |
|
2238 |
inline TBool IsFileModeBig(); |
|
2239 |
||
2240 |
public: |
|
2241 |
/** |
|
2242 |
File share mode. The mode in which the file was opened first. |
|
2243 |
@see TFileMode. |
|
2244 |
*/ |
|
2245 |
TUint iMode; |
|
2246 |
/** |
|
2247 |
Current file position. This is the position at which reading and writing takes place. |
|
2248 |
*/ |
|
2249 |
TInt64 iPos; |
|
2250 |
/** |
|
2251 |
Error condition due to flush. |
|
2252 |
*/ |
|
2253 |
TInt iFlushError; |
|
2254 |
private: |
|
2255 |
CFileCB* iFile; |
|
2256 |
||
2257 |
// A pointer to the current request. Used for serializing client |
|
2258 |
// async read/write requests which might otherwise be processed out |
|
148 | 2259 |
// of order due to fair scheduling. |
2260 |
CFsMessageRequest* iCurrentRequest; |
|
2261 |
||
2262 |
// The FileShare List link object. |
|
2263 |
TDblQueLink iShareLink; |
|
2264 |
||
2265 |
friend class CFileBody; // For access to iShareLink |
|
0 | 2266 |
}; |
2267 |
||
2268 |
||
2269 |
||
2270 |
||
2271 |
/** |
|
2272 |
@publishedPartner |
|
2273 |
@released |
|
2274 |
||
2275 |
A file server interface class representing an open directory |
|
2276 |
||
2277 |
An instance of this object is referred to as a directory control block. |
|
2278 |
||
2279 |
A directory control block must be created for a specific directory to access |
|
2280 |
that directory within a volume. |
|
2281 |
||
2282 |
A plug-in file system implements this class. |
|
2283 |
*/ |
|
2284 |
class CDirCB : public CFsDispatchObject |
|
2285 |
{ |
|
2286 |
public: |
|
2287 |
IMPORT_C CDirCB(); |
|
2288 |
IMPORT_C ~CDirCB(); |
|
2289 |
TInt CheckMount(); |
|
2290 |
IMPORT_C void InitL(TDrive* aDrive); |
|
2291 |
inline void SetMount(CMountCB * aMount){iMount=aMount;}; |
|
2292 |
inline TDrive& Drive() const; |
|
2293 |
inline CMountCB& Mount() const; |
|
2294 |
inline TBool Pending() const; |
|
2295 |
inline void SetPending(TBool aPending); |
|
2296 |
||
2297 |
||
2298 |
/** |
|
2299 |
Gets information from the first suitable entry in the directory, |
|
2300 |
starting from the current read position. |
|
2301 |
||
2302 |
The function should read successive entries until a suitable entry is found. |
|
2303 |
An entry is suitable if the entry attributes match the criteria set by this |
|
2304 |
object's attributes, which are set on initialisation. |
|
2305 |
For example, if the directory control block has the attribute |
|
2306 |
KEntryAttMaskSupported, and the file has the attribute KEntryAttVolume, |
|
2307 |
then the entry will be deemed unsuitable and the next entry will be read. |
|
2308 |
||
2309 |
This function is called by the file server. |
|
2310 |
||
2311 |
If, on return, the entry's full file name, TEntry::iName, is longer than |
|
2312 |
the maximum buffer size, then the entry cannot be returned to the client. |
|
2313 |
In this case the file server will set iPending to true and will call |
|
2314 |
StoreLongEntryName() before calling this function again. |
|
2315 |
In this case (when iPending is true), the function should re-read |
|
2316 |
the last entry to be read; it should also set iPending to false and |
|
2317 |
should not advance the current read position. |
|
2318 |
||
2319 |
The time stored in the iModified member of anEntry should not be converted, |
|
2320 |
but left as UTC time. |
|
2321 |
||
2322 |
When storing the iName member of anEntry, the current (.), |
|
2323 |
or parent marker (..) in the directory should not be returned. |
|
2324 |
||
2325 |
If the KEntryAttAllowUid flag is set in the iAtt member of anEntry, then |
|
2326 |
the entry UID type of an entry will be read. If, on reading the UID from |
|
2327 |
a file, KErrCorrupt is generated, because the file is corrupt, |
|
2328 |
ReadL() should not leave with this error message, but should return |
|
2329 |
as normal. |
|
2330 |
If any other errors are raised the function should leave. |
|
2331 |
||
2332 |
All of the properties of a TEntry, other than the UID types, are always read. |
|
2333 |
||
2334 |
ReadL() should leave with a suitable error code if it cannot complete |
|
2335 |
successfully for any reason. |
|
2336 |
||
2337 |
@param anEntry Entry information object. |
|
2338 |
*/ |
|
2339 |
virtual void ReadL(TEntry& anEntry) =0; |
|
2340 |
||
2341 |
public: |
|
2342 |
IMPORT_C virtual void StoreLongEntryNameL(const TDesC& aName); |
|
2343 |
||
2344 |
protected: |
|
2345 |
/** |
|
2346 |
Return a pointer to a specified interface extension - to allow future extension of this class without breaking |
|
2347 |
binary compatibility. |
|
2348 |
@param aInterfaceId Interface identifier of the interface to be retrieved. |
|
2349 |
@param aInterface A reference to a pointer that retrieves the specified interface. |
|
2350 |
@param aInput An arbitrary input argument. |
|
2351 |
@return KErrNone If the interface is supported, KErrNotSupported otherwise. |
|
2352 |
*/ |
|
2353 |
IMPORT_C virtual TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput); |
|
2354 |
||
2355 |
protected: |
|
2356 |
/** |
|
2357 |
Bitmask of the attributes of interest. |
|
2358 |
||
2359 |
Set using the the TDrive friend class instance representing |
|
2360 |
the directory's drive after the object is made. |
|
2361 |
*/ |
|
2362 |
TUint iAtt; |
|
2363 |
||
2364 |
||
2365 |
/** |
|
2366 |
Set after construction using the TDrive friend class instance representing |
|
2367 |
the directory's drive. |
|
2368 |
*/ |
|
2369 |
TUidType iUidType; |
|
2370 |
||
2371 |
||
2372 |
/** |
|
2373 |
Flag to indicate whether preceding entry details should be returned when |
|
2374 |
multiple entries are being read. |
|
2375 |
*/ |
|
2376 |
TBool iPending; |
|
2377 |
friend class TDrive; |
|
2378 |
private: |
|
2379 |
TDrive* iDrive; |
|
2380 |
CMountCB* iMount; |
|
2381 |
TUint32 iReserved; // Reserved for future expansion |
|
2382 |
}; |
|
2383 |
||
2384 |
||
2385 |
||
2386 |
||
2387 |
class CFormatCBBody; |
|
2388 |
||
2389 |
/** |
|
2390 |
@publishedPartner |
|
2391 |
@released |
|
2392 |
||
2393 |
A file server interface class representing a format operation on a disk. |
|
2394 |
||
2395 |
An instance of this object is referred to as a format control block. |
|
2396 |
||
2397 |
The type of format operation to be applied depends on the type of disk, |
|
2398 |
and is stored in iMode. Each format operation has a number of steps and |
|
2399 |
is kept track of using iCurrentStep. |
|
2400 |
||
2401 |
A format control block needs to be created for a specific mount control block |
|
2402 |
for the disk controlled via that mount to be formatted. |
|
2403 |
||
2404 |
A plug-in file system provides an implementation of this class. |
|
2405 |
*/ |
|
2406 |
||
2407 |
class CFormatCB : public CFsDispatchObject |
|
2408 |
{ |
|
2409 |
public: |
|
2410 |
IMPORT_C CFormatCB(); |
|
2411 |
IMPORT_C ~CFormatCB(); |
|
2412 |
IMPORT_C TInt CheckMount(); |
|
2413 |
||
2414 |
void InitL(TDrive* aDrive, TFormatMode aMode); |
|
2415 |
||
2416 |
void SetFormatParameters(const TLDFormatInfo* apLDFormatInfo); |
|
2417 |
TInt SetFormatParameters(const TVolFormatParam* apVolFormatParam); |
|
2418 |
||
2419 |
||
2420 |
inline TDrive& Drive() const; |
|
2421 |
inline CMountCB& Mount() const; |
|
2422 |
inline TFormatMode Mode() const; |
|
2423 |
inline TInt& CurrentStep(); |
|
2424 |
||
2425 |
/** |
|
2426 |
Performs a formatting step on the drive. |
|
2427 |
||
2428 |
The step performed should depend on the values of iMode and iCurrentStep. |
|
2429 |
||
2430 |
It can be assumed that there are no resources open on the mount, |
|
2431 |
that the media is formattable, and that the media is not write protected. |
|
2432 |
||
2433 |
If iMode == EQuickFormat, then only meta data is to be written. |
|
2434 |
This should be carried out in a single step, with iCurrentStep set |
|
2435 |
to zero on completion. |
|
2436 |
||
2437 |
If iMode != EQuickFormat, then the format step performed by |
|
2438 |
this function should depend on iCurrentStep. When the function |
|
2439 |
returns with iCurrentStep set to zero, the formatting of the drive is complete. |
|
2440 |
||
2441 |
On error detection, the function should leave with an appropriate error code. |
|
2442 |
||
2443 |
@see CFormatCB::iMode |
|
2444 |
@see CFormatCB::iCurrentStep |
|
2445 |
*/ |
|
2446 |
virtual void DoFormatStepL() =0; |
|
2447 |
||
2448 |
protected: |
|
2449 |
||
2450 |
/** Enumeration of the aInterfaceIDs used in GetInterface */ |
|
2451 |
enum TInterfaceIds |
|
2452 |
{ |
|
2453 |
ESetFmtParameters = 1, ///< used in implementation of SetFormatParameters(const TVolFormatParam* apVolFormatParam) |
|
2454 |
}; |
|
2455 |
||
2456 |
||
2457 |
||
2458 |
/** |
|
2459 |
Return a pointer to a specified interface extension - to allow future extension of this class without breaking |
|
2460 |
binary compatibility. |
|
2461 |
@param aInterfaceId Interface identifier of the interface to be retrieved. |
|
2462 |
@param aInterface A reference to a pointer that retrieves the specified interface. |
|
2463 |
@param aInput An arbitrary input argument. |
|
2464 |
@return KErrNone If the interface is supported, KErrNotSupported otherwise. |
|
2465 |
*/ |
|
2466 |
IMPORT_C virtual TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput); |
|
2467 |
||
2468 |
protected: |
|
2469 |
||
2470 |
TInt iCurrentStep; ///< current format step counter 100...0 |
|
2471 |
TFormatMode iMode; ///< Format mode. This is set by the file server when this objetc is instantiated. |
|
2472 |
TSpecialFormatInfoBuf iSpecialInfo; ///< Buffer containing user-specified format parameters. |
|
2473 |
||
2474 |
private: |
|
2475 |
||
2476 |
TDrive* iDrive; |
|
2477 |
CMountCB* iMount; ///< parent Mount |
|
2478 |
CFormatCBBody* iBody; ///< additional data holder |
|
2479 |
}; |
|
2480 |
||
2481 |
||
2482 |
||
2483 |
||
2484 |
/** |
|
2485 |
@publishedPartner |
|
2486 |
@released |
|
2487 |
||
2488 |
A file server interface class representing a raw disk. |
|
2489 |
||
2490 |
An instance of this object is referred to as a raw disk control block. |
|
2491 |
||
2492 |
This is not an abstract base class and does not need to be derived from |
|
2493 |
when implementing a file system. This is because direct disk access is |
|
2494 |
implemented by the file server directly calling RawReadL() and RawWriteL() |
|
2495 |
from the derived CMountCB object of the file system. |
|
2496 |
*/ |
|
2497 |
NONSHARABLE_CLASS(CRawDiskCB) : public CFsDispatchObject |
|
2498 |
{ |
|
2499 |
public: |
|
2500 |
CRawDiskCB(); |
|
2501 |
~CRawDiskCB(); |
|
2502 |
void InitL(CMountCB* aMount,TBool aIsWriteProtected); |
|
2503 |
inline CMountCB& Mount(); |
|
2504 |
inline TDrive& Drive(); |
|
2505 |
inline TBool IsWriteProtected() const; |
|
2506 |
inline void SetChanged(); |
|
2507 |
private: |
|
2508 |
enum { EWriteProtected = 1, EChanged = 2 }; |
|
2509 |
inline void SetWriteProtected(); |
|
2510 |
inline TBool IsChanged() const; |
|
2511 |
private: |
|
2512 |
CMountCB* iMount; |
|
2513 |
TUint32 iFlags; |
|
2514 |
}; |
|
2515 |
||
2516 |
||
2517 |
class CFileSystemBody; |
|
2518 |
||
2519 |
/** |
|
2520 |
@publishedPartner |
|
2521 |
@released |
|
2522 |
||
2523 |
A file server interface class, representing the factory class for a file system. |
|
2524 |
||
2525 |
A plug-in file system implements this class. |
|
2526 |
||
2527 |
Creates objects derived from CMountCB, CFileCB, CDirCB and CFormatCB. |
|
2528 |
||
2529 |
@see CMountCB |
|
2530 |
@see CFileCB |
|
2531 |
@see CDirCB |
|
2532 |
@see CFormatCB |
|
2533 |
*/ |
|
2534 |
class CFileSystem : public CFsObject |
|
2535 |
{ |
|
2536 |
public: |
|
2537 |
IMPORT_C CFileSystem(); |
|
2538 |
IMPORT_C ~CFileSystem(); |
|
2539 |
IMPORT_C virtual TInt Remove(); |
|
2540 |
IMPORT_C virtual TBool QueryVersionSupported(const TVersion& aVer) const; |
|
2541 |
IMPORT_C virtual TBool IsExtensionSupported() const; |
|
2542 |
IMPORT_C TBool IsProxyDriveSupported(); |
|
2543 |
IMPORT_C void SetLibrary(RLibrary aLib); |
|
2544 |
IMPORT_C RLibrary Library() const; |
|
2545 |
// Pure virtual |
|
2546 |
||
2547 |
||
2548 |
/** |
|
2549 |
Installs the file system. |
|
2550 |
||
2551 |
The function should set the name of the file system object through a call |
|
2552 |
to CObject::SetName(), thus making it accessible, internally, |
|
2553 |
using FileSystems->FindByFullName(). This enables the file server |
|
2554 |
to find and handle installed file systems. |
|
2555 |
The function should also set the file system version. |
|
2556 |
The version is determined by the file system implementation. |
|
2557 |
It is used in calls to CFileSystem::QueryVersionSupported(). |
|
2558 |
||
2559 |
This function is called as a result of a call to RFs::AddFileSystem(). |
|
2560 |
||
2561 |
@return KErrNone if succesful; otherwise one of the other system-wide error |
|
2562 |
codes. |
|
2563 |
||
2564 |
@see RFs::AddFileSystem |
|
2565 |
@see CObject::SetName |
|
2566 |
@see RFs |
|
2567 |
@see CObject |
|
2568 |
*/ |
|
2569 |
virtual TInt Install() =0; |
|
2570 |
||
2571 |
||
2572 |
/** |
|
2573 |
Creates a new mount control block, a CMountCB derived object. |
|
2574 |
||
2575 |
On success, a pointer to the new mount object should be returned, |
|
2576 |
otherwise the function should leave. |
|
2577 |
||
2578 |
@return A pointer to the new mount object. |
|
2579 |
||
2580 |
@see CMountCB |
|
2581 |
*/ |
|
2582 |
virtual CMountCB* NewMountL() const =0; |
|
2583 |
||
2584 |
||
2585 |
/** |
|
2586 |
Creates a new file control block, i.e. a CFileCB derived object. |
|
2587 |
||
2588 |
On success, a pointer to the new file object should be returned, |
|
2589 |
otherwise the function should leave. |
|
2590 |
||
2591 |
@return A pointer to the new file object. |
|
2592 |
||
2593 |
@see CFileCB |
|
2594 |
*/ |
|
2595 |
virtual CFileCB* NewFileL() const =0; |
|
2596 |
||
2597 |
||
2598 |
/** |
|
2599 |
Creates a new directory control block, i.e. a CDirCB derived object. |
|
2600 |
||
2601 |
On success, a pointer to the new directory control block should be returned, |
|
2602 |
otherwise the function should leave. |
|
2603 |
||
2604 |
@return A pointer to the new directory object. |
|
2605 |
||
2606 |
@see CDirCB |
|
2607 |
*/ |
|
2608 |
virtual CDirCB* NewDirL() const =0; |
|
2609 |
||
2610 |
||
2611 |
/** |
|
2612 |
Creates a new volume format control block, i.e. a CFormatCB derived object. |
|
2613 |
||
2614 |
On success, a pointer to the new volume format control block should be returned, |
|
2615 |
otherwise the function should leave. |
|
2616 |
||
2617 |
@return A pointer to the new volume format object. |
|
2618 |
||
2619 |
@see CFormatCB |
|
2620 |
*/ |
|
2621 |
virtual CFormatCB* NewFormatL() const =0; |
|
2622 |
||
2623 |
||
2624 |
/** |
|
2625 |
Retrieves drive information. |
|
2626 |
||
2627 |
The function should set anInfo.iMediaAtt and anInfo.iType according to |
|
2628 |
the specified drive number. |
|
2629 |
||
33
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2630 |
Note that anInfo.iDriveAtt will already have been set by the calling |
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2631 |
function. |
0 | 2632 |
|
2633 |
The function can obtain the necessary information by calling |
|
2634 |
the appropriate TBusLocalDrive::Caps() function using the argument aDriveNumber. |
|
2635 |
||
2636 |
@param anInfo On return, contains the drive information. |
|
2637 |
@param aDriveNumber The drive number. |
|
2638 |
*/ |
|
33
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2639 |
IMPORT_C virtual void DriveInfo(TDriveInfo& anInfo,TInt aDriveNumber) const; |
0 | 2640 |
|
2641 |
virtual TInt DefaultPath(TDes& aPath) const; |
|
2642 |
||
2643 |
/** Enumeration of the aInterfaceIDs used in GetInterface.*/ |
|
2644 |
enum TInterfaceIds |
|
2645 |
{ |
|
2646 |
EProxyDriveSupport = 0, |
|
2647 |
EExtendedFunctionality, ///< corresponds to MFileSystemExtInterface |
|
2648 |
}; |
|
2649 |
||
2650 |
/** This is interface corresponds to the extended CFileSystem functionality*/ |
|
2651 |
class MFileSystemExtInterface |
|
2652 |
{ |
|
2653 |
public: |
|
2654 |
virtual CMountCB* NewMountExL(TDrive* apDrive, CFileSystem** apFileSystem, TBool aForceMount, TUint32 aFsNameHash) = 0; |
|
2655 |
virtual TInt GetSupportedFileSystemName(TInt aFsNumber, TDes& aFsName) const = 0; |
|
2656 |
||
2657 |
}; |
|
2658 |
||
2659 |
public: |
|
2660 |
CMountCB* NewMountExL(TDrive* apDrive, CFileSystem** apFileSystem, TBool aForceMount, TUint32 aFsNameHash); |
|
2661 |
TInt GetSupportedFileSystemName(TInt aFsNumber, TDes& aFsName); |
|
2662 |
||
2663 |
||
2664 |
protected: |
|
2665 |
/** |
|
2666 |
Return a pointer to a specified interface extension - to allow future extension of this class without breaking |
|
2667 |
binary compatibility. |
|
2668 |
@param aInterfaceId Interface identifier of the interface to be retrieved. |
|
2669 |
@param aInterface A reference to a pointer that retrieves the specified interface. |
|
2670 |
@param aInput An arbitrary input argument. |
|
2671 |
@return KErrNone If the interface is supported, KErrNotSupported otherwise. |
|
2672 |
*/ |
|
2673 |
IMPORT_C virtual TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput); |
|
2674 |
||
2675 |
protected: |
|
2676 |
TVersion iVersion; |
|
2677 |
private: |
|
2678 |
RLibrary iLibrary; ///< *.fsy file system plugin dll handle |
|
2679 |
CFileSystemBody* iBody; ///< extension of this class, used to provide extended functionality w/o changing this class size (BC issue) |
|
2680 |
||
2681 |
friend class TDrive; |
|
2682 |
||
2683 |
}; |
|
2684 |
||
2685 |
||
2686 |
||
2687 |
||
176 | 2688 |
class CProxyDriveBody; // fwd ref |
0 | 2689 |
/** |
2690 |
@publishedPartner |
|
2691 |
@released |
|
2692 |
||
2693 |
Base abstract class. |
|
2694 |
Interface between a local plugin file system and a media subsystem. |
|
2695 |
||
2696 |
@see CLocalProxyDrive |
|
2697 |
@see CBaseExtProxyDrive |
|
2698 |
*/ |
|
2699 |
class CProxyDrive : public CBase |
|
2700 |
{ |
|
2701 |
public: |
|
2702 |
CProxyDrive(CMountCB* aMount); |
|
2703 |
~CProxyDrive(); |
|
2704 |
inline CMountCB* Mount() const; |
|
2705 |
inline void SetMount(CMountCB *aMount); |
|
2706 |
// virtual |
|
2707 |
IMPORT_C virtual TInt ControlIO(const RMessagePtr2& aMessage,TInt aCommand,TAny* aParam1,TAny* aParam2); |
|
2708 |
IMPORT_C virtual TInt Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt aOffset,TInt aFlags); |
|
2709 |
IMPORT_C virtual TInt Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt anOffset,TInt aFlags); |
|
2710 |
IMPORT_C virtual TInt DeleteNotify(TInt64 aPos, TInt aLength); |
|
2711 |
IMPORT_C virtual TInt GetLastErrorInfo(TDes8& aErrorInfo); |
|
2712 |
||
2713 |
inline TInt LocalBufferSupport(); |
|
176 | 2714 |
|
2715 |
TInt SetAndOpenLibrary(RLibrary aLibrary); |
|
2716 |
RLibrary GetLibrary(); |
|
2717 |
||
0 | 2718 |
|
2719 |
// pure virtual |
|
2720 |
||
2721 |
/** |
|
2722 |
Initialise the proxy drive. |
|
2723 |
||
2724 |
Derived class must provide an implementation for it. |
|
2725 |
||
2726 |
@return KErrNone if successful, otherwise one of the system-wide error codes. |
|
2727 |
*/ |
|
2728 |
virtual TInt Initialise()=0; |
|
2729 |
||
2730 |
/** |
|
2731 |
It invokes Dismounted() on the proxy drive. |
|
2732 |
||
2733 |
Derived class must provide an implementation for it. |
|
2734 |
||
2735 |
@return KErrNone if successful, otherwise one of the system-wide error codes. |
|
2736 |
*/ |
|
2737 |
virtual TInt Dismounted()=0; |
|
2738 |
||
2739 |
/** |
|
2740 |
Increase the size of the proxy drive by the specified length (in bytes). |
|
2741 |
||
2742 |
Derived class must provide an implementation for it. |
|
2743 |
||
2744 |
@param aLength The length (in bytes) of which the drive is to be increased by. |
|
2745 |
||
2746 |
@return KErrNone if successful, otherwise one of the system-wide error codes. |
|
2747 |
*/ |
|
2748 |
virtual TInt Enlarge(TInt aLength)=0; |
|
2749 |
||
2750 |
/** |
|
2751 |
Reduce the size of the proxy drive by removing the specified length |
|
2752 |
(in bytes) starting at the specified position. |
|
2753 |
||
2754 |
Derived class must provide an implementation for it. |
|
2755 |
||
2756 |
@param aPos The start position of area to be removed. |
|
2757 |
@param aLength The length/size (in bytes) by which the drive is to be reduced. |
|
2758 |
||
2759 |
@return System-wide error codes based on the status of the operation. |
|
2760 |
*/ |
|
2761 |
virtual TInt ReduceSize(TInt aPos, TInt aLength)=0; |
|
2762 |
||
2763 |
/** |
|
2764 |
Read from the proxy drive. |
|
2765 |
||
2766 |
Derived class must provide an implementation for it. |
|
2767 |
||
2768 |
@param aPos The address from where the read begins. |
|
2769 |
@param aLength The length of the read. |
|
2770 |
@param aTrg A descriptor of the memory buffer from which to read. |
|
2771 |
@param aThreadHandle The handle-number representing the drive thread. |
|
2772 |
@param aOffset Offset into aTrg to read the data from. |
|
2773 |
||
2774 |
@return System-wide error codes based on the status of the operation. |
|
2775 |
*/ |
|
2776 |
virtual TInt Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt anOffset)=0; |
|
2777 |
||
2778 |
/** |
|
2779 |
Read from the proxy drive. |
|
2780 |
||
2781 |
Derived class must provide an implementation for it. |
|
2782 |
||
2783 |
@param aPos The address from where the read begins. |
|
2784 |
@param aLength The length of the read. |
|
2785 |
@param aTrg A descriptor of the memory buffer from which to read. |
|
2786 |
||
2787 |
@return System-wide error codes based on the status of the operation. |
|
2788 |
*/ |
|
2789 |
virtual TInt Read(TInt64 aPos,TInt aLength,TDes8& aTrg)=0; |
|
2790 |
||
2791 |
/** |
|
2792 |
Write to the proxy drive. |
|
2793 |
||
2794 |
Derived class must provide an implementation for it. |
|
2795 |
||
2796 |
@param aPos The address from where the write begins. |
|
2797 |
@param aLength The length of the write. |
|
2798 |
@param aSrc A descriptor of the memory buffer from which to write. |
|
2799 |
@param aThreadHandle The handle-number representing the drive thread. |
|
2800 |
@param aOffset Offset into aSrc to write the data to. |
|
2801 |
||
2802 |
@return System-wide error codes based on the status of the operation. |
|
2803 |
*/ |
|
2804 |
virtual TInt Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt anOffset)=0; |
|
2805 |
||
2806 |
/** |
|
2807 |
Write to the proxy drive. |
|
2808 |
||
2809 |
Derived class must provide an implementation for it. |
|
2810 |
||
2811 |
@param aPos The address from where the write begins. |
|
2812 |
@param aSrc A descriptor of the memory buffer from which to write. |
|
2813 |
||
2814 |
@return System-wide error codes based on the status of the operation. |
|
2815 |
*/ |
|
2816 |
virtual TInt Write(TInt64 aPos,const TDesC8& aSrc)=0; |
|
2817 |
||
2818 |
/** |
|
2819 |
Get the proxy drive's capabilities information. |
|
2820 |
||
2821 |
Derived class must provide an implementation for it. |
|
2822 |
||
2823 |
@param anInfo A descriptor of the connected drives capabilities. |
|
2824 |
||
2825 |
@return System-wide error codes based on the status of the operation. |
|
2826 |
*/ |
|
2827 |
virtual TInt Caps(TDes8& anInfo)=0; |
|
2828 |
||
2829 |
/** |
|
2830 |
Format the connected drive. |
|
2831 |
||
2832 |
Derived class must provide an implementation for it. |
|
2833 |
||
2834 |
@param anInfo Device specific format information. |
|
2835 |
||
2836 |
@return System-wide error codes based on the status of the operation. |
|
2837 |
*/ |
|
2838 |
virtual TInt Format(TFormatInfo& anInfo)=0; |
|
2839 |
||
2840 |
/** |
|
2841 |
Format the proxy drive. |
|
2842 |
||
2843 |
Derived class must provide an implementation for it. |
|
2844 |
||
2845 |
@param aPos The position of the data which is being formatted. |
|
2846 |
@param aLength The length of the data which is being formatted. |
|
2847 |
||
2848 |
@return System-wide error codes based on the status of the operation. |
|
2849 |
*/ |
|
2850 |
virtual TInt Format(TInt64 aPos,TInt aLength)=0; |
|
2851 |
||
2852 |
/** |
|
2853 |
Set the mount information on the proxy drive. |
|
2854 |
||
2855 |
Derived class must provide an implementation for it. |
|
2856 |
||
2857 |
@param aMountInfo Information passed down to the media driver. |
|
2858 |
The meaning of this information depends on the media driver. |
|
2859 |
@param aMountInfoThreadHandle Message thread handle number. |
|
2860 |
||
2861 |
@return System-wide error codes based on the status of the operation. |
|
2862 |
*/ |
|
2863 |
virtual TInt SetMountInfo(const TDesC8* aMountInfo,TInt aMountInfoThreadHandle=KCurrentThreadHandle)=0; |
|
2864 |
||
2865 |
/** |
|
2866 |
Forces a remount on the proxy drive |
|
2867 |
||
2868 |
Derived class must provide an implementation for it. |
|
2869 |
||
2870 |
@param aFlags Flags to be passed into the driver. |
|
2871 |
||
2872 |
@return System-wide error codes based on the status of the operation. |
|
2873 |
*/ |
|
2874 |
virtual TInt ForceRemount(TUint aFlags=0)=0; |
|
2875 |
||
2876 |
/** |
|
2877 |
Unlocks a password-enabled proxy drive. |
|
2878 |
||
2879 |
Derived class must provide an implementation for it. |
|
2880 |
||
2881 |
@param aPassword A descriptor containing the existing password. |
|
2882 |
@param aStorePassword If ETrue, the password is added to the password store. |
|
2883 |
||
2884 |
@return System-wide error codes based on the status of the operation. |
|
2885 |
*/ |
|
2886 |
virtual TInt Unlock(TMediaPassword &aPassword, TBool aStorePassword)=0; |
|
2887 |
||
2888 |
/** |
|
2889 |
Locks a password-enabled proxy drive with the new password. |
|
2890 |
||
2891 |
Derived class must provide an implementation for it. |
|
2892 |
||
2893 |
@param aOldPassword A descriptor containing the existing password. |
|
2894 |
@param aNewPassword A descriptor containing the new password. |
|
2895 |
@param aStorePassword If ETrue, the password is added to the password store. |
|
2896 |
||
2897 |
@return System-wide error codes based on the status of the operation. |
|
2898 |
*/ |
|
2899 |
virtual TInt Lock(TMediaPassword &aOldPassword, TMediaPassword &aNewPassword, TBool aStorePassword)=0; |
|
2900 |
||
2901 |
/** |
|
2902 |
Clears a password from a proxy drive - controller sets password to null. |
|
2903 |
||
2904 |
Derived class must provide an implementation for it. |
|
2905 |
||
2906 |
@param aPassword A descriptor containing the password. |
|
2907 |
||
2908 |
@return System-wide error codes based on the status of the operation. |
|
2909 |
*/ |
|
2910 |
virtual TInt Clear(TMediaPassword &aPassword)=0; |
|
2911 |
||
2912 |
/** |
|
2913 |
Forcibly unlock a password-enabled proxy drive. |
|
2914 |
||
2915 |
Derived class must provide an implementation for it. |
|
2916 |
||
2917 |
@return System-wide error codes based on the status of the operation. |
|
2918 |
*/ |
|
2919 |
virtual TInt ErasePassword()=0; |
|
2920 |
||
2921 |
// implementation using GetInterface(..) |
|
2922 |
enum TInterfaceIds |
|
2923 |
{ |
|
2924 |
EGetLocalDrive, |
|
2925 |
ELocalBufferSupport, |
|
2926 |
EGetProxyDrive, |
|
2927 |
EFinalised, |
|
2928 |
}; |
|
2929 |
||
2930 |
/** |
|
2931 |
Retrieves TBusLocalDrive object associated with the file. |
|
2932 |
||
2933 |
@return System-wide error codes based on the status of the operation. |
|
2934 |
*/ |
|
2935 |
IMPORT_C TInt GetLocalDrive(TBusLocalDrive*& aLocDrv); |
|
2936 |
||
2937 |
/** |
|
2938 |
Informs the extension that the mount has been finalised and is in a consistent state. |
|
2939 |
||
2940 |
@return System-wide error codes based on the status of the operation. |
|
2941 |
||
2942 |
@internalTechnology |
|
2943 |
*/ |
|
2944 |
IMPORT_C TInt Finalise(TBool aFinalised); |
|
2945 |
||
2946 |
protected: |
|
2947 |
/** |
|
2948 |
Return a pointer to a specified interface extension - to allow future extension of this class without breaking |
|
2949 |
binary compatibility. |
|
2950 |
||
2951 |
@param aInterfaceId Interface identifier of the interface to be retrieved. |
|
2952 |
@param aInterface A reference to a pointer that retrieves the specified interface. |
|
2953 |
@param aInput An arbitrary input argument. |
|
2954 |
||
2955 |
@return KErrNone If the interface is supported, KErrNotSupported otherwise. |
|
2956 |
*/ |
|
2957 |
IMPORT_C virtual TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput); |
|
2958 |
||
2959 |
private: |
|
2960 |
CMountCB* iMount; |
|
176 | 2961 |
CProxyDriveBody* iBody; |
2962 |
||
2963 |
friend class LocalDrives; |
|
0 | 2964 |
}; |
2965 |
||
2966 |
||
2967 |
||
2968 |
||
2969 |
/** |
|
2970 |
@publishedPartner |
|
2971 |
@released |
|
2972 |
||
2973 |
Local drive specific mount control block. |
|
2974 |
*/ |
|
2975 |
class CLocDrvMountCB : public CMountCB |
|
2976 |
{ |
|
2977 |
public: |
|
2978 |
IMPORT_C CLocDrvMountCB(); |
|
2979 |
IMPORT_C ~CLocDrvMountCB(); |
|
2980 |
IMPORT_C TInt CreateLocalDrive(TBusLocalDrive& aLocDrv); |
|
2981 |
IMPORT_C TInt CreateDrive(TInt aDriveNumber); |
|
2982 |
IMPORT_C TInt InitLocalDrive(); |
|
2983 |
IMPORT_C void DismountedLocalDrive(); |
|
2984 |
inline CProxyDrive* LocalDrive() const; |
|
2985 |
||
2986 |
private: |
|
2987 |
CProxyDrive* iProxyDrive; |
|
2988 |
}; |
|
2989 |
||
2990 |
||
2991 |
||
2992 |
||
2993 |
||
2994 |
/** |
|
2995 |
@publishedPartner |
|
2996 |
@released |
|
2997 |
||
2998 |
Local drive specific proxy drive interface. |
|
2999 |
Class passes commands directly to TBusLocalDrive. |
|
3000 |
||
3001 |
@see CProxyDrive |
|
3002 |
*/ |
|
3003 |
NONSHARABLE_CLASS(CLocalProxyDrive) : public CProxyDrive |
|
3004 |
{ |
|
3005 |
public: |
|
3006 |
static CLocalProxyDrive* New(CMountCB* aMount,TBusLocalDrive& aLocDrv); |
|
3007 |
// virtual |
|
3008 |
virtual TInt Initialise(); |
|
3009 |
virtual TInt Dismounted(); |
|
3010 |
virtual TInt Enlarge(TInt aLength); |
|
3011 |
virtual TInt ReduceSize(TInt aPos, TInt aLength); |
|
3012 |
virtual TInt Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt aOffset, TInt aFlags); |
|
3013 |
virtual TInt Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt anOffset); |
|
3014 |
virtual TInt Read(TInt64 aPos,TInt aLength,TDes8& aTrg); |
|
3015 |
virtual TInt Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt aOffset,TInt aFlags); |
|
3016 |
virtual TInt Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt anOffset); |
|
3017 |
virtual TInt Write(TInt64 aPos,const TDesC8& aSrc); |
|
3018 |
virtual TInt Caps(TDes8& anInfo); |
|
3019 |
virtual TInt Format(TFormatInfo& anInfo); |
|
3020 |
virtual TInt Format(TInt64 aPos,TInt aLength); |
|
3021 |
virtual TInt SetMountInfo(const TDesC8* aMountInfo,TInt aMountInfoThreadHandle=KCurrentThreadHandle); |
|
3022 |
virtual TInt ForceRemount(TUint aFlags=0); |
|
3023 |
virtual TInt ControlIO(const RMessagePtr2& aMessage,TInt aCommand,TAny* aParam1,TAny* aParam2); |
|
3024 |
virtual TInt Unlock(TMediaPassword &aPassword, TBool aStorePassword); |
|
3025 |
virtual TInt Lock(TMediaPassword &aOldPassword, TMediaPassword &aNewPassword, TBool aStorePassword); |
|
3026 |
virtual TInt Clear(TMediaPassword &aPassword); |
|
3027 |
virtual TInt ErasePassword(); |
|
3028 |
virtual TInt DeleteNotify(TInt64 aPos, TInt aLength); |
|
3029 |
virtual TInt GetLastErrorInfo(TDes8& aErrorInfo); |
|
3030 |
protected: |
|
3031 |
virtual TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput); |
|
3032 |
private: |
|
3033 |
CLocalProxyDrive(CMountCB* aMount,TBusLocalDrive& aLocDrv); |
|
3034 |
private: |
|
3035 |
TBusLocalDrive& iLocDrv; |
|
3036 |
}; |
|
3037 |
||
3038 |
||
3039 |
||
3040 |
||
3041 |
/** |
|
3042 |
@publishedPartner |
|
3043 |
@released |
|
3044 |
||
3045 |
Media subsystem extensions must be derived from this specific class interface. |
|
3046 |
Objects of this type should be created through use of a derived CProxyDriveFactory class. |
|
3047 |
||
3048 |
Class passes commands directly to CProxyDrive. |
|
3049 |
||
3050 |
@see CProxyDrive |
|
3051 |
@see CProxyDriveFactory |
|
3052 |
*/ |
|
3053 |
class CBaseExtProxyDrive : public CProxyDrive |
|
3054 |
{ |
|
3055 |
public: |
|
3056 |
IMPORT_C CBaseExtProxyDrive(CProxyDrive* aProxyDrive, CMountCB* aMount); |
|
3057 |
IMPORT_C ~CBaseExtProxyDrive(); |
|
3058 |
IMPORT_C virtual TInt Initialise(); |
|
3059 |
IMPORT_C virtual TInt Dismounted(); |
|
3060 |
IMPORT_C virtual TInt Enlarge(TInt aLength); |
|
3061 |
IMPORT_C virtual TInt ReduceSize(TInt aPos, TInt aLength); |
|
3062 |
IMPORT_C virtual TInt Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt aOffset,TInt aFlags); |
|
3063 |
IMPORT_C virtual TInt Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt anOffset); |
|
3064 |
IMPORT_C virtual TInt Read(TInt64 aPos,TInt aLength,TDes8& aTrg); |
|
3065 |
IMPORT_C virtual TInt Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt aOffset,TInt aFlags); |
|
3066 |
IMPORT_C virtual TInt Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt anOffset); |
|
3067 |
IMPORT_C virtual TInt Write(TInt64 aPos,const TDesC8& aSrc); |
|
3068 |
IMPORT_C virtual TInt Caps(TDes8& anInfo); |
|
3069 |
IMPORT_C virtual TInt Format(TFormatInfo& anInfo); |
|
3070 |
IMPORT_C virtual TInt Format(TInt64 aPos,TInt aLength); |
|
3071 |
IMPORT_C virtual TInt SetMountInfo(const TDesC8* aMountInfo,TInt aMountInfoThreadHandle=KCurrentThreadHandle); |
|
3072 |
IMPORT_C virtual TInt ForceRemount(TUint aFlags=0); |
|
3073 |
IMPORT_C virtual TInt Unlock(TMediaPassword &aPassword, TBool aStorePassword); |
|
3074 |
IMPORT_C virtual TInt Lock(TMediaPassword &aOldPassword, TMediaPassword &aNewPassword, TBool aStorePassword); |
|
3075 |
IMPORT_C virtual TInt Clear(TMediaPassword &aPassword); |
|
3076 |
IMPORT_C virtual TInt ControlIO(const RMessagePtr2& aMessage,TInt aCommand,TAny* aParam1,TAny* aParam2); |
|
3077 |
IMPORT_C virtual TInt ErasePassword(); |
|
3078 |
IMPORT_C virtual TInt GetLastErrorInfo(TDes8& aErrorInfo); |
|
3079 |
IMPORT_C virtual TInt DeleteNotify(TInt64 aPos, TInt aLength); |
|
3080 |
inline TInt LocalBufferSupport(); |
|
3081 |
||
3082 |
protected: |
|
3083 |
/** |
|
3084 |
Return a pointer to a specified interface extension - to allow future extension of this class without breaking |
|
3085 |
binary compatibility. |
|
3086 |
@param aInterfaceId Interface identifier of the interface to be retrieved. |
|
3087 |
@param aInterface A reference to a pointer that retrieves the specified interface. |
|
3088 |
@param aInput An arbitrary input argument. |
|
3089 |
@return KErrNone If the interface is supported, KErrNotSupported otherwise. |
|
3090 |
*/ |
|
3091 |
IMPORT_C virtual TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput); |
|
3092 |
private: |
|
3093 |
CProxyDrive* iProxy; |
|
3094 |
}; |
|
3095 |
||
3096 |
||
3097 |
||
3098 |
||
3099 |
/** |
|
3100 |
@publishedPartner |
|
3101 |
@released |
|
3102 |
||
3103 |
Abstract base class for Proxy drive factory classes. |
|
3104 |
||
3105 |
Class is used for the creation of media subsystem extensions CBaseExtProxyDrive. |
|
3106 |
||
3107 |
@see CBaseExtProxyDrive |
|
3108 |
*/ |
|
3109 |
class CProxyDriveFactory : public CFsObject |
|
3110 |
{ |
|
3111 |
public: |
|
3112 |
IMPORT_C CProxyDriveFactory(); |
|
3113 |
IMPORT_C virtual TInt Remove(); |
|
3114 |
inline void SetLibrary(RLibrary aLib); |
|
3115 |
inline RLibrary Library() const; |
|
3116 |
||
3117 |
/** |
|
3118 |
Installation of the factory object. |
|
3119 |
@return system wide error code |
|
3120 |
*/ |
|
3121 |
virtual TInt Install() =0; |
|
3122 |
/** |
|
3123 |
Instantiates a CProxyDrive object. |
|
3124 |
@param aProxy Proxy drive to be used. |
|
3125 |
@param aMount Mount control block. |
|
3126 |
||
3127 |
@return pointer to Instantiated CProxyDrive object. |
|
3128 |
*/ |
|
3129 |
virtual CProxyDrive* NewProxyDriveL(CProxyDrive* aProxy,CMountCB* aMount)=0; |
|
3130 |
private: |
|
3131 |
RLibrary iLibrary; |
|
3132 |
}; |
|
3133 |
||
3134 |
||
3135 |
||
3136 |
/** |
|
3137 |
@internalTechnology |
|
3138 |
*/ |
|
3139 |
class CExtProxyDriveFactory : public CFsObject |
|
3140 |
{ |
|
3141 |
public: |
|
3142 |
IMPORT_C CExtProxyDriveFactory(); |
|
3143 |
IMPORT_C virtual TInt Remove(); |
|
3144 |
inline void SetLibrary(RLibrary aLib); |
|
3145 |
inline RLibrary Library() const; |
|
3146 |
// pure virtual |
|
3147 |
virtual TInt Install() =0; |
|
3148 |
virtual TInt CreateProxyDrive(CProxyDrive*& aMountProxyDrive, CMountCB* aMount)=0; |
|
3149 |
||
3150 |
IMPORT_C virtual void AsyncEnumerate(); |
|
3151 |
||
3152 |
private: |
|
3153 |
RLibrary iLibrary; |
|
3154 |
}; |
|
3155 |
||
3156 |
||
3157 |
/** |
|
3158 |
@internalTechnology |
|
3159 |
*/ |
|
3160 |
class CExtProxyDrive : public CProxyDrive |
|
3161 |
{ |
|
3162 |
public: |
|
3163 |
IMPORT_C CExtProxyDrive(CMountCB* aMount,CExtProxyDriveFactory* aDevice); |
|
3164 |
IMPORT_C ~CExtProxyDrive(); |
|
3165 |
||
3166 |
IMPORT_C virtual TInt NotifyChange(TDes8 &aChanged, TRequestStatus* aStatus); |
|
3167 |
IMPORT_C virtual void NotifyChangeCancel(); |
|
3168 |
IMPORT_C virtual TInt SetInfo(const RMessage2 &msg, TAny* aMessageParam2, TAny* aMessageParam3); |
|
3169 |
||
3170 |
inline TInt DriveNumber(); |
|
3171 |
inline void SetDriveNumber(TInt aDrive); |
|
3172 |
inline CExtProxyDriveFactory* FactoryP(); |
|
3173 |
||
3174 |
protected: |
|
3175 |
/** |
|
3176 |
Return a pointer to a specified interface extension - to allow future extension of this class without breaking |
|
3177 |
binary compatibility. |
|
3178 |
@param aInterfaceId Interface identifier of the interface to be retrieved. |
|
3179 |
@param aInterface A reference to a pointer that retrieves the specified interface. |
|
3180 |
@param aInput An arbitrary input argument. |
|
3181 |
@return KErrNone If the interface is supported, KErrNotSupported otherwise. |
|
3182 |
*/ |
|
3183 |
IMPORT_C virtual TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput); |
|
3184 |
||
3185 |
TInt SetupMediaChange(); |
|
3186 |
||
3187 |
protected: |
|
3188 |
CExtProxyDriveFactory* iFactory; |
|
3189 |
TInt iDriveNumber; |
|
3190 |
||
3191 |
private: |
|
3192 |
CExtNotifyMediaChange* iMediaChangeNotifier; |
|
3193 |
||
3194 |
TUint32 iReserved[4]; // Reserved bytes for future expansion |
|
3195 |
||
3196 |
friend class LocalDrives; |
|
3197 |
}; |
|
3198 |
||
3199 |
||
3200 |
/** |
|
3201 |
@internalTechnology |
|
3202 |
*/ |
|
3203 |
NONSHARABLE_CLASS(CExtNotifyMediaChange) : public CActive |
|
3204 |
{ |
|
3205 |
public: |
|
3206 |
static CExtNotifyMediaChange* NewL(CExtProxyDrive* aDrive); |
|
3207 |
~CExtNotifyMediaChange(); |
|
3208 |
void RequestL(); |
|
3209 |
||
3210 |
private: |
|
3211 |
CExtNotifyMediaChange(CExtProxyDrive* aDrive); |
|
3212 |
void ConstructL(); |
|
3213 |
||
3214 |
void DoCancel(); |
|
3215 |
void RunL(); |
|
3216 |
||
3217 |
private: |
|
3218 |
CExtProxyDrive* iDrive; |
|
3219 |
TPtr8 iPtr; |
|
3220 |
}; |
|
3221 |
||
3222 |
/** |
|
3223 |
@publishedPartner |
|
3224 |
@released |
|
3225 |
||
3226 |
Gets the local bus drive. |
|
3227 |
||
3228 |
@param aLocalDrive The local drive number. |
|
3229 |
||
3230 |
@return The local bus drive. |
|
3231 |
*/ |
|
3232 |
IMPORT_C TBusLocalDrive& GetLocalDrive(TInt aLocalDrive); |
|
3233 |
||
3234 |
/** |
|
3235 |
@internalTechnology |
|
3236 |
||
3237 |
Gets the proxy drive device for a given drive |
|
3238 |
||
3239 |
@param aLocalDrive The local drive number. |
|
3240 |
||
3241 |
@return The local bus drive. |
|
3242 |
*/ |
|
3243 |
IMPORT_C CExtProxyDrive* GetProxyDrive(TInt aDrive); |
|
3244 |
||
3245 |
/** |
|
3246 |
@internalTechnology |
|
3247 |
||
3248 |
Gets the proxy drive for a given drive |
|
3249 |
||
3250 |
@param aLocalDrive The local drive number. |
|
3251 |
||
3252 |
@return The proxy drive |
|
3253 |
*/ |
|
3254 |
IMPORT_C TInt GetProxyDrive(TInt aDrive, CProxyDrive*& aProxyDrive); |
|
3255 |
||
3256 |
/** |
|
3257 |
@internalTechnology |
|
3258 |
||
3259 |
Return ETrue if drive is actually a proxy instead of a local drive |
|
3260 |
||
3261 |
@param The drive number. |
|
3262 |
||
3263 |
@return ETrue if drive is actually a proxy instead of a local drive |
|
3264 |
*/ |
|
3265 |
IMPORT_C TBool IsProxyDrive(TInt aDrive); |
|
3266 |
||
3267 |
/** |
|
3268 |
@publishedPartner |
|
3269 |
@released |
|
3270 |
||
3271 |
Checks a given drive number is mapped to a local drive. |
|
3272 |
||
3273 |
@param aDrive The local drive number. |
|
3274 |
||
3275 |
@return specified drive number is mapped to a local drive. |
|
3276 |
*/ |
|
3277 |
IMPORT_C TBool IsValidLocalDriveMapping(TInt aDrive); |
|
3278 |
||
33
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3279 |
/** |
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3280 |
@internalTechnology |
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3281 |
|
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3282 |
Sets the media attributes and type in the anInfo parameter to those of the |
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3283 |
specified drive. |
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3284 |
|
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3285 |
@param anInfo TDriveInfo object to store the drive information. |
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3286 |
@param aDriveNumber The number of the drive to get the information from. |
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3287 |
*/ |
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3288 |
IMPORT_C void GetDriveInfo(TDriveInfo& anInfo,TInt aDriveNumber); |
0 | 3289 |
|
3290 |
/** |
|
3291 |
@publishedPartner |
|
3292 |
@released |
|
3293 |
||
3294 |
Returns the local drive number for a given drive number. |
|
3295 |
||
3296 |
@param aDrive The drive number. |
|
3297 |
||
3298 |
@return KDriveInvalid if drive is not mapped to a local drive. |
|
3299 |
otherwise the local drive number. |
|
3300 |
*/ |
|
3301 |
IMPORT_C TInt DriveNumberToLocalDriveNumber(TInt aDrive); |
|
3302 |
||
3303 |
/** |
|
3304 |
*/ |
|
3305 |
IMPORT_C TInt GetLocalDriveNumber(TBusLocalDrive* aLocDrv); |
|
3306 |
||
3307 |
||
3308 |
/** |
|
3309 |
@internalTechnology |
|
3310 |
*/ |
|
3311 |
struct TFatUtilityFunctions; |
|
3312 |
||
3313 |
/** |
|
3314 |
Representation of FAT Utility Functions as provided by a Code Page DLL. |
|
3315 |
These functions are to be implemented by Code Page-DLLs. |
|
3316 |
@internaltechnology |
|
3317 |
*/ |
|
3318 |
||
3319 |
struct TCodePageFunctions |
|
3320 |
{ |
|
3321 |
typedef TBool (*TConvertFromUnicode)(TDes8& aForeign, const TDesC16& aUnicode, const TDesC8& aReplacementForUnconvertibleCharacter); |
|
3322 |
typedef TInt (*TConvertFromUnicodeL)(TDes8& aForeign, const TDesC16& aUnicode, TBool leaveWhenOverflow); |
|
3323 |
typedef TBool (*TConvertToUnicode)(TDes16& aUnicode, const TDesC8& aForeign); |
|
3324 |
typedef TInt (*TConvertToUnicodeL)(TDes16& aUnicode, const TDesC8& aForeign, TBool leaveWhenOverflow); |
|
3325 |
typedef TBool (*TIsLegalShortNameCharacter)(TUint aCharacter); |
|
3326 |
||
3327 |
TConvertFromUnicode iConvertFromUnicode; |
|
3328 |
TConvertFromUnicodeL iConvertFromUnicodeL; |
|
3329 |
TConvertToUnicode iConvertToUnicode; |
|
3330 |
TConvertToUnicodeL iConvertToUnicodeL; |
|
3331 |
TIsLegalShortNameCharacter iIsLegalShortNameCharacter; |
|
3332 |
}; |
|
3333 |
||
3334 |
/** |
|
3335 |
A utility class for Codepage Dll. Controls overflow action. Provides current status of |
|
3336 |
Locale/codepage dll loaded. Provides conversions functions to be used by Codepage Dlls. |
|
3337 |
||
3338 |
@internaltechnology |
|
3339 |
*/ |
|
3340 |
class TCodePageUtils |
|
3341 |
{ |
|
3342 |
public: |
|
3343 |
||
3344 |
/** |
|
3345 |
Determines the Overflow action in case of if overflow occurs. |
|
3346 |
*/ |
|
3347 |
enum TOverflowAction |
|
3348 |
{ |
|
3349 |
/** |
|
3350 |
Will leave if an overflow occurs. |
|
3351 |
*/ |
|
3352 |
EOverflowActionLeave, |
|
3353 |
/** |
|
3354 |
Will truncate the data if an overflow occurs. |
|
3355 |
*/ |
|
3356 |
EOverflowActionTruncate |
|
3357 |
}; |
|
3358 |
||
3359 |
/** |
|
3360 |
Determines the current status of Locale dll / Codepage dll. |
|
3361 |
*/ |
|
3362 |
enum TCodepageLoaded |
|
3363 |
{ |
|
3364 |
/** |
|
3365 |
No Locale Dll or Codepage Dll is loaded. |
|
3366 |
*/ |
|
3367 |
ENone = 0, |
|
3368 |
/** |
|
3369 |
Locale Dll is loaded. |
|
3370 |
*/ |
|
3371 |
ELocaleDll, |
|
3372 |
/** |
|
3373 |
Codepage Dll is loaded. |
|
3374 |
*/ |
|
3375 |
ECodePageDll |
|
3376 |
}; |
|
3377 |
public: |
|
3378 |
||
3379 |
/** |
|
3380 |
Convert from Unicode, truncating if there is not enough room in the output. |
|
3381 |
||
3382 |
@param aForeign The output is appended here. |
|
3383 |
@param aUnicode The input. |
|
3384 |
||
3385 |
@return False if and only if aForeign has not enough space remaining. |
|
3386 |
*/ |
|
3387 |
TBool ConvertFromUnicode(TDes8& aForeign, const TDesC16& aUnicode, TOverflowAction aOverflowAction) const; |
|
3388 |
||
3389 |
/** |
|
3390 |
Convert from Unicode, truncating if there is not enough room in the output. |
|
3391 |
||
3392 |
@param aForeign The output is appended here. |
|
3393 |
@param aUnicode The input. |
|
3394 |
||
3395 |
@leave KErrOverflow if aForeign is too short for the output. |
|
3396 |
*/ |
|
3397 |
IMPORT_C void ConvertFromUnicodeL(TDes8& aForeign, const TDesC16& aUnicode, TOverflowAction aOverflowAction=EOverflowActionLeave) const; |
|
3398 |
||
3399 |
/* |
|
3400 |
Convert to Unicode, truncating if there is not enough room in the output. |
|
3401 |
||
3402 |
@param aUnicode The output is appended here. |
|
3403 |
@param aForeign The input. |
|
3404 |
||
3405 |
@return False if and only if aUnicode has not enough space remaining. |
|
3406 |
*/ |
|
3407 |
TBool ConvertToUnicode(TDes16& aUnicode, const TDesC8& aForeign ) const; |
|
3408 |
||
3409 |
/* |
|
3410 |
Convert to Unicode, leaving if there is not enough room in the output. |
|
3411 |
||
3412 |
@param aUnicode The output is appended here. |
|
3413 |
@param aForeign The input. |
|
3414 |
||
3415 |
@leave KErrOverflow if aUnicode is too short for the output. |
|
3416 |
*/ |
|
3417 |
IMPORT_C void ConvertToUnicodeL(TDes16& aUnicode, const TDesC8& aForeign, TOverflowAction aOverflowAction=EOverflowActionLeave) const; |
|
3418 |
||
3419 |
/** |
|
3420 |
Returns true if the input character is legal in a short name. |
|
3421 |
||
3422 |
@param aCharacter Character, in the foreign character encoding. |
|
3423 |
||
3424 |
@return true if aCharacter is legal in a FAT short name. |
|
3425 |
*/ |
|
3426 |
IMPORT_C TBool IsLegalShortNameCharacter(TUint aCharacter,TBool aUseExtendedChars=EFalse) const; |
|
3427 |
||
3428 |
public: |
|
3429 |
||
3430 |
/** |
|
3431 |
Constructor for TCodePageUtils. |
|
3432 |
*/ |
|
3433 |
TCodePageUtils(); |
|
3434 |
||
3435 |
/** |
|
3436 |
Returns whether a Codepage dll is loaded. |
|
3437 |
||
3438 |
@return True if Codepage dll is loaded. |
|
3439 |
False otherwise |
|
3440 |
*/ |
|
3441 |
TBool IsCodepageLoaded() const; |
|
3442 |
||
3443 |
/** |
|
3444 |
Returns the type of active codepage. |
|
3445 |
@return ENone if no dll is loaded |
|
3446 |
ELocaleDll if Locale Dll is loaded |
|
3447 |
ECodepageDll if Codepage Dll is loaded |
|
3448 |
*/ |
|
3449 |
TCodepageLoaded CodepageLoaded() const; |
|
3450 |
||
3451 |
/** |
|
3452 |
Sets the current codepage to that provided by the current Locale DLL. |
|
3453 |
||
3454 |
@param aFunctions Pointer to FAT conversion functions to be used. |
|
3455 |
||
3456 |
@return None |
|
3457 |
*/ |
|
3458 |
void SetLocaleCodePage(TFatUtilityFunctions* aFunctions); |
|
3459 |
||
3460 |
/** |
|
3461 |
Gets the function pointer to the read Locale conversions functions. |
|
3462 |
||
3463 |
@return function pointer to the read Locale conversions functions. |
|
3464 |
*/ |
|
3465 |
TFatUtilityFunctions* LocaleFatUtilityFunctions() const; |
|
3466 |
||
3467 |
/** |
|
3468 |
Gets structure to function pointers to the read Codepage conversions functions. |
|
3469 |
||
3470 |
@return structure to function pointers to the read Codepage conversions functions. |
|
3471 |
*/ |
|
3472 |
TCodePageFunctions CodepageFatUtilityFunctions() const; |
|
3473 |
||
3474 |
private: |
|
3475 |
||
3476 |
/** |
|
3477 |
Structure to function pointers to the read Codepage conversions functions. |
|
3478 |
*/ |
|
3479 |
TCodePageFunctions iCodePageFunctions; |
|
3480 |
||
3481 |
/** |
|
3482 |
Function pointer to the read Locale conversions functions. |
|
3483 |
*/ |
|
3484 |
TFatUtilityFunctions* iLocaleFatUtilityFunctions; |
|
3485 |
||
3486 |
/** |
|
3487 |
Variable to hold the active codepage type. |
|
3488 |
*/ |
|
3489 |
TCodepageLoaded iCodepageLoaded; |
|
3490 |
||
3491 |
friend class TFsLoadCodePage; |
|
3492 |
}; |
|
3493 |
||
3494 |
/** |
|
3495 |
@internaltechnology |
|
3496 |
||
3497 |
Gets the pointer to the current FAT conversions functions. |
|
3498 |
||
3499 |
@return Pointer to the current FAT conversions functions. |
|
3500 |
*/ |
|
3501 |
IMPORT_C const TFatUtilityFunctions* GetFatUtilityFunctions(); |
|
3502 |
||
3503 |
/** |
|
3504 |
@internaltechnology |
|
3505 |
||
3506 |
Gets the instance of TCodePageUtils class. |
|
3507 |
||
3508 |
@return Instance of TCodePageUtils class. |
|
3509 |
*/ |
|
3510 |
IMPORT_C const TCodePageUtils& GetCodePage(); |
|
3511 |
||
3512 |
||
3513 |
||
3514 |
/** |
|
3515 |
@publishedPartner |
|
3516 |
@released |
|
3517 |
||
3518 |
Copies data to a buffer. |
|
3519 |
||
3520 |
If necessary, the buffer, a heap descriptor, is allocated or re-allocated |
|
3521 |
before copying takes place. |
|
3522 |
||
3523 |
@param aBuf A reference to a pointer to heap descriptor forming the buffer. |
|
3524 |
This will be allocated if it does not already exist, |
|
3525 |
or re-allocated if the existing buffer is not large enough. |
|
3526 |
@param aDes The data to be copied. |
|
3527 |
*/ |
|
3528 |
IMPORT_C void AllocBufferL(HBufC*& aBuf,const TDesC& aDes); |
|
3529 |
||
3530 |
||
3531 |
||
3532 |
||
3533 |
||
3534 |
/** |
|
3535 |
@publishedPartner |
|
3536 |
@released |
|
3537 |
||
3538 |
Notifies sessions of a debug event if aFunction has the KDebugNotifyMask set. |
|
3539 |
||
3540 |
This function can only be used in debug builds or if _DEBUG |
|
3541 |
or _DEBUG_RELEASE is defined. |
|
3542 |
||
3543 |
@param aFunction A function. |
|
3544 |
@param aDrive A drive. |
|
3545 |
*/ |
|
3546 |
IMPORT_C void DebugNotifySessions(TInt aFunction,TInt aDrive); |
|
3547 |
||
3548 |
||
3549 |
||
3550 |
||
3551 |
/** |
|
3552 |
@publishedPartner |
|
3553 |
@released |
|
3554 |
||
3555 |
Writes data from a buffer to a file. |
|
3556 |
||
3557 |
Called by the mount control block lock and the unlock functions. |
|
3558 |
||
3559 |
@param aFileName The file to be written to. |
|
3560 |
@param aBuf The data to be written. |
|
3561 |
*/ |
|
3562 |
IMPORT_C void WriteToDisk(const TDesC& aFileName,const TDesC8& aBuf); |
|
3563 |
||
3564 |
||
3565 |
||
3566 |
||
3567 |
/** |
|
3568 |
Create a proxy drive using the local proxy drive passed in |
|
3569 |
and any extensions that have been added to the drive. |
|
3570 |
||
3571 |
@param aConcreteDrive local proxy drive |
|
3572 |
@param aMount local proxy drive mount control block |
|
3573 |
||
3574 |
@return pointer to instantiated CProxyDrive object. |
|
3575 |
*/ |
|
3576 |
IMPORT_C CProxyDrive* CreateProxyDriveL(CProxyDrive* aConcreteDrive,CMountCB* aMount); |
|
3577 |
||
3578 |
||
3579 |
||
3580 |
/** |
|
3581 |
@deprecated 6.1 |
|
3582 |
*/ |
|
3583 |
IMPORT_C TInt CompareFilenames(const TDesC& aFileName1,const TDesC& aFileName2); |
|
3584 |
// |
|
3585 |
/** |
|
3586 |
Lookup a file system by name. |
|
3587 |
||
3588 |
@param aName file system name. |
|
3589 |
||
3590 |
@return pointer to instantiated CFileSystem object. |
|
3591 |
*/ |
|
3592 |
IMPORT_C CFileSystem* GetFileSystem(const TDesC& aName); |
|
3593 |
||
3594 |
||
3595 |
||
3596 |
/** |
|
3597 |
@internalTechnology |
|
3598 |
||
3599 |
A static class for retrieving F32 properties |
|
3600 |
*/ |
|
3601 |
class F32Properties |
|
3602 |
{ |
|
3603 |
private: |
|
3604 |
F32Properties(); |
|
3605 |
public: |
|
3606 |
IMPORT_C static TBool Initialise(TInt aRomAddress, TInt aLength); |
|
3607 |
IMPORT_C static TBool GetString(const TDesC8& aSection, const TDesC8& aProperty, TDes8& aPropVal); |
|
3608 |
IMPORT_C static TBool GetInt(const TDesC8& aSection, const TDesC8& aProperty, TInt32& aPropVal); |
|
3609 |
IMPORT_C static TBool GetBool(const TDesC8& aSection, const TDesC8& aProperty, TBool& aPropVal); |
|
254 | 3610 |
static void GetDriveSection(TInt aDrvNum, TDes8& aSectionName); |
3611 |
||
0 | 3612 |
private: |
3613 |
static TBool iInitialised; |
|
3614 |
static TInt iRomAddress; |
|
3615 |
static TInt iRomLength; |
|
3616 |
}; |
|
3617 |
||
3618 |
#include <f32fsys.inl> |
|
3619 |
#endif |