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