williamr@2
|
1 |
// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@2
|
4 |
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@2
|
6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
//
|
williamr@2
|
15 |
|
williamr@2
|
16 |
|
williamr@2
|
17 |
|
williamr@2
|
18 |
/**
|
williamr@2
|
19 |
@file
|
williamr@2
|
20 |
@publishedAll
|
williamr@2
|
21 |
@released
|
williamr@2
|
22 |
*/
|
williamr@2
|
23 |
|
williamr@2
|
24 |
#if !defined(__F32FILE_H__)
|
williamr@2
|
25 |
#define __F32FILE_H__
|
williamr@2
|
26 |
|
williamr@2
|
27 |
#if !defined(__E32BASE_H__)
|
williamr@2
|
28 |
#include <e32base.h>
|
williamr@2
|
29 |
#endif
|
williamr@2
|
30 |
|
williamr@2
|
31 |
#if !defined(__E32SVR_H__)
|
williamr@2
|
32 |
#include <e32svr.h>
|
williamr@2
|
33 |
#endif
|
williamr@2
|
34 |
|
williamr@2
|
35 |
#include <e32ldr.h>
|
williamr@2
|
36 |
|
williamr@2
|
37 |
|
williamr@2
|
38 |
/**
|
williamr@2
|
39 |
@publishedAll
|
williamr@2
|
40 |
@released
|
williamr@2
|
41 |
|
williamr@2
|
42 |
The session default drive.
|
williamr@2
|
43 |
*/
|
williamr@2
|
44 |
const TInt KDefaultDrive=KMaxTInt;
|
williamr@2
|
45 |
|
williamr@2
|
46 |
|
williamr@2
|
47 |
|
williamr@2
|
48 |
|
williamr@2
|
49 |
/**
|
williamr@2
|
50 |
@publishedAll
|
williamr@2
|
51 |
@released
|
williamr@2
|
52 |
|
williamr@2
|
53 |
Indicates a drive letter which is not in use.
|
williamr@2
|
54 |
|
williamr@2
|
55 |
This is useful when scanning a drive list to find which drives are available.
|
williamr@2
|
56 |
*/
|
williamr@2
|
57 |
const TInt KDriveAbsent=0x00;
|
williamr@2
|
58 |
|
williamr@2
|
59 |
|
williamr@2
|
60 |
|
williamr@2
|
61 |
|
williamr@2
|
62 |
/**
|
williamr@2
|
63 |
@publishedAll
|
williamr@2
|
64 |
@released
|
williamr@2
|
65 |
|
williamr@2
|
66 |
The default value for the number of message slots passed to RFs::Connect().
|
williamr@2
|
67 |
|
williamr@2
|
68 |
@see RFs::Connect
|
williamr@2
|
69 |
*/
|
williamr@2
|
70 |
const TInt KFileServerDefaultMessageSlots=-1;
|
williamr@2
|
71 |
|
williamr@2
|
72 |
|
williamr@2
|
73 |
|
williamr@2
|
74 |
|
williamr@2
|
75 |
/**
|
williamr@2
|
76 |
@publishedAll
|
williamr@2
|
77 |
@released
|
williamr@2
|
78 |
|
williamr@2
|
79 |
The size of the array of TEntry items contained in a TEntryArray object.
|
williamr@2
|
80 |
|
williamr@2
|
81 |
@see TEntryArray
|
williamr@2
|
82 |
@see TEntry
|
williamr@2
|
83 |
*/
|
williamr@2
|
84 |
const TInt KEntryArraySize=(0x200*sizeof(TText));
|
williamr@2
|
85 |
|
williamr@2
|
86 |
|
williamr@2
|
87 |
|
williamr@2
|
88 |
|
williamr@2
|
89 |
/**
|
williamr@2
|
90 |
@publishedAll
|
williamr@2
|
91 |
@released
|
williamr@2
|
92 |
|
williamr@2
|
93 |
The character used to separate directories in the path name.
|
williamr@2
|
94 |
*/
|
williamr@2
|
95 |
const TInt KPathDelimiter='\\';
|
williamr@2
|
96 |
|
williamr@2
|
97 |
|
williamr@2
|
98 |
|
williamr@2
|
99 |
|
williamr@2
|
100 |
/**
|
williamr@2
|
101 |
@publishedAll
|
williamr@2
|
102 |
@released
|
williamr@2
|
103 |
|
williamr@2
|
104 |
The character used to separate the drive letter from the path.
|
williamr@2
|
105 |
*/
|
williamr@2
|
106 |
const TInt KDriveDelimiter=':';
|
williamr@2
|
107 |
|
williamr@2
|
108 |
|
williamr@2
|
109 |
|
williamr@2
|
110 |
|
williamr@2
|
111 |
/**
|
williamr@2
|
112 |
@publishedAll
|
williamr@2
|
113 |
@released
|
williamr@2
|
114 |
|
williamr@2
|
115 |
The character used to separate the filename from the extension.
|
williamr@2
|
116 |
*/
|
williamr@2
|
117 |
const TInt KExtDelimiter='.';
|
williamr@2
|
118 |
|
williamr@2
|
119 |
|
williamr@2
|
120 |
|
williamr@2
|
121 |
|
williamr@2
|
122 |
/**
|
williamr@2
|
123 |
@publishedAll
|
williamr@2
|
124 |
@released
|
williamr@2
|
125 |
|
williamr@2
|
126 |
The maximum number of available drives.
|
williamr@2
|
127 |
*/
|
williamr@2
|
128 |
const TInt KMaxDrives=26;
|
williamr@2
|
129 |
|
williamr@2
|
130 |
|
williamr@2
|
131 |
/**
|
williamr@2
|
132 |
@publishedAll
|
williamr@2
|
133 |
@released
|
williamr@2
|
134 |
|
williamr@2
|
135 |
Defines a modifiable buffer descriptor to contain a drive list.
|
williamr@2
|
136 |
|
williamr@2
|
137 |
The descriptor has maximum length KMaxDrives, sufficient to contain
|
williamr@2
|
138 |
all possible drive letters.
|
williamr@2
|
139 |
|
williamr@2
|
140 |
@see RFs::DriveList
|
williamr@2
|
141 |
@see KMaxDrives
|
williamr@2
|
142 |
*/
|
williamr@2
|
143 |
typedef TBuf8<KMaxDrives> TDriveList;
|
williamr@2
|
144 |
|
williamr@2
|
145 |
|
williamr@2
|
146 |
|
williamr@2
|
147 |
/**
|
williamr@2
|
148 |
@publishedAll
|
williamr@2
|
149 |
@released
|
williamr@2
|
150 |
|
williamr@2
|
151 |
The maximum length of a drivename.
|
williamr@2
|
152 |
|
williamr@2
|
153 |
Sufficient for a drive letter and colon.
|
williamr@2
|
154 |
*/
|
williamr@2
|
155 |
const TInt KMaxDriveName=0x02;
|
williamr@2
|
156 |
|
williamr@2
|
157 |
|
williamr@2
|
158 |
|
williamr@2
|
159 |
|
williamr@2
|
160 |
/**
|
williamr@2
|
161 |
@publishedAll
|
williamr@2
|
162 |
@released
|
williamr@2
|
163 |
|
williamr@2
|
164 |
Defines a modifiable buffer descriptor to contain a drive name.
|
williamr@2
|
165 |
|
williamr@2
|
166 |
A drive name comprises a drive letter (A through Z) and a colon.
|
williamr@2
|
167 |
KMaxDriveName (2 bytes) is sufficient for a drive letter and colon.
|
williamr@2
|
168 |
|
williamr@2
|
169 |
@see TDriveUnit::Name
|
williamr@2
|
170 |
@see KMaxDriveName
|
williamr@2
|
171 |
*/
|
williamr@2
|
172 |
typedef TBuf<KMaxDriveName> TDriveName;
|
williamr@2
|
173 |
|
williamr@2
|
174 |
|
williamr@2
|
175 |
|
williamr@2
|
176 |
|
williamr@2
|
177 |
/**
|
williamr@2
|
178 |
@publishedAll
|
williamr@2
|
179 |
@released
|
williamr@2
|
180 |
|
williamr@2
|
181 |
The maximum length of a file system name or file system sub type name.
|
williamr@2
|
182 |
32 characters is sufficient for a file system or sub type name.
|
williamr@2
|
183 |
*/
|
williamr@2
|
184 |
const TInt KMaxFSNameLength=0x0020;
|
williamr@2
|
185 |
|
williamr@2
|
186 |
|
williamr@2
|
187 |
|
williamr@2
|
188 |
|
williamr@2
|
189 |
/**
|
williamr@2
|
190 |
@publishedAll
|
williamr@2
|
191 |
@released
|
williamr@2
|
192 |
|
williamr@2
|
193 |
Defines a modifiable buffer descriptor to contain a file system or file system sub type name.
|
williamr@2
|
194 |
|
williamr@2
|
195 |
@see KMaxFSNameLength
|
williamr@2
|
196 |
*/
|
williamr@2
|
197 |
typedef TBuf<KMaxFSNameLength> TFSName;
|
williamr@2
|
198 |
|
williamr@2
|
199 |
|
williamr@2
|
200 |
|
williamr@2
|
201 |
|
williamr@2
|
202 |
/**
|
williamr@2
|
203 |
@publishedAll
|
williamr@2
|
204 |
@released
|
williamr@2
|
205 |
|
williamr@2
|
206 |
File/directory attribute: any file without the hidden or system attribute.
|
williamr@2
|
207 |
*/
|
williamr@2
|
208 |
const TUint KEntryAttNormal=0x0000;
|
williamr@2
|
209 |
|
williamr@2
|
210 |
|
williamr@2
|
211 |
|
williamr@2
|
212 |
|
williamr@2
|
213 |
/**
|
williamr@2
|
214 |
@publishedAll
|
williamr@2
|
215 |
@released
|
williamr@2
|
216 |
|
williamr@2
|
217 |
File/directory attribute: read-only file or directory.
|
williamr@2
|
218 |
*/
|
williamr@2
|
219 |
const TUint KEntryAttReadOnly=0x0001;
|
williamr@2
|
220 |
|
williamr@2
|
221 |
|
williamr@2
|
222 |
|
williamr@2
|
223 |
|
williamr@2
|
224 |
/**
|
williamr@2
|
225 |
@publishedAll
|
williamr@2
|
226 |
@released
|
williamr@2
|
227 |
|
williamr@2
|
228 |
File/directory attribute: hidden file or directory.
|
williamr@2
|
229 |
*/
|
williamr@2
|
230 |
const TUint KEntryAttHidden=0x0002;
|
williamr@2
|
231 |
|
williamr@2
|
232 |
|
williamr@2
|
233 |
|
williamr@2
|
234 |
|
williamr@2
|
235 |
/**
|
williamr@2
|
236 |
@publishedAll
|
williamr@2
|
237 |
@released
|
williamr@2
|
238 |
|
williamr@2
|
239 |
File/directory attribute: system file.
|
williamr@2
|
240 |
*/
|
williamr@2
|
241 |
const TUint KEntryAttSystem=0x0004;
|
williamr@2
|
242 |
|
williamr@2
|
243 |
|
williamr@2
|
244 |
|
williamr@2
|
245 |
|
williamr@2
|
246 |
/**
|
williamr@2
|
247 |
@publishedAll
|
williamr@2
|
248 |
@released
|
williamr@2
|
249 |
|
williamr@2
|
250 |
File/directory attribute: volume name directory.
|
williamr@2
|
251 |
*/
|
williamr@2
|
252 |
const TUint KEntryAttVolume=0x0008;
|
williamr@2
|
253 |
|
williamr@2
|
254 |
|
williamr@2
|
255 |
|
williamr@2
|
256 |
|
williamr@2
|
257 |
/**
|
williamr@2
|
258 |
@publishedAll
|
williamr@2
|
259 |
@released
|
williamr@2
|
260 |
|
williamr@2
|
261 |
File/directory attribute: a directory without the hidden or system attribute.
|
williamr@2
|
262 |
*/
|
williamr@2
|
263 |
const TUint KEntryAttDir=0x0010;
|
williamr@2
|
264 |
|
williamr@2
|
265 |
|
williamr@2
|
266 |
|
williamr@2
|
267 |
|
williamr@2
|
268 |
/**
|
williamr@2
|
269 |
@publishedAll
|
williamr@2
|
270 |
@released
|
williamr@2
|
271 |
|
williamr@2
|
272 |
File/directory attribute: an archive file.
|
williamr@2
|
273 |
*/
|
williamr@2
|
274 |
const TUint KEntryAttArchive=0x0020;
|
williamr@2
|
275 |
|
williamr@2
|
276 |
|
williamr@2
|
277 |
|
williamr@2
|
278 |
|
williamr@2
|
279 |
/**
|
williamr@2
|
280 |
@publishedAll
|
williamr@2
|
281 |
@released
|
williamr@2
|
282 |
|
williamr@2
|
283 |
File/directory attribute: ROM eXecute In Place file
|
williamr@2
|
284 |
*/
|
williamr@2
|
285 |
const TUint KEntryAttXIP=0x0080;
|
williamr@2
|
286 |
|
williamr@2
|
287 |
|
williamr@2
|
288 |
|
williamr@2
|
289 |
|
williamr@2
|
290 |
/**
|
williamr@2
|
291 |
@publishedAll
|
williamr@2
|
292 |
@released
|
williamr@2
|
293 |
|
williamr@2
|
294 |
This file attribute bit is set if the file exists only on a remote file
|
williamr@2
|
295 |
system and is not locally cached.
|
williamr@2
|
296 |
|
williamr@2
|
297 |
Due to the potential high-latency of remote file systems, applications
|
williamr@2
|
298 |
(or users of applications) may make use of this bit to modify their
|
williamr@2
|
299 |
behaviour when working with remote files.
|
williamr@2
|
300 |
|
williamr@2
|
301 |
This is a read-only attribute, so any attempt to set this attribute will
|
williamr@2
|
302 |
will be ignored.
|
williamr@2
|
303 |
*/
|
williamr@2
|
304 |
const TUint KEntryAttRemote=0x0100;
|
williamr@2
|
305 |
|
williamr@2
|
306 |
|
williamr@2
|
307 |
|
williamr@2
|
308 |
|
williamr@2
|
309 |
/**
|
williamr@2
|
310 |
@publishedAll
|
williamr@2
|
311 |
@released
|
williamr@2
|
312 |
|
williamr@2
|
313 |
The range of entry attributes reserved for file-system specific meanings.
|
williamr@2
|
314 |
File systems may assign meaning to these bits, but their definition will
|
williamr@2
|
315 |
not be supported nor maintained by Symbian.
|
williamr@2
|
316 |
|
williamr@2
|
317 |
All other file attribute bits are reserved for use by Symbian.
|
williamr@2
|
318 |
|
williamr@2
|
319 |
The following table summarises the assignment of attribute bits:
|
williamr@2
|
320 |
|
williamr@2
|
321 |
0 - KEntryAttReadOnly
|
williamr@2
|
322 |
1 - KEntryAttHidden
|
williamr@2
|
323 |
2 - KEntryAttSystem
|
williamr@2
|
324 |
3 - KEntryAttVolume
|
williamr@2
|
325 |
|
williamr@2
|
326 |
4 - KEntryAttDir
|
williamr@2
|
327 |
6 - KEntryAttArchive
|
williamr@2
|
328 |
7 - KEntryAttXIP
|
williamr@2
|
329 |
|
williamr@2
|
330 |
8 - KEntryAttRemote
|
williamr@2
|
331 |
9 - Reserved
|
williamr@2
|
332 |
10 - Reserved
|
williamr@2
|
333 |
11 - Reserved
|
williamr@2
|
334 |
|
williamr@2
|
335 |
12 - Reserved
|
williamr@2
|
336 |
13 - Reserved
|
williamr@2
|
337 |
14 - Reserved
|
williamr@2
|
338 |
15 - Reserved
|
williamr@2
|
339 |
|
williamr@2
|
340 |
16 - File System Specific
|
williamr@2
|
341 |
17 - File System Specific
|
williamr@2
|
342 |
18 - File System Specific
|
williamr@2
|
343 |
19 - File System Specific
|
williamr@2
|
344 |
|
williamr@2
|
345 |
20 - File System Specific
|
williamr@2
|
346 |
22 - File System Specific
|
williamr@2
|
347 |
22 - File System Specific
|
williamr@2
|
348 |
23 - File System Specific
|
williamr@2
|
349 |
|
williamr@2
|
350 |
24 - Reserved
|
williamr@2
|
351 |
25 - Reserved
|
williamr@2
|
352 |
26 - Reserved
|
williamr@2
|
353 |
27 - KEntryAttMatchExclude
|
williamr@2
|
354 |
|
williamr@2
|
355 |
28 - KEntryAttAllowUid
|
williamr@2
|
356 |
29 - Reserved
|
williamr@2
|
357 |
30 - KEntryAttMatchExclusive
|
williamr@2
|
358 |
31 - Reserved
|
williamr@2
|
359 |
*/
|
williamr@2
|
360 |
const TUint KEntryAttMaskFileSystemSpecific=0x00FF0000;
|
williamr@2
|
361 |
|
williamr@2
|
362 |
|
williamr@2
|
363 |
|
williamr@2
|
364 |
|
williamr@2
|
365 |
/**
|
williamr@2
|
366 |
@publishedAll
|
williamr@2
|
367 |
@released
|
williamr@2
|
368 |
|
williamr@2
|
369 |
Bit mask for matching file and directory entries.
|
williamr@2
|
370 |
|
williamr@2
|
371 |
This mask ensures that directories and hidden and
|
williamr@2
|
372 |
system files are matched.
|
williamr@2
|
373 |
|
williamr@2
|
374 |
(Note that KEntryAttNormal matches all entry types except directories, hidden
|
williamr@2
|
375 |
and system entries).
|
williamr@2
|
376 |
|
williamr@2
|
377 |
@see RFs::GetDir
|
williamr@2
|
378 |
*/
|
williamr@2
|
379 |
const TUint KEntryAttMatchMask=(KEntryAttHidden|KEntryAttSystem|KEntryAttDir);
|
williamr@2
|
380 |
|
williamr@2
|
381 |
|
williamr@2
|
382 |
|
williamr@2
|
383 |
|
williamr@2
|
384 |
|
williamr@2
|
385 |
/**
|
williamr@2
|
386 |
@publishedAll
|
williamr@2
|
387 |
@released
|
williamr@2
|
388 |
|
williamr@2
|
389 |
Bit mask for matching file and directory entries.
|
williamr@2
|
390 |
|
williamr@2
|
391 |
This is used when all entry types, including hidden and system files,
|
williamr@2
|
392 |
but excluding the volume entry are to be matched.
|
williamr@2
|
393 |
|
williamr@2
|
394 |
@see RFs::GetDir
|
williamr@2
|
395 |
*/
|
williamr@2
|
396 |
const TUint KEntryAttMaskSupported=0x3f;
|
williamr@2
|
397 |
|
williamr@2
|
398 |
|
williamr@2
|
399 |
|
williamr@2
|
400 |
|
williamr@2
|
401 |
/**
|
williamr@2
|
402 |
@publishedAll
|
williamr@2
|
403 |
@released
|
williamr@2
|
404 |
|
williamr@2
|
405 |
Bit mask for matching file and directory entries.
|
williamr@2
|
406 |
|
williamr@2
|
407 |
This is used for exclusive matching. When OR'ed with one or more file attribute
|
williamr@2
|
408 |
constants, for example, KEntryAttNormal, it ensures that only the files with
|
williamr@2
|
409 |
those attributes are matched.
|
williamr@2
|
410 |
When OR’ed with KEntryAttDir, directories only (not hidden or system) are matched.
|
williamr@2
|
411 |
|
williamr@2
|
412 |
@see KEntryAttDir
|
williamr@2
|
413 |
@see KEntryAttNormal
|
williamr@2
|
414 |
@see RFs::GetDir
|
williamr@2
|
415 |
*/
|
williamr@2
|
416 |
const TUint KEntryAttMatchExclusive=0x40000000;
|
williamr@2
|
417 |
|
williamr@2
|
418 |
|
williamr@2
|
419 |
|
williamr@2
|
420 |
|
williamr@2
|
421 |
/**
|
williamr@2
|
422 |
@publishedAll
|
williamr@2
|
423 |
@released
|
williamr@2
|
424 |
|
williamr@2
|
425 |
Bit mask for feature manager file entries.
|
williamr@2
|
426 |
|
williamr@2
|
427 |
It is used in order to identify each ROM feature set data file
|
williamr@2
|
428 |
uniquely in the mount order of ROM sections.
|
williamr@2
|
429 |
|
williamr@2
|
430 |
*/
|
williamr@2
|
431 |
const TUint KEntryAttUnique=0x01000000;
|
williamr@2
|
432 |
|
williamr@2
|
433 |
|
williamr@2
|
434 |
|
williamr@2
|
435 |
|
williamr@2
|
436 |
/**
|
williamr@2
|
437 |
@publishedAll
|
williamr@2
|
438 |
@released
|
williamr@2
|
439 |
|
williamr@2
|
440 |
Bit mask for matching file and directory entries.
|
williamr@2
|
441 |
|
williamr@2
|
442 |
It is used to exclude files or directories with certain attributes from
|
williamr@2
|
443 |
directory listings. This bitmask has the opposite effect
|
williamr@2
|
444 |
to KEntryAttMatchExclusive. For example:
|
williamr@2
|
445 |
|
williamr@2
|
446 |
@code
|
williamr@2
|
447 |
KEntryAttMatchExclude|KEntryAttReadOnly
|
williamr@2
|
448 |
@endcode
|
williamr@2
|
449 |
|
williamr@2
|
450 |
excludes all read only entries from the directory listing.
|
williamr@2
|
451 |
|
williamr@2
|
452 |
@code
|
williamr@2
|
453 |
KEntryAttMatchExclusive|KEntryAttReadOnly
|
williamr@2
|
454 |
@endcode
|
williamr@2
|
455 |
lists only read only entries.
|
williamr@2
|
456 |
|
williamr@2
|
457 |
@see KEntryAttMatchExclusive
|
williamr@2
|
458 |
@see RFs::GetDir
|
williamr@2
|
459 |
*/
|
williamr@2
|
460 |
const TUint KEntryAttMatchExclude=0x08000000;
|
williamr@2
|
461 |
|
williamr@2
|
462 |
|
williamr@2
|
463 |
|
williamr@2
|
464 |
|
williamr@2
|
465 |
/**
|
williamr@2
|
466 |
@publishedAll
|
williamr@2
|
467 |
@released
|
williamr@2
|
468 |
|
williamr@2
|
469 |
Bit mask for matching file and directory entries.
|
williamr@2
|
470 |
|
williamr@2
|
471 |
Bit mask flag used when UID information should be included in the directory
|
williamr@2
|
472 |
entry listing.
|
williamr@2
|
473 |
|
williamr@2
|
474 |
@see RFs::GetDir
|
williamr@2
|
475 |
*/
|
williamr@2
|
476 |
const TUint KEntryAttAllowUid=0x10000000;
|
williamr@2
|
477 |
|
williamr@2
|
478 |
|
williamr@2
|
479 |
|
williamr@2
|
480 |
|
williamr@2
|
481 |
/**
|
williamr@2
|
482 |
@publishedPartner
|
williamr@2
|
483 |
@released
|
williamr@2
|
484 |
|
williamr@2
|
485 |
Bit mask used when evaluating whether or not a session gets notified of a
|
williamr@2
|
486 |
debug event.
|
williamr@2
|
487 |
|
williamr@2
|
488 |
@see DebugNotifySessions
|
williamr@2
|
489 |
*/
|
williamr@2
|
490 |
const TUint KDebugNotifyMask=0xFF000000; // Reserved for debug notification
|
williamr@2
|
491 |
|
williamr@2
|
492 |
/**
|
williamr@2
|
493 |
|
williamr@2
|
494 |
*/
|
williamr@2
|
495 |
const TUint KMaxMapsPerCall = 0x8;
|
williamr@2
|
496 |
|
williamr@2
|
497 |
|
williamr@2
|
498 |
|
williamr@2
|
499 |
|
williamr@2
|
500 |
/**
|
williamr@2
|
501 |
@publishedPartner
|
williamr@2
|
502 |
@released
|
williamr@2
|
503 |
|
williamr@2
|
504 |
The default blocksize value.
|
williamr@2
|
505 |
|
williamr@2
|
506 |
This value is returned when you query the blocksize for a media type that does not
|
williamr@2
|
507 |
support the concept of 'block' (e.g. NOR flash media).
|
williamr@2
|
508 |
|
williamr@2
|
509 |
@see TVolumeIOParamInfo
|
williamr@2
|
510 |
*/
|
williamr@2
|
511 |
const TUint KDefaultVolumeBlockSize = 512;
|
williamr@2
|
512 |
|
williamr@2
|
513 |
|
williamr@2
|
514 |
|
williamr@2
|
515 |
|
williamr@2
|
516 |
enum TNotifyType
|
williamr@2
|
517 |
/**
|
williamr@2
|
518 |
@publishedAll
|
williamr@2
|
519 |
@released
|
williamr@2
|
520 |
|
williamr@2
|
521 |
A set of change notification flags.
|
williamr@2
|
522 |
|
williamr@2
|
523 |
These flags indicate the kind of change that should result in notification.
|
williamr@2
|
524 |
|
williamr@2
|
525 |
This is useful for programs that maintain displays of file lists that
|
williamr@2
|
526 |
must be dynamically updated.
|
williamr@2
|
527 |
|
williamr@2
|
528 |
@see RFs::NotifyChange
|
williamr@2
|
529 |
@see RFs
|
williamr@2
|
530 |
@see RFile
|
williamr@2
|
531 |
@see RRawDisk
|
williamr@2
|
532 |
*/
|
williamr@2
|
533 |
{
|
williamr@2
|
534 |
/**
|
williamr@2
|
535 |
Any change, including mounting and unmounting drives.
|
williamr@2
|
536 |
*/
|
williamr@2
|
537 |
ENotifyAll=0x01,
|
williamr@2
|
538 |
|
williamr@2
|
539 |
|
williamr@2
|
540 |
/**
|
williamr@2
|
541 |
Addition or deletion of a directory entry, or changing or formatting a disk.
|
williamr@2
|
542 |
*/
|
williamr@2
|
543 |
ENotifyEntry=0x02,
|
williamr@2
|
544 |
|
williamr@2
|
545 |
|
williamr@2
|
546 |
/**
|
williamr@2
|
547 |
Change resulting from file requests:
|
williamr@2
|
548 |
RFile::Create(), RFile::Replace(), RFile::Rename(), RFs::Delete(),
|
williamr@2
|
549 |
RFs::Replace(), and RFs::Rename().
|
williamr@2
|
550 |
*/
|
williamr@2
|
551 |
ENotifyFile=0x04,
|
williamr@2
|
552 |
|
williamr@2
|
553 |
|
williamr@2
|
554 |
/**
|
williamr@2
|
555 |
Change resulting from directory requests:
|
williamr@2
|
556 |
RFs::MkDir(), RFs::RmDir(), and RFs::Rename().
|
williamr@2
|
557 |
*/
|
williamr@2
|
558 |
ENotifyDir=0x08,
|
williamr@2
|
559 |
|
williamr@2
|
560 |
|
williamr@2
|
561 |
/**
|
williamr@2
|
562 |
Change resulting from: RFs::SetEntry(), RFile::Set(), RFile::SetAtt(),
|
williamr@2
|
563 |
RFile::SetModified() and RFile::SetSize() requests.
|
williamr@2
|
564 |
*/
|
williamr@2
|
565 |
ENotifyAttributes=0x10,
|
williamr@2
|
566 |
|
williamr@2
|
567 |
|
williamr@2
|
568 |
/**
|
williamr@2
|
569 |
Change resulting from the RFile::Write() request.
|
williamr@2
|
570 |
*/
|
williamr@2
|
571 |
ENotifyWrite=0x20,
|
williamr@2
|
572 |
|
williamr@2
|
573 |
|
williamr@2
|
574 |
/**
|
williamr@2
|
575 |
Change resulting from the RRawDisk::Write() request.
|
williamr@2
|
576 |
*/
|
williamr@2
|
577 |
ENotifyDisk=0x40
|
williamr@2
|
578 |
};
|
williamr@2
|
579 |
|
williamr@2
|
580 |
enum TNotifyDismountMode
|
williamr@2
|
581 |
/**
|
williamr@2
|
582 |
@publishedAll
|
williamr@2
|
583 |
@released
|
williamr@2
|
584 |
|
williamr@2
|
585 |
Notification modes for safe media removal notification API
|
williamr@2
|
586 |
|
williamr@2
|
587 |
@see RFs::NotifyDismount
|
williamr@2
|
588 |
*/
|
williamr@2
|
589 |
{
|
williamr@2
|
590 |
/**
|
williamr@2
|
591 |
Used by a client to register for notification of pending dismount.
|
williamr@2
|
592 |
- This is the default behaviour for RFs::NotifyDismount
|
williamr@2
|
593 |
*/
|
williamr@2
|
594 |
EFsDismountRegisterClient=0x01,
|
williamr@2
|
595 |
|
williamr@2
|
596 |
/**
|
williamr@2
|
597 |
Used to notify clients of a pending dismount.
|
williamr@2
|
598 |
*/
|
williamr@2
|
599 |
EFsDismountNotifyClients=0x02,
|
williamr@2
|
600 |
|
williamr@2
|
601 |
/**
|
williamr@2
|
602 |
Used to forcibly dismount the file system without notifying clients.
|
williamr@2
|
603 |
*/
|
williamr@2
|
604 |
EFsDismountForceDismount=0x03,
|
williamr@2
|
605 |
};
|
williamr@2
|
606 |
|
williamr@2
|
607 |
|
williamr@2
|
608 |
enum TFileCacheFlags
|
williamr@2
|
609 |
/**
|
williamr@2
|
610 |
@publishedPartner
|
williamr@2
|
611 |
@released
|
williamr@2
|
612 |
|
williamr@2
|
613 |
Flags used to enable file server drive-specific caching
|
williamr@2
|
614 |
*/
|
williamr@2
|
615 |
{
|
williamr@2
|
616 |
/**
|
williamr@2
|
617 |
Enable read caching - if file explicitly opened in EFileReadBuffered mode
|
williamr@2
|
618 |
*/
|
williamr@2
|
619 |
EFileCacheReadEnabled = 0x01,
|
williamr@2
|
620 |
|
williamr@2
|
621 |
/**
|
williamr@2
|
622 |
Enable read caching for all files, regardless of file open mode
|
williamr@2
|
623 |
*/
|
williamr@2
|
624 |
EFileCacheReadOn = 0x02,
|
williamr@2
|
625 |
|
williamr@2
|
626 |
/**
|
williamr@2
|
627 |
Enable read-ahead caching - if file explicitly opened in EFileReadAheadOn mode
|
williamr@2
|
628 |
*/
|
williamr@2
|
629 |
EFileCacheReadAheadEnabled = 0x04,
|
williamr@2
|
630 |
|
williamr@2
|
631 |
/**
|
williamr@2
|
632 |
Enable read-ahead caching, regardless of file open mode
|
williamr@2
|
633 |
*/
|
williamr@2
|
634 |
EFileCacheReadAheadOn = 0x08,
|
williamr@2
|
635 |
|
williamr@2
|
636 |
/**
|
williamr@2
|
637 |
Enable write caching, if file explicitly opened in EFileWriteBuffered mode
|
williamr@2
|
638 |
*/
|
williamr@2
|
639 |
EFileCacheWriteEnabled = 0x10,
|
williamr@2
|
640 |
|
williamr@2
|
641 |
/**
|
williamr@2
|
642 |
Enable write caching for all files, regardless of file open mode
|
williamr@2
|
643 |
*/
|
williamr@2
|
644 |
EFileCacheWriteOn = 0x20,
|
williamr@2
|
645 |
};
|
williamr@2
|
646 |
|
williamr@2
|
647 |
|
williamr@2
|
648 |
enum TStartupConfigurationCmd
|
williamr@2
|
649 |
/**
|
williamr@2
|
650 |
@publishedPartner
|
williamr@2
|
651 |
@released
|
williamr@2
|
652 |
|
williamr@2
|
653 |
Command used to set file server configuration at startup.
|
williamr@2
|
654 |
|
williamr@2
|
655 |
@see RFs::SetStartupConfiguration()
|
williamr@2
|
656 |
*/
|
williamr@2
|
657 |
{
|
williamr@2
|
658 |
/**
|
williamr@2
|
659 |
Set loader thread priority
|
williamr@2
|
660 |
*/
|
williamr@2
|
661 |
ELoaderPriority,
|
williamr@2
|
662 |
|
williamr@2
|
663 |
/**
|
williamr@2
|
664 |
Set TDrive flags. Value should be ETrue or EFalse
|
williamr@2
|
665 |
*/
|
williamr@2
|
666 |
ESetRugged,
|
williamr@2
|
667 |
/**
|
williamr@2
|
668 |
Command upper boundary
|
williamr@2
|
669 |
*/
|
williamr@2
|
670 |
EMaxStartupConfigurationCmd
|
williamr@2
|
671 |
};
|
williamr@2
|
672 |
|
williamr@2
|
673 |
/**
|
williamr@2
|
674 |
@publishedPartner
|
williamr@2
|
675 |
@released
|
williamr@2
|
676 |
|
williamr@2
|
677 |
Commands to query specific volume information.
|
williamr@2
|
678 |
|
williamr@2
|
679 |
@see TVolumeIOParamInfo
|
williamr@2
|
680 |
*/
|
williamr@2
|
681 |
enum TQueryVolumeInfoExtCmd
|
williamr@2
|
682 |
{
|
williamr@2
|
683 |
/**
|
williamr@2
|
684 |
Queries the sub type of the file system mounted on a specified volume.
|
williamr@2
|
685 |
For example, FAT12, FAT16 or FAT32.
|
williamr@2
|
686 |
*/
|
williamr@2
|
687 |
EFileSystemSubType,
|
williamr@2
|
688 |
|
williamr@2
|
689 |
/**
|
williamr@2
|
690 |
Queries the I/O parameters of a specificed volume.
|
williamr@2
|
691 |
This includes the block size, the cluster size and the recommended read and write sizes for the media.
|
williamr@2
|
692 |
*/
|
williamr@2
|
693 |
EIOParamInfo,
|
williamr@2
|
694 |
|
williamr@2
|
695 |
/**
|
williamr@2
|
696 |
This command determines whether the volume is synchronous or asynchronous.
|
williamr@2
|
697 |
A boolean value is returned within the buffer defined as TPckgBuf<TBool>.
|
williamr@2
|
698 |
ETrue for Synchronous and EFalse for Asynchronous.
|
williamr@2
|
699 |
*/
|
williamr@2
|
700 |
EIsDriveSync,
|
williamr@2
|
701 |
|
williamr@2
|
702 |
/**
|
williamr@2
|
703 |
Query if the given drive is finalised. See RFs::FinaliseDrive()
|
williamr@2
|
704 |
Not all file systems may support this query.
|
williamr@2
|
705 |
A boolean value is returned within the buffer defined as TPckgBuf<TBool>.
|
williamr@2
|
706 |
ETrue value means that the drive is finalised
|
williamr@2
|
707 |
*/
|
williamr@2
|
708 |
EIsDriveFinalised,
|
williamr@2
|
709 |
};
|
williamr@2
|
710 |
|
williamr@2
|
711 |
/**
|
williamr@2
|
712 |
@publishedAll
|
williamr@2
|
713 |
@released
|
williamr@2
|
714 |
|
williamr@2
|
715 |
Volume IO parameter information.
|
williamr@2
|
716 |
|
williamr@2
|
717 |
This class is used to return IO parameter information for a specified volume.
|
williamr@2
|
718 |
|
williamr@2
|
719 |
The volume parameter information holds recommended buffer sizes for the creation of efficient buffers for
|
williamr@2
|
720 |
reading and writing.
|
williamr@2
|
721 |
|
williamr@2
|
722 |
@see RFs::VolumeIOParam()
|
williamr@2
|
723 |
*/
|
williamr@2
|
724 |
class TVolumeIOParamInfo
|
williamr@2
|
725 |
{
|
williamr@2
|
726 |
public:
|
williamr@2
|
727 |
/**
|
williamr@2
|
728 |
The size of a block in bytes.
|
williamr@2
|
729 |
|
williamr@2
|
730 |
Reads and writes that are aligned on block boundaries are up to twice as fast as when
|
williamr@2
|
731 |
mis-aligned.
|
williamr@2
|
732 |
|
williamr@2
|
733 |
Read and write operations on certain underlying media is done in blocks.
|
williamr@2
|
734 |
A write operation that modifies only part of a block is less efficient, in general, than
|
williamr@2
|
735 |
one that modifies an entire block. Data throughput degrades linearly for reads and writes in smaller
|
williamr@2
|
736 |
sized units.
|
williamr@2
|
737 |
*/
|
williamr@2
|
738 |
TInt iBlockSize;
|
williamr@2
|
739 |
/**
|
williamr@2
|
740 |
The size in bytes of a single disk cluster.
|
williamr@2
|
741 |
|
williamr@2
|
742 |
Read and write operations that are aligned on cluster boundaries are more efficient.
|
williamr@2
|
743 |
|
williamr@2
|
744 |
The file system organises and allocates the file data on the disk in clusters where each cluster is
|
williamr@2
|
745 |
one or more blocks. Files that are not zero length occupy at least one cluster of the disk,
|
williamr@2
|
746 |
so large numbers of very small files use up more disk space than expected.
|
williamr@2
|
747 |
*/
|
williamr@2
|
748 |
TInt iClusterSize;
|
williamr@2
|
749 |
/**
|
williamr@2
|
750 |
The recommended buffer size for optimised reading performance.
|
williamr@2
|
751 |
|
williamr@2
|
752 |
The given buffer size is based on sensible benchmark testing results produced by the mobile device vendor.
|
williamr@2
|
753 |
The buffer size is then added to the estart.txt file
|
williamr@2
|
754 |
|
williamr@2
|
755 |
The figure is included in the estart.txt file along with the drive number and the variable name.
|
williamr@2
|
756 |
The example below shows the required format:
|
williamr@2
|
757 |
|
williamr@2
|
758 |
[DriveC]
|
williamr@2
|
759 |
RecReadBufSize 8192
|
williamr@2
|
760 |
|
williamr@2
|
761 |
When no value is provided, value KErrNotSupported is returned.
|
williamr@2
|
762 |
*/
|
williamr@2
|
763 |
TInt iRecReadBufSize;
|
williamr@2
|
764 |
/**
|
williamr@2
|
765 |
The recommended buffer size for optimised writing performance.
|
williamr@2
|
766 |
|
williamr@2
|
767 |
The given buffer size is based on sensible benchmark testing results produced by the mobile device vendor.
|
williamr@2
|
768 |
The buffer size is then added to the estart.txt file
|
williamr@2
|
769 |
|
williamr@2
|
770 |
The figure is included in the estart.txt file along with the drive number and the variable name.
|
williamr@2
|
771 |
The example below shows the required format:
|
williamr@2
|
772 |
|
williamr@2
|
773 |
[DriveC]
|
williamr@2
|
774 |
RecWriteBufSize 16384
|
williamr@2
|
775 |
|
williamr@2
|
776 |
When no value is provided, value KErrNotSupported is returned.
|
williamr@2
|
777 |
*/
|
williamr@2
|
778 |
TInt iRecWriteBufSize;
|
williamr@2
|
779 |
|
williamr@2
|
780 |
private:
|
williamr@2
|
781 |
/*
|
williamr@2
|
782 |
Reserved space for future use
|
williamr@2
|
783 |
*/
|
williamr@2
|
784 |
TInt iReserved[4];
|
williamr@2
|
785 |
};
|
williamr@2
|
786 |
|
williamr@2
|
787 |
enum TDriveNumber
|
williamr@2
|
788 |
/**
|
williamr@2
|
789 |
@publishedAll
|
williamr@2
|
790 |
@released
|
williamr@2
|
791 |
|
williamr@2
|
792 |
The drive number enumeration.
|
williamr@2
|
793 |
*/
|
williamr@2
|
794 |
{
|
williamr@2
|
795 |
EDriveA, EDriveB, EDriveC, EDriveD, EDriveE,
|
williamr@2
|
796 |
EDriveF, EDriveG, EDriveH, EDriveI, EDriveJ,
|
williamr@2
|
797 |
EDriveK, EDriveL, EDriveM, EDriveN, EDriveO,
|
williamr@2
|
798 |
EDriveP, EDriveQ, EDriveR, EDriveS, EDriveT,
|
williamr@2
|
799 |
EDriveU, EDriveV, EDriveW, EDriveX, EDriveY,
|
williamr@2
|
800 |
EDriveZ
|
williamr@2
|
801 |
};
|
williamr@2
|
802 |
|
williamr@2
|
803 |
|
williamr@2
|
804 |
|
williamr@2
|
805 |
|
williamr@2
|
806 |
enum TEntryKey
|
williamr@2
|
807 |
/**
|
williamr@2
|
808 |
@publishedAll
|
williamr@2
|
809 |
@released
|
williamr@2
|
810 |
|
williamr@2
|
811 |
Flags indicating the order in which directory entries are to be sorted.
|
williamr@2
|
812 |
|
williamr@2
|
813 |
@see RFs::GetDir
|
williamr@2
|
814 |
@see CDirScan::SetScanDataL
|
williamr@2
|
815 |
@see CDir::Sort
|
williamr@2
|
816 |
*/
|
williamr@2
|
817 |
{
|
williamr@2
|
818 |
/**
|
williamr@2
|
819 |
The default; no sorting takes place
|
williamr@2
|
820 |
*/
|
williamr@2
|
821 |
ESortNone=0,
|
williamr@2
|
822 |
|
williamr@2
|
823 |
|
williamr@2
|
824 |
/**
|
williamr@2
|
825 |
Sort according to alphabetic order of file and directory name.
|
williamr@2
|
826 |
|
williamr@2
|
827 |
This setting is mutually exclusive with ESortByExt, ESortBySize,
|
williamr@2
|
828 |
ESortByDate and ESortByUid.
|
williamr@2
|
829 |
*/
|
williamr@2
|
830 |
ESortByName,
|
williamr@2
|
831 |
|
williamr@2
|
832 |
|
williamr@2
|
833 |
/**
|
williamr@2
|
834 |
Sort according to alphabetic order of file extension.
|
williamr@2
|
835 |
|
williamr@2
|
836 |
Files without an extension take precedence over files with an extension.
|
williamr@2
|
837 |
For files with the same extension or without an extension, the default is
|
williamr@2
|
838 |
to sort by name.
|
williamr@2
|
839 |
|
williamr@2
|
840 |
This setting is mutually exclusive with ESortByName, ESortBySize,
|
williamr@2
|
841 |
ESortByDate and ESortByUid.
|
williamr@2
|
842 |
*/
|
williamr@2
|
843 |
ESortByExt,
|
williamr@2
|
844 |
|
williamr@2
|
845 |
|
williamr@2
|
846 |
/**
|
williamr@2
|
847 |
Sort according to file size.
|
williamr@2
|
848 |
|
williamr@2
|
849 |
This setting is mutually exclusive with ESortByName, ESortByExt,
|
williamr@2
|
850 |
ESortByDate and ESortByUid.
|
williamr@2
|
851 |
*/
|
williamr@2
|
852 |
ESortBySize,
|
williamr@2
|
853 |
|
williamr@2
|
854 |
|
williamr@2
|
855 |
/**
|
williamr@2
|
856 |
Sort according to files' last modified time and date.
|
williamr@2
|
857 |
|
williamr@2
|
858 |
By default, most recent last.
|
williamr@2
|
859 |
|
williamr@2
|
860 |
This setting is mutually exclusive with ESortByName, ESortByExt,
|
williamr@2
|
861 |
ESortBySize and ESortByUid.
|
williamr@2
|
862 |
*/
|
williamr@2
|
863 |
ESortByDate,
|
williamr@2
|
864 |
|
williamr@2
|
865 |
|
williamr@2
|
866 |
/**
|
williamr@2
|
867 |
Sort according to file UID.
|
williamr@2
|
868 |
|
williamr@2
|
869 |
This setting is mutually exclusive with ESortByName, ESortByExt,
|
williamr@2
|
870 |
ESortBySize and ESortByDate.
|
williamr@2
|
871 |
*/
|
williamr@2
|
872 |
ESortByUid,
|
williamr@2
|
873 |
|
williamr@2
|
874 |
|
williamr@2
|
875 |
/**
|
williamr@2
|
876 |
Qualifies the sort order; if set, directories are listed in the order in
|
williamr@2
|
877 |
which they occur.
|
williamr@2
|
878 |
|
williamr@2
|
879 |
This is the default.
|
williamr@2
|
880 |
|
williamr@2
|
881 |
This flag is mutually exclusive with EDirsFirst and EDirslast.
|
williamr@2
|
882 |
*/
|
williamr@2
|
883 |
EDirsAnyOrder=0,
|
williamr@2
|
884 |
|
williamr@2
|
885 |
|
williamr@2
|
886 |
/**
|
williamr@2
|
887 |
Qualifies the sort order; if set, directories come before files in sort order.
|
williamr@2
|
888 |
|
williamr@2
|
889 |
This flag is mutually exclusive with EDirsAnyOrder and EDirsLast.
|
williamr@2
|
890 |
*/
|
williamr@2
|
891 |
EDirsFirst=0x100,
|
williamr@2
|
892 |
|
williamr@2
|
893 |
|
williamr@2
|
894 |
/**
|
williamr@2
|
895 |
Qualifies the sort order; if set, files come before directories in sort order.
|
williamr@2
|
896 |
|
williamr@2
|
897 |
This flag is mutually exclusive with EDirsAnyOrder and EDirsFirst.
|
williamr@2
|
898 |
*/
|
williamr@2
|
899 |
EDirsLast=0x200,
|
williamr@2
|
900 |
|
williamr@2
|
901 |
|
williamr@2
|
902 |
/**
|
williamr@2
|
903 |
Qualifies the sort order; files are sorted in ascending order, i.e. from A to Z.
|
williamr@2
|
904 |
This is the default behaviour.
|
williamr@2
|
905 |
|
williamr@2
|
906 |
This flag is mutually exclusive with EDescending and EDirDescending.
|
williamr@2
|
907 |
*/
|
williamr@2
|
908 |
EAscending=0,
|
williamr@2
|
909 |
|
williamr@2
|
910 |
|
williamr@2
|
911 |
/**
|
williamr@2
|
912 |
Qualifies the sort order; files are sorted in descending order, i.e. from Z to A.
|
williamr@2
|
913 |
|
williamr@2
|
914 |
This flag is mutually exclusive with EAscending and EDirDescending.
|
williamr@2
|
915 |
*/
|
williamr@2
|
916 |
EDescending=0x400,
|
williamr@2
|
917 |
|
williamr@2
|
918 |
|
williamr@2
|
919 |
/**
|
williamr@2
|
920 |
Qualifies the sort order; directories are sorted in descending order, i.e. from Z to A.
|
williamr@2
|
921 |
|
williamr@2
|
922 |
This flag shall be used in combination with either EDirsFirst or EDirsLast.
|
williamr@2
|
923 |
This flag is mutually exclusive with EAscending and EDescending.
|
williamr@2
|
924 |
*/
|
williamr@2
|
925 |
EDirDescending=0x800
|
williamr@2
|
926 |
};
|
williamr@2
|
927 |
|
williamr@2
|
928 |
|
williamr@2
|
929 |
|
williamr@2
|
930 |
|
williamr@2
|
931 |
enum TFileMode
|
williamr@2
|
932 |
/**
|
williamr@2
|
933 |
@publishedAll
|
williamr@2
|
934 |
@released
|
williamr@2
|
935 |
|
williamr@2
|
936 |
Access and share modes available when opening a file.
|
williamr@2
|
937 |
|
williamr@2
|
938 |
The access mode indicates whether the file is opened just for reading or
|
williamr@2
|
939 |
for writing.
|
williamr@2
|
940 |
|
williamr@2
|
941 |
The share mode indicates whether other RFile objects can access the
|
williamr@2
|
942 |
open file, and whether this access is read only.
|
williamr@2
|
943 |
|
williamr@2
|
944 |
Use EFileShareReadersOrWriters if a client does not care whether the file has
|
williamr@2
|
945 |
been previously opened for ReadOnly or Read/Write access.
|
williamr@2
|
946 |
|
williamr@2
|
947 |
If EFileShareReadersOrWriters is not used, then a client needs to cooperate with
|
williamr@2
|
948 |
other clients in order to open the file with the correct share mode, either
|
williamr@2
|
949 |
EFileShareReadersOnly or EFileShareAny, depending on the share mode used when
|
williamr@2
|
950 |
the file was originally opened.
|
williamr@2
|
951 |
|
williamr@2
|
952 |
To open a file for reading and writing with read and write shared access,
|
williamr@2
|
953 |
use:
|
williamr@2
|
954 |
|
williamr@2
|
955 |
@code
|
williamr@2
|
956 |
_LIT(KFilename, "filename.ext");
|
williamr@2
|
957 |
RFile file;
|
williamr@2
|
958 |
file.Open(theFs, KFilename, EFileShareAny|EFileWrite);
|
williamr@2
|
959 |
@endcode
|
williamr@2
|
960 |
|
williamr@2
|
961 |
If another instance of RFile tries to open this file in EFileShareExclusive
|
williamr@2
|
962 |
or EFileShareReadersOnly mode, access is denied. However, it can be opened
|
williamr@2
|
963 |
in EFileShareAny mode or EFileShareReadersOrWriters mode.
|
williamr@2
|
964 |
|
williamr@2
|
965 |
If a file is opened with EFileShareReadersOrWriters, and the file is opened for
|
williamr@2
|
966 |
sharing by another client, then the file share mode is promoted to the new share
|
williamr@2
|
967 |
mode. When the file handle is closed then the share mode is demoted back to
|
williamr@2
|
968 |
EFileShareReadersOrWriters.
|
williamr@2
|
969 |
|
williamr@2
|
970 |
@code
|
williamr@2
|
971 |
|
williamr@2
|
972 |
Table of FileShare promotion rules
|
williamr@2
|
973 |
----------------------------------
|
williamr@2
|
974 |
|
williamr@2
|
975 |
Client A Client B Resultant Share Mode
|
williamr@2
|
976 |
-------- -------- --------------------
|
williamr@2
|
977 |
ReadersOnly ReadersOnly ReadersOnly
|
williamr@2
|
978 |
ReadersOnly ReadersOrWriters|EFileRead ReadersOnly
|
williamr@2
|
979 |
ReadersOnly ReadersOrWriters|EFileWrite INCOMPATIBLE
|
williamr@2
|
980 |
ReadersOnly Any INCOMPATIBLE
|
williamr@2
|
981 |
|
williamr@2
|
982 |
ReadersOrWriters|EFileRead ReadersOnly ReadersOnly
|
williamr@2
|
983 |
ReadersOrWriters|EFileRead ReadersOrWriters|EFileRead ReadersOrWriters
|
williamr@2
|
984 |
ReadersOrWriters|EFileRead ReadersOrWriters|EFileWrite ReadersOrWriters
|
williamr@2
|
985 |
ReadersOrWriters|EFileRead Any Any
|
williamr@2
|
986 |
|
williamr@2
|
987 |
ReadersOrWriters|EFileWrite ReadersOnly INCOMPATIBLE
|
williamr@2
|
988 |
ReadersOrWriters|EFileWrite ReadersOrWriters|EFileRead ReadersOrWriters
|
williamr@2
|
989 |
ReadersOrWriters|EFileWrite ReadersOrWriters|EFileWrite ReadersOrWriters
|
williamr@2
|
990 |
ReadersOrWriters|EFileWrite Any Any
|
williamr@2
|
991 |
|
williamr@2
|
992 |
Any ReadersOnly INCOMPATIBLE
|
williamr@2
|
993 |
Any ReadersOrWriters|EFileRead Any
|
williamr@2
|
994 |
Any ReadersOrWriters|EFileWrite Any
|
williamr@2
|
995 |
Any Any Any
|
williamr@2
|
996 |
@endcode
|
williamr@2
|
997 |
|
williamr@2
|
998 |
Use the following guidance notes for selecting FileShare mode with shared RFile objects:
|
williamr@2
|
999 |
|
williamr@2
|
1000 |
EFileShareAny
|
williamr@2
|
1001 |
- Use this mode to request both read and write access when another client needs
|
williamr@2
|
1002 |
to write to the file and respective client access to the file is coordinated.
|
williamr@2
|
1003 |
- To open a file for non-exclusive write, use EFileShareAny | EFileWrite.
|
williamr@2
|
1004 |
- It is recommended that either EFileShareAny or EFileShareAny | EFileRead are
|
williamr@2
|
1005 |
not used. These combinations will block users attempting to use the
|
williamr@2
|
1006 |
EFileShareReadersOnly mode even if all the EFileShareAny handles do not have
|
williamr@2
|
1007 |
the EFileWrite bit set as the EFileRead and EFileWrite bits have no affect on
|
williamr@2
|
1008 |
sharing. Use either EFileShareReadersOnly or EFileShareReadersOrWriters.
|
williamr@2
|
1009 |
|
williamr@2
|
1010 |
EFileShareReadersOrWriters
|
williamr@2
|
1011 |
- Use this mode when it does not matter if another file writes to the file and
|
williamr@2
|
1012 |
file access can not be coordinated as other clients are unknown.
|
williamr@2
|
1013 |
- To open a file for shared read access whilst permitting writers, use
|
williamr@2
|
1014 |
EFileShareReadersOrWriters | EFileRead.
|
williamr@2
|
1015 |
|
williamr@2
|
1016 |
- For write access with unrestricted share mode,
|
williamr@2
|
1017 |
EFileShareReadersOrWriters | EFileWrite may be used however
|
williamr@2
|
1018 |
EFilesShareAny | EFileWrite is preferred.
|
williamr@2
|
1019 |
|
williamr@2
|
1020 |
EFileShareReadersOnly
|
williamr@2
|
1021 |
- Use this mode to get read access to the file and deny write access for any
|
williamr@2
|
1022 |
other handles on this file.
|
williamr@2
|
1023 |
- To open a file for shared read access whilst disallowing writers use
|
williamr@2
|
1024 |
EFileShareReadersOnly.
|
williamr@2
|
1025 |
|
williamr@2
|
1026 |
|
williamr@2
|
1027 |
Files may be opened in text or binary mode. Native Symbian OS application
|
williamr@2
|
1028 |
files are nearly all binary, (so they will usually be opened in binary mode).
|
williamr@2
|
1029 |
However, they can be opened in text mode (to support testing, and to make them
|
williamr@2
|
1030 |
compatible with text formats on remote systems).
|
williamr@2
|
1031 |
Symbian OS native text format uses CR-LF (ASCII 0x0d, 0x0a) to denote the end of
|
williamr@2
|
1032 |
a line. When reading, however, any combination of CR, LF, LF-CR or CR-LF is
|
williamr@2
|
1033 |
recognised as the end of a line. Where a remote file system uses a different
|
williamr@2
|
1034 |
format, it is the responsibility of the installable file system to present
|
williamr@2
|
1035 |
an interface for text files which conforms with this format.
|
williamr@2
|
1036 |
|
williamr@2
|
1037 |
The share mode may be OR’ed with either EFileStream or EFileStreamText.
|
williamr@2
|
1038 |
|
williamr@2
|
1039 |
Additionally, it may be OR’ed with either EFileRead or EFileWrite.
|
williamr@2
|
1040 |
*/
|
williamr@2
|
1041 |
{
|
williamr@2
|
1042 |
/**
|
williamr@2
|
1043 |
Exclusive access for the program opening the file.
|
williamr@2
|
1044 |
|
williamr@2
|
1045 |
No other program can access the file until it is closed.
|
williamr@2
|
1046 |
If another program is already accessing the file in any share mode, then
|
williamr@2
|
1047 |
an attempt to open it with an EFileShareExclusive will fail.
|
williamr@2
|
1048 |
*/
|
williamr@2
|
1049 |
EFileShareExclusive,
|
williamr@2
|
1050 |
|
williamr@2
|
1051 |
|
williamr@2
|
1052 |
/**
|
williamr@2
|
1053 |
Read-only sharing.
|
williamr@2
|
1054 |
|
williamr@2
|
1055 |
This means that the file may only be accessed for reading.
|
williamr@2
|
1056 |
A file cannot be opened using a share mode of EFileShareReadersOnly with
|
williamr@2
|
1057 |
an EFileWrite flag.
|
williamr@2
|
1058 |
*/
|
williamr@2
|
1059 |
EFileShareReadersOnly,
|
williamr@2
|
1060 |
|
williamr@2
|
1061 |
|
williamr@2
|
1062 |
/**
|
williamr@2
|
1063 |
Shared access for reading and writing.
|
williamr@2
|
1064 |
|
williamr@2
|
1065 |
This means that other programs may share access to the file for reading
|
williamr@2
|
1066 |
and writing with the program which opened the file.
|
williamr@2
|
1067 |
|
williamr@2
|
1068 |
When using this mode, the program is expecting another program to be able
|
williamr@2
|
1069 |
to write to the file, so is not compatible with EFileShareReadersOnly.
|
williamr@2
|
1070 |
*/
|
williamr@2
|
1071 |
EFileShareAny,
|
williamr@2
|
1072 |
|
williamr@2
|
1073 |
|
williamr@2
|
1074 |
/**
|
williamr@2
|
1075 |
Shared access for reading and writing.
|
williamr@2
|
1076 |
|
williamr@2
|
1077 |
This means that other programs may share access to the file for reading
|
williamr@2
|
1078 |
and writing with the program which opened the file.
|
williamr@2
|
1079 |
|
williamr@2
|
1080 |
When using this mode, the program does not care if another program has
|
williamr@2
|
1081 |
the file open for read or write access.
|
williamr@2
|
1082 |
*/
|
williamr@2
|
1083 |
EFileShareReadersOrWriters,
|
williamr@2
|
1084 |
|
williamr@2
|
1085 |
|
williamr@2
|
1086 |
/**
|
williamr@2
|
1087 |
For files to be opened in binary mode.
|
williamr@2
|
1088 |
*/
|
williamr@2
|
1089 |
EFileStream=0,
|
williamr@2
|
1090 |
|
williamr@2
|
1091 |
|
williamr@2
|
1092 |
/**
|
williamr@2
|
1093 |
For files to be opened in text mode.
|
williamr@2
|
1094 |
*/
|
williamr@2
|
1095 |
EFileStreamText=0x100,
|
williamr@2
|
1096 |
|
williamr@2
|
1097 |
|
williamr@2
|
1098 |
/**
|
williamr@2
|
1099 |
The file may be read from but not written to.
|
williamr@2
|
1100 |
*/
|
williamr@2
|
1101 |
EFileRead=0,
|
williamr@2
|
1102 |
|
williamr@2
|
1103 |
|
williamr@2
|
1104 |
/**
|
williamr@2
|
1105 |
The file may be read from and written to
|
williamr@2
|
1106 |
|
williamr@2
|
1107 |
Cannot be combined with a share mode of EFileShareReadersOnly.
|
williamr@2
|
1108 |
*/
|
williamr@2
|
1109 |
EFileWrite=0x200,
|
williamr@2
|
1110 |
|
williamr@2
|
1111 |
/**
|
williamr@2
|
1112 |
Specifies that an asynchronous read request should not be completed
|
williamr@2
|
1113 |
until all requested data becomes available.
|
williamr@2
|
1114 |
|
williamr@2
|
1115 |
Cannot be combined with the EFileShareExclusive or EFileShareReadersOnly
|
williamr@2
|
1116 |
share modes as this will prohibit a writer from updating the file.
|
williamr@2
|
1117 |
*/
|
williamr@2
|
1118 |
EFileReadAsyncAll=0x400,
|
williamr@2
|
1119 |
|
williamr@2
|
1120 |
/**
|
williamr@2
|
1121 |
Enables write buffering
|
williamr@2
|
1122 |
*/
|
williamr@2
|
1123 |
EFileWriteBuffered =0x00000800,
|
williamr@2
|
1124 |
|
williamr@2
|
1125 |
/**
|
williamr@2
|
1126 |
Disables write buffering
|
williamr@2
|
1127 |
*/
|
williamr@2
|
1128 |
EFileWriteDirectIO =0x00001000,
|
williamr@2
|
1129 |
|
williamr@2
|
1130 |
/**
|
williamr@2
|
1131 |
Enables read buffering
|
williamr@2
|
1132 |
*/
|
williamr@2
|
1133 |
EFileReadBuffered =0x00002000,
|
williamr@2
|
1134 |
|
williamr@2
|
1135 |
/**
|
williamr@2
|
1136 |
Disables read buffering
|
williamr@2
|
1137 |
*/
|
williamr@2
|
1138 |
EFileReadDirectIO =0x00004000,
|
williamr@2
|
1139 |
|
williamr@2
|
1140 |
/**
|
williamr@2
|
1141 |
Enables read ahead.
|
williamr@2
|
1142 |
*/
|
williamr@2
|
1143 |
EFileReadAheadOn =0x00008000,
|
williamr@2
|
1144 |
|
williamr@2
|
1145 |
/**
|
williamr@2
|
1146 |
Disables read ahead.
|
williamr@2
|
1147 |
*/
|
williamr@2
|
1148 |
EFileReadAheadOff =0x00010000
|
williamr@2
|
1149 |
};
|
williamr@2
|
1150 |
|
williamr@2
|
1151 |
|
williamr@2
|
1152 |
|
williamr@2
|
1153 |
|
williamr@2
|
1154 |
/**
|
williamr@2
|
1155 |
@publishedAll
|
williamr@2
|
1156 |
@released
|
williamr@2
|
1157 |
|
williamr@2
|
1158 |
Bit mask provided for retrieving a file's share mode.
|
williamr@2
|
1159 |
|
williamr@2
|
1160 |
@see TFileMode
|
williamr@2
|
1161 |
*/
|
williamr@2
|
1162 |
const TUint KFileShareMask=0xff;
|
williamr@2
|
1163 |
|
williamr@2
|
1164 |
|
williamr@2
|
1165 |
|
williamr@2
|
1166 |
|
williamr@2
|
1167 |
enum TFormatMode
|
williamr@2
|
1168 |
/**
|
williamr@2
|
1169 |
@publishedAll
|
williamr@2
|
1170 |
@released
|
williamr@2
|
1171 |
|
williamr@2
|
1172 |
The format method.
|
williamr@2
|
1173 |
*/
|
williamr@2
|
1174 |
{
|
williamr@2
|
1175 |
/**
|
williamr@2
|
1176 |
Indicates a high density floppy disk to be formatted.
|
williamr@2
|
1177 |
*/
|
williamr@2
|
1178 |
EHighDensity,
|
williamr@2
|
1179 |
|
williamr@2
|
1180 |
|
williamr@2
|
1181 |
/**
|
williamr@2
|
1182 |
Indicates a standard floppy disk to be formatted.
|
williamr@2
|
1183 |
*/
|
williamr@2
|
1184 |
ELowDensity,
|
williamr@2
|
1185 |
|
williamr@2
|
1186 |
|
williamr@2
|
1187 |
/**
|
williamr@2
|
1188 |
Performs a full format, erasing existing content and resetting the FAT
|
williamr@2
|
1189 |
and root directory.
|
williamr@2
|
1190 |
|
williamr@2
|
1191 |
This is the default, and can be ORed with bit EHighDensity or ELowDensity.
|
williamr@2
|
1192 |
*/
|
williamr@2
|
1193 |
EFullFormat=0,
|
williamr@2
|
1194 |
|
williamr@2
|
1195 |
|
williamr@2
|
1196 |
/**
|
williamr@2
|
1197 |
Does the minimum required to format the device, only resetting the FAT
|
williamr@2
|
1198 |
and root directory.
|
williamr@2
|
1199 |
|
williamr@2
|
1200 |
This is the default, and can be ORed with bit EHighDensity or ELowDensity.
|
williamr@2
|
1201 |
*/
|
williamr@2
|
1202 |
EQuickFormat=0x100,
|
williamr@2
|
1203 |
|
williamr@2
|
1204 |
|
williamr@2
|
1205 |
/**
|
williamr@2
|
1206 |
Indicates a custom formatting mode.
|
williamr@2
|
1207 |
*/
|
williamr@2
|
1208 |
ESpecialFormat=0x200,
|
williamr@2
|
1209 |
|
williamr@2
|
1210 |
/**
|
williamr@2
|
1211 |
Forced erase of locked media
|
williamr@2
|
1212 |
*/
|
williamr@2
|
1213 |
EForceErase=0x400
|
williamr@2
|
1214 |
};
|
williamr@2
|
1215 |
|
williamr@2
|
1216 |
|
williamr@2
|
1217 |
|
williamr@2
|
1218 |
|
williamr@2
|
1219 |
enum TSeek
|
williamr@2
|
1220 |
/**
|
williamr@2
|
1221 |
@publishedAll
|
williamr@2
|
1222 |
@released
|
williamr@2
|
1223 |
|
williamr@2
|
1224 |
Flags indicating the destination of a seek operation.
|
williamr@2
|
1225 |
|
williamr@2
|
1226 |
File locations are specified as a 32-bit signed integer,
|
williamr@2
|
1227 |
allowing offsets of ?GB from the origin of the seek.
|
williamr@2
|
1228 |
|
williamr@2
|
1229 |
@see RFile::Seek
|
williamr@2
|
1230 |
*/
|
williamr@2
|
1231 |
{
|
williamr@2
|
1232 |
/**
|
williamr@2
|
1233 |
This can only be used for file systems with execute-in-place facilities,
|
williamr@2
|
1234 |
such as the ROM file system: the offset specifies the absolute address of
|
williamr@2
|
1235 |
the data.
|
williamr@2
|
1236 |
*/
|
williamr@2
|
1237 |
ESeekAddress,
|
williamr@2
|
1238 |
|
williamr@2
|
1239 |
|
williamr@2
|
1240 |
/**
|
williamr@2
|
1241 |
Destination is the start of file.
|
williamr@2
|
1242 |
*/
|
williamr@2
|
1243 |
ESeekStart,
|
williamr@2
|
1244 |
|
williamr@2
|
1245 |
|
williamr@2
|
1246 |
/**
|
williamr@2
|
1247 |
Destination is the current position in file.
|
williamr@2
|
1248 |
*/
|
williamr@2
|
1249 |
ESeekCurrent,
|
williamr@2
|
1250 |
|
williamr@2
|
1251 |
|
williamr@2
|
1252 |
/**
|
williamr@2
|
1253 |
Destination is the end of file.
|
williamr@2
|
1254 |
*/
|
williamr@2
|
1255 |
ESeekEnd
|
williamr@2
|
1256 |
};
|
williamr@2
|
1257 |
|
williamr@2
|
1258 |
/**
|
williamr@2
|
1259 |
|
williamr@2
|
1260 |
*/
|
williamr@2
|
1261 |
class TBlockMapEntry : public TBlockMapEntryBase
|
williamr@2
|
1262 |
{
|
williamr@2
|
1263 |
public:
|
williamr@2
|
1264 |
IMPORT_C TBlockMapEntry();
|
williamr@2
|
1265 |
IMPORT_C void SetNumberOfBlocks( TUint aNumberOfBlocks );
|
williamr@2
|
1266 |
IMPORT_C void SetStartBlock( TUint aStartBlock );
|
williamr@2
|
1267 |
};
|
williamr@2
|
1268 |
|
williamr@2
|
1269 |
/**
|
williamr@2
|
1270 |
|
williamr@2
|
1271 |
*/
|
williamr@2
|
1272 |
typedef TBuf8<KMaxMapsPerCall*sizeof(TBlockMapEntry)> TBlockArrayDes;
|
williamr@2
|
1273 |
|
williamr@2
|
1274 |
struct SBlockMapInfo : public SBlockMapInfoBase
|
williamr@2
|
1275 |
{
|
williamr@2
|
1276 |
TBlockArrayDes iMap;
|
williamr@2
|
1277 |
};
|
williamr@2
|
1278 |
|
williamr@2
|
1279 |
/**
|
williamr@2
|
1280 |
|
williamr@2
|
1281 |
*/
|
williamr@2
|
1282 |
enum TBlockMapUsage
|
williamr@2
|
1283 |
{
|
williamr@2
|
1284 |
/* */
|
williamr@2
|
1285 |
EBlockMapUsagePaging,
|
williamr@2
|
1286 |
/* */
|
williamr@2
|
1287 |
ETestDebug
|
williamr@2
|
1288 |
};
|
williamr@2
|
1289 |
|
williamr@2
|
1290 |
class TEntry
|
williamr@2
|
1291 |
/**
|
williamr@2
|
1292 |
@publishedAll
|
williamr@2
|
1293 |
@released
|
williamr@2
|
1294 |
|
williamr@2
|
1295 |
Encapsulates an entry in a directory, which can be another (nested) directory,
|
williamr@2
|
1296 |
a file or a volume label.
|
williamr@2
|
1297 |
|
williamr@2
|
1298 |
Each directory entry has a name which is relative to its owning directory
|
williamr@2
|
1299 |
and a type, which is indicated by its unique identifier (UID).
|
williamr@2
|
1300 |
|
williamr@2
|
1301 |
An entry can be interrogated for the following properties:
|
williamr@2
|
1302 |
|
williamr@2
|
1303 |
1. the kind of entry: stored in the entry UIDs, stored in iType
|
williamr@2
|
1304 |
|
williamr@2
|
1305 |
2. the entry attributes, stored in iAtt
|
williamr@2
|
1306 |
|
williamr@2
|
1307 |
3. the size of entry
|
williamr@2
|
1308 |
|
williamr@2
|
1309 |
4. the time the entry was last modified.
|
williamr@2
|
1310 |
|
williamr@2
|
1311 |
@see RDir
|
williamr@2
|
1312 |
@see RFs::Entry
|
williamr@2
|
1313 |
@see RFs::SetEntry
|
williamr@2
|
1314 |
@see CfileBase::CurrentEntry
|
williamr@2
|
1315 |
*/
|
williamr@2
|
1316 |
{
|
williamr@2
|
1317 |
public:
|
williamr@2
|
1318 |
IMPORT_C TEntry();
|
williamr@2
|
1319 |
IMPORT_C TEntry(const TEntry& aEntry);
|
williamr@2
|
1320 |
IMPORT_C TEntry& operator=(const TEntry& aEntry);
|
williamr@2
|
1321 |
IMPORT_C TBool IsReadOnly() const;
|
williamr@2
|
1322 |
IMPORT_C TBool IsHidden() const;
|
williamr@2
|
1323 |
IMPORT_C TBool IsSystem() const;
|
williamr@2
|
1324 |
IMPORT_C TBool IsDir() const;
|
williamr@2
|
1325 |
IMPORT_C TBool IsArchive() const;
|
williamr@2
|
1326 |
inline const TUid& operator[](TInt anIndex) const;
|
williamr@2
|
1327 |
inline TBool IsUidPresent(TUid aUid) const;
|
williamr@2
|
1328 |
inline TBool IsTypeValid() const;
|
williamr@2
|
1329 |
inline TUid MostDerivedUid() const;
|
williamr@2
|
1330 |
public:
|
williamr@2
|
1331 |
/**
|
williamr@2
|
1332 |
The individual bits within this byte indicate which attributes
|
williamr@2
|
1333 |
have been set.
|
williamr@2
|
1334 |
|
williamr@2
|
1335 |
@see KEntryAttNormal
|
williamr@2
|
1336 |
@see KEntryAttReadOnly
|
williamr@2
|
1337 |
@see KEntryAttHidden
|
williamr@2
|
1338 |
@see KEntryAttSystem
|
williamr@2
|
1339 |
*/
|
williamr@2
|
1340 |
TUint iAtt;
|
williamr@2
|
1341 |
|
williamr@2
|
1342 |
|
williamr@2
|
1343 |
/**
|
williamr@2
|
1344 |
The size of the file in bytes.
|
williamr@2
|
1345 |
For files larger that 2G it must be cast to TUint in order to avoid looking like negative signed.
|
williamr@2
|
1346 |
*/
|
williamr@2
|
1347 |
TInt iSize;
|
williamr@2
|
1348 |
|
williamr@2
|
1349 |
|
williamr@2
|
1350 |
/**
|
williamr@2
|
1351 |
The local time of last modification.
|
williamr@2
|
1352 |
*/
|
williamr@2
|
1353 |
TTime iModified;
|
williamr@2
|
1354 |
|
williamr@2
|
1355 |
|
williamr@2
|
1356 |
/**
|
williamr@2
|
1357 |
The file's UIDtype
|
williamr@2
|
1358 |
*/
|
williamr@2
|
1359 |
TUidType iType;
|
williamr@2
|
1360 |
|
williamr@2
|
1361 |
|
williamr@2
|
1362 |
/**
|
williamr@2
|
1363 |
The name of the file relative to the owning directory,
|
williamr@2
|
1364 |
with a maximum of KMaxFileName characters.
|
williamr@2
|
1365 |
|
williamr@2
|
1366 |
@see KMaxFileName
|
williamr@2
|
1367 |
*/
|
williamr@2
|
1368 |
TBufC<KMaxFileName> iName;
|
williamr@2
|
1369 |
|
williamr@2
|
1370 |
private:
|
williamr@2
|
1371 |
/**
|
williamr@2
|
1372 |
Reserved for future expansion
|
williamr@2
|
1373 |
*/
|
williamr@2
|
1374 |
TUint32 iReserved[2];
|
williamr@2
|
1375 |
};
|
williamr@2
|
1376 |
|
williamr@2
|
1377 |
|
williamr@2
|
1378 |
|
williamr@2
|
1379 |
|
williamr@2
|
1380 |
class RDir;
|
williamr@2
|
1381 |
class TEntryArray
|
williamr@2
|
1382 |
/**
|
williamr@2
|
1383 |
@publishedAll
|
williamr@2
|
1384 |
@released
|
williamr@2
|
1385 |
|
williamr@2
|
1386 |
Array of directory entries.
|
williamr@2
|
1387 |
|
williamr@2
|
1388 |
It contains the results of a call to RDir::Read(): it will contain all
|
williamr@2
|
1389 |
the TEntry items in the directory. Thus, a directory can be read in
|
williamr@2
|
1390 |
a single call, minimising client/server communication overheads.
|
williamr@2
|
1391 |
|
williamr@2
|
1392 |
@see TEntry
|
williamr@2
|
1393 |
@see RDir::Read
|
williamr@2
|
1394 |
*/
|
williamr@2
|
1395 |
{
|
williamr@2
|
1396 |
public:
|
williamr@2
|
1397 |
IMPORT_C TEntryArray();
|
williamr@2
|
1398 |
IMPORT_C TInt Count() const;
|
williamr@2
|
1399 |
IMPORT_C const TEntry& operator[](TInt anIndex) const;
|
williamr@2
|
1400 |
private:
|
williamr@2
|
1401 |
TInt iCount;
|
williamr@2
|
1402 |
TInt iIndex;
|
williamr@2
|
1403 |
const TEntry* iPos;
|
williamr@2
|
1404 |
TBuf8<KEntryArraySize> iBuf;
|
williamr@2
|
1405 |
friend class RDir;
|
williamr@2
|
1406 |
friend class RFs;
|
williamr@2
|
1407 |
};
|
williamr@2
|
1408 |
|
williamr@2
|
1409 |
|
williamr@2
|
1410 |
|
williamr@2
|
1411 |
|
williamr@2
|
1412 |
class TDriveInfo
|
williamr@2
|
1413 |
/**
|
williamr@2
|
1414 |
@publishedAll
|
williamr@2
|
1415 |
@released
|
williamr@2
|
1416 |
|
williamr@2
|
1417 |
Contains drive information.
|
williamr@2
|
1418 |
|
williamr@2
|
1419 |
@see RFs::Drive
|
williamr@2
|
1420 |
*/
|
williamr@2
|
1421 |
{
|
williamr@2
|
1422 |
public:
|
williamr@2
|
1423 |
/**
|
williamr@2
|
1424 |
The type of media mounted on the drive.
|
williamr@2
|
1425 |
*/
|
williamr@2
|
1426 |
TMediaType iType;
|
williamr@2
|
1427 |
|
williamr@2
|
1428 |
|
williamr@2
|
1429 |
/**
|
williamr@2
|
1430 |
Indicates whether the drive supports a battery, and if so, its state.
|
williamr@2
|
1431 |
*/
|
williamr@2
|
1432 |
TBatteryState iBattery;
|
williamr@2
|
1433 |
|
williamr@2
|
1434 |
|
williamr@2
|
1435 |
/**
|
williamr@2
|
1436 |
The drive attributes.
|
williamr@2
|
1437 |
|
williamr@2
|
1438 |
@see KDriveAttLocal
|
williamr@2
|
1439 |
@see KDriveAttRom
|
williamr@2
|
1440 |
@see KDriveAttRedirected
|
williamr@2
|
1441 |
@see KDriveAttSubsted
|
williamr@2
|
1442 |
@see KDriveAttInternal
|
williamr@2
|
1443 |
@see KDriveAttRemovable
|
williamr@2
|
1444 |
*/
|
williamr@2
|
1445 |
TUint iDriveAtt;
|
williamr@2
|
1446 |
|
williamr@2
|
1447 |
|
williamr@2
|
1448 |
/**
|
williamr@2
|
1449 |
The attributes of the media mounted on the drive.
|
williamr@2
|
1450 |
|
williamr@2
|
1451 |
@see KMediaAttVariableSize
|
williamr@2
|
1452 |
@see KMediaAttDualDensity
|
williamr@2
|
1453 |
@see KMediaAttFormattable
|
williamr@2
|
1454 |
@see KMediaAttWriteProtected
|
williamr@2
|
1455 |
@see KMediaAttLockable
|
williamr@2
|
1456 |
@see KMediaAttLocked
|
williamr@2
|
1457 |
*/
|
williamr@2
|
1458 |
TUint iMediaAtt;
|
williamr@2
|
1459 |
private:
|
williamr@2
|
1460 |
/**
|
williamr@2
|
1461 |
Reserved for future expansion
|
williamr@2
|
1462 |
*/
|
williamr@2
|
1463 |
TUint32 iReserved;
|
williamr@2
|
1464 |
};
|
williamr@2
|
1465 |
|
williamr@2
|
1466 |
|
williamr@2
|
1467 |
|
williamr@2
|
1468 |
|
williamr@2
|
1469 |
class TVolumeInfo
|
williamr@2
|
1470 |
/**
|
williamr@2
|
1471 |
@publishedAll
|
williamr@2
|
1472 |
@released
|
williamr@2
|
1473 |
|
williamr@2
|
1474 |
Contains information about a volume mounted on a drive. Use RFs::Drive() if only
|
williamr@2
|
1475 |
the drive information is required.
|
williamr@2
|
1476 |
|
williamr@2
|
1477 |
If a drive supports removable media it may contain different volumes over time.
|
williamr@2
|
1478 |
|
williamr@2
|
1479 |
Volume information is made up of information concerning the drive on which it is mounted,
|
williamr@2
|
1480 |
which can also be accessed through RFs::Drive(), and the volume information, this is made
|
williamr@2
|
1481 |
up of the size of the volume, the free space, its unique identifying number and a name.
|
williamr@2
|
1482 |
|
williamr@2
|
1483 |
TVolumeInfo is initialised by RFs::Volume().
|
williamr@2
|
1484 |
|
williamr@2
|
1485 |
@see RFs::Volume()
|
williamr@2
|
1486 |
@see RFs::Drive()
|
williamr@2
|
1487 |
*/
|
williamr@2
|
1488 |
{
|
williamr@2
|
1489 |
public:
|
williamr@2
|
1490 |
IMPORT_C TVolumeInfo();
|
williamr@2
|
1491 |
|
williamr@2
|
1492 |
/**
|
williamr@2
|
1493 |
Information about the drive on which the volume is mounted.
|
williamr@2
|
1494 |
|
williamr@2
|
1495 |
@see TDriveInfo
|
williamr@2
|
1496 |
*/
|
williamr@2
|
1497 |
TDriveInfo iDrive;
|
williamr@2
|
1498 |
|
williamr@2
|
1499 |
|
williamr@2
|
1500 |
/**
|
williamr@2
|
1501 |
The volume’s unique identifying number.
|
williamr@2
|
1502 |
*/
|
williamr@2
|
1503 |
TUint iUniqueID;
|
williamr@2
|
1504 |
|
williamr@2
|
1505 |
|
williamr@2
|
1506 |
/**
|
williamr@2
|
1507 |
The maximum size of the volume in bytes. The current amount of memory
|
williamr@2
|
1508 |
in use plus the amount of free memory.
|
williamr@2
|
1509 |
*/
|
williamr@2
|
1510 |
TInt64 iSize;
|
williamr@2
|
1511 |
|
williamr@2
|
1512 |
|
williamr@2
|
1513 |
/**
|
williamr@2
|
1514 |
The amount of free space on the volume in bytes.
|
williamr@2
|
1515 |
*/
|
williamr@2
|
1516 |
TInt64 iFree;
|
williamr@2
|
1517 |
|
williamr@2
|
1518 |
|
williamr@2
|
1519 |
/**
|
williamr@2
|
1520 |
Name of the volume, with a maximum of KMaxFileName characters.
|
williamr@2
|
1521 |
|
williamr@2
|
1522 |
This field is optional.
|
williamr@2
|
1523 |
|
williamr@2
|
1524 |
@see KMaxFileName
|
williamr@2
|
1525 |
*/
|
williamr@2
|
1526 |
TBufC<KMaxFileName> iName;
|
williamr@2
|
1527 |
|
williamr@2
|
1528 |
/**
|
williamr@2
|
1529 |
Flags which define the default file-caching behaviour for this volume
|
williamr@2
|
1530 |
|
williamr@2
|
1531 |
@see TFileCacheFlags
|
williamr@2
|
1532 |
*/
|
williamr@2
|
1533 |
TFileCacheFlags iFileCacheFlags;
|
williamr@2
|
1534 |
|
williamr@2
|
1535 |
/**
|
williamr@2
|
1536 |
@prototype
|
williamr@2
|
1537 |
@internalTechnology
|
williamr@2
|
1538 |
Internal flag, used in the case of non-blocking getting volume information.
|
williamr@2
|
1539 |
@see RFs::Volume(TVolumeInfo& aVol,TInt aDrive, TRequestStatus& aStat)
|
williamr@2
|
1540 |
|
williamr@2
|
1541 |
If this flag is set, it means that the volume information will be obtained
|
williamr@2
|
1542 |
asynchronously. More specific, on return iFree will reflect the _current_ amount of free space on volume at the moment of
|
williamr@2
|
1543 |
RFs::Volume() call, not the exact final value. This is because in this case getting volume information will be asynchronous,
|
williamr@2
|
1544 |
and the client will not be suspended until the mount finish calculating free space. At present appicable to FAT32 file system only.
|
williamr@2
|
1545 |
*/
|
williamr@2
|
1546 |
TUint8 iVolSizeAsync : 1;
|
williamr@2
|
1547 |
|
williamr@2
|
1548 |
private:
|
williamr@2
|
1549 |
/**
|
williamr@2
|
1550 |
Reserved for future expansion
|
williamr@2
|
1551 |
*/
|
williamr@2
|
1552 |
TUint8 i8Reserved1;
|
williamr@2
|
1553 |
TUint16 i16Reserved1;
|
williamr@2
|
1554 |
TUint32 i32Reserved1;
|
williamr@2
|
1555 |
TUint32 i32Reserved2;
|
williamr@2
|
1556 |
};
|
williamr@2
|
1557 |
|
williamr@2
|
1558 |
|
williamr@2
|
1559 |
|
williamr@2
|
1560 |
|
williamr@2
|
1561 |
class TDriveUnit
|
williamr@2
|
1562 |
/**
|
williamr@2
|
1563 |
@publishedAll
|
williamr@2
|
1564 |
@released
|
williamr@2
|
1565 |
|
williamr@2
|
1566 |
Drive numbers and letters.
|
williamr@2
|
1567 |
|
williamr@2
|
1568 |
A drive may be represented by either an integer between zero and twenty five
|
williamr@2
|
1569 |
inclusive, or by a buffer descriptor containing a character between "A" and "Z"
|
williamr@2
|
1570 |
inclusive, followed by a colon.
|
williamr@2
|
1571 |
This class encapsulates both representations.
|
williamr@2
|
1572 |
An instance of this class is constructed specifying either the drive number
|
williamr@2
|
1573 |
or the drive letter and may be converted between the two representations.
|
williamr@2
|
1574 |
*/
|
williamr@2
|
1575 |
{
|
williamr@2
|
1576 |
public:
|
williamr@2
|
1577 |
inline TDriveUnit() {};
|
williamr@2
|
1578 |
IMPORT_C TDriveUnit(TInt aDrive);
|
williamr@2
|
1579 |
IMPORT_C TDriveUnit(const TDesC& aDrive);
|
williamr@2
|
1580 |
IMPORT_C TDriveUnit& operator=(TInt aDrive);
|
williamr@2
|
1581 |
IMPORT_C TDriveUnit& operator=(const TDesC& aDrive);
|
williamr@2
|
1582 |
inline operator TInt() const;
|
williamr@2
|
1583 |
IMPORT_C TDriveName Name() const;
|
williamr@2
|
1584 |
private:
|
williamr@2
|
1585 |
TInt iDrive;
|
williamr@2
|
1586 |
};
|
williamr@2
|
1587 |
|
williamr@2
|
1588 |
|
williamr@2
|
1589 |
|
williamr@2
|
1590 |
|
williamr@2
|
1591 |
class RFs;
|
williamr@2
|
1592 |
//
|
williamr@2
|
1593 |
class TParseBase
|
williamr@2
|
1594 |
/**
|
williamr@2
|
1595 |
@publishedAll
|
williamr@2
|
1596 |
@released
|
williamr@2
|
1597 |
|
williamr@2
|
1598 |
Base class for file name parsing.
|
williamr@2
|
1599 |
|
williamr@2
|
1600 |
You first need to set up the path to be parsed using either a TParse, TParsePtr
|
williamr@2
|
1601 |
or TParsePtrC object.
|
williamr@2
|
1602 |
|
williamr@2
|
1603 |
The interrogation and extraction functions in this class allow you to test
|
williamr@2
|
1604 |
whether a component has been specified in the pathname, and if so,
|
williamr@2
|
1605 |
to extract it. If a component is not present in the pathname,
|
williamr@2
|
1606 |
the extraction function returns an empty string.
|
williamr@2
|
1607 |
|
williamr@2
|
1608 |
This class also allows directories to be added to, and popped from the path.
|
williamr@2
|
1609 |
|
williamr@2
|
1610 |
Notes:
|
williamr@2
|
1611 |
|
williamr@2
|
1612 |
1. the filename modification functions cannot be used by the TParsePtrC class.
|
williamr@2
|
1613 |
|
williamr@2
|
1614 |
2. navigation using .. and . is not supported.
|
williamr@2
|
1615 |
|
williamr@2
|
1616 |
@see TParse
|
williamr@2
|
1617 |
@see TParsePtr
|
williamr@2
|
1618 |
@see TParsePtrC
|
williamr@2
|
1619 |
*/
|
williamr@2
|
1620 |
{
|
williamr@2
|
1621 |
private:
|
williamr@2
|
1622 |
struct SField {TUint8 pos;TUint8 len;TUint8 present;TUint8 filler;};
|
williamr@2
|
1623 |
enum TField {EDrive,EPath,EName,EExt,EMaxFields};
|
williamr@2
|
1624 |
enum TWild {EWildName=0x01,EWildExt=0x02,EWildEither=0x04,EIsRoot=0x08,EWildIsKMatchOne=0x10,EWildIsKMatchAny=0x20};
|
williamr@2
|
1625 |
public:
|
williamr@2
|
1626 |
IMPORT_C TParseBase();
|
williamr@2
|
1627 |
IMPORT_C TInt PopDir();
|
williamr@2
|
1628 |
IMPORT_C TInt AddDir(const TDesC& aName);
|
williamr@2
|
1629 |
IMPORT_C const TDesC& FullName() const;
|
williamr@2
|
1630 |
IMPORT_C TPtrC Drive() const;
|
williamr@2
|
1631 |
IMPORT_C TPtrC Path() const;
|
williamr@2
|
1632 |
IMPORT_C TPtrC DriveAndPath() const;
|
williamr@2
|
1633 |
IMPORT_C TPtrC Name() const;
|
williamr@2
|
1634 |
IMPORT_C TPtrC Ext() const;
|
williamr@2
|
1635 |
IMPORT_C TPtrC NameAndExt() const;
|
williamr@2
|
1636 |
IMPORT_C TBool DrivePresent() const;
|
williamr@2
|
1637 |
IMPORT_C TBool PathPresent() const;
|
williamr@2
|
1638 |
IMPORT_C TBool NamePresent() const;
|
williamr@2
|
1639 |
IMPORT_C TBool ExtPresent() const;
|
williamr@2
|
1640 |
IMPORT_C TBool NameOrExtPresent() const;
|
williamr@2
|
1641 |
IMPORT_C TBool IsRoot() const;
|
williamr@2
|
1642 |
IMPORT_C TBool IsWild() const;
|
williamr@2
|
1643 |
IMPORT_C TBool IsKMatchOne() const;
|
williamr@2
|
1644 |
IMPORT_C TBool IsKMatchAny() const;
|
williamr@2
|
1645 |
IMPORT_C TBool IsNameWild() const;
|
williamr@2
|
1646 |
IMPORT_C TBool IsExtWild() const;
|
williamr@2
|
1647 |
protected:
|
williamr@2
|
1648 |
virtual TDes& NameBuf() = 0; // Reference to derived class descriptor containing the filename.
|
williamr@2
|
1649 |
virtual const TDesC& NameBufC() const = 0; // const reference to derived class descriptor containing the filename.
|
williamr@2
|
1650 |
TInt Set(const TDesC* aName,const TDesC* aRelated,const TDesC* aDefault,TBool allowWild);
|
williamr@2
|
1651 |
private:
|
williamr@2
|
1652 |
TInt ParseDrive(TLex& aName,TBool& aDone);
|
williamr@2
|
1653 |
TInt ParsePath(TLex& aName,TBool& aDone);
|
williamr@2
|
1654 |
TInt ParseName(TLex& aName,TBool& aDone);
|
williamr@2
|
1655 |
TInt ParseExt(TLex& aName,TBool& aDone);
|
williamr@2
|
1656 |
protected:
|
williamr@2
|
1657 |
TInt16 iMod; // Non-zero indicates File name modification functionality is enabled.
|
williamr@2
|
1658 |
private:
|
williamr@2
|
1659 |
TInt16 iWild;
|
williamr@2
|
1660 |
SField iField[EMaxFields];
|
williamr@2
|
1661 |
};
|
williamr@2
|
1662 |
|
williamr@2
|
1663 |
|
williamr@2
|
1664 |
|
williamr@2
|
1665 |
|
williamr@2
|
1666 |
class TParsePtr : public TParseBase
|
williamr@2
|
1667 |
/**
|
williamr@2
|
1668 |
@publishedAll
|
williamr@2
|
1669 |
@released
|
williamr@2
|
1670 |
|
williamr@2
|
1671 |
Parses filenames using less space on the stack than TParse.
|
williamr@2
|
1672 |
|
williamr@2
|
1673 |
Stores a reference to a filename, unlike TParse, which uses
|
williamr@2
|
1674 |
a 512 byte TFileName object as an internal buffer to store
|
williamr@2
|
1675 |
a copy of the filename.
|
williamr@2
|
1676 |
The filename's components (drive, path, etc.) can be retrieved using
|
williamr@2
|
1677 |
the functions provided by the base class, TParseBase.
|
williamr@2
|
1678 |
This class should be used in preference to TParse when minimising stack
|
williamr@2
|
1679 |
usage is a priority.
|
williamr@2
|
1680 |
|
williamr@2
|
1681 |
@see TParse
|
williamr@2
|
1682 |
@see TFileName
|
williamr@2
|
1683 |
*/
|
williamr@2
|
1684 |
{
|
williamr@2
|
1685 |
public:
|
williamr@2
|
1686 |
IMPORT_C TParsePtr(TDes& aName);
|
williamr@2
|
1687 |
protected:
|
williamr@2
|
1688 |
IMPORT_C TDes& NameBuf();
|
williamr@2
|
1689 |
IMPORT_C const TDesC& NameBufC() const;
|
williamr@2
|
1690 |
private:
|
williamr@2
|
1691 |
TPtr iNameBuf;
|
williamr@2
|
1692 |
};
|
williamr@2
|
1693 |
|
williamr@2
|
1694 |
|
williamr@2
|
1695 |
|
williamr@2
|
1696 |
|
williamr@2
|
1697 |
class TParsePtrC : public TParseBase
|
williamr@2
|
1698 |
/**
|
williamr@2
|
1699 |
@publishedAll
|
williamr@2
|
1700 |
@released
|
williamr@2
|
1701 |
|
williamr@2
|
1702 |
Parses, but cannot modify, filenames using less space on the stack than TParse.
|
williamr@2
|
1703 |
|
williamr@2
|
1704 |
Stores a reference to a filename, unlike TParse, which uses
|
williamr@2
|
1705 |
a 512 byte TFileName object as an internal buffer to store
|
williamr@2
|
1706 |
a copy of the filename.
|
williamr@2
|
1707 |
The filename's components (drive, path, etc.) can be retrieved using
|
williamr@2
|
1708 |
the functions provided by the base class, TParseBase.
|
williamr@2
|
1709 |
Note that because the filename cannot be modified through this class,
|
williamr@2
|
1710 |
the base class functions PopDir() and AddDir() cannot be called, because
|
williamr@2
|
1711 |
a panic will be raised.
|
williamr@2
|
1712 |
|
williamr@2
|
1713 |
@see TParse
|
williamr@2
|
1714 |
@see TFileName
|
williamr@2
|
1715 |
*/
|
williamr@2
|
1716 |
{
|
williamr@2
|
1717 |
public:
|
williamr@2
|
1718 |
IMPORT_C TParsePtrC(const TDesC& aName);
|
williamr@2
|
1719 |
protected:
|
williamr@2
|
1720 |
IMPORT_C TDes& NameBuf();
|
williamr@2
|
1721 |
IMPORT_C const TDesC& NameBufC() const;
|
williamr@2
|
1722 |
private:
|
williamr@2
|
1723 |
TPtrC iNameBuf;
|
williamr@2
|
1724 |
};
|
williamr@2
|
1725 |
|
williamr@2
|
1726 |
|
williamr@2
|
1727 |
|
williamr@2
|
1728 |
|
williamr@2
|
1729 |
class TParse : public TParseBase
|
williamr@2
|
1730 |
/**
|
williamr@2
|
1731 |
@publishedAll
|
williamr@2
|
1732 |
@released
|
williamr@2
|
1733 |
|
williamr@2
|
1734 |
Parses filenames.
|
williamr@2
|
1735 |
|
williamr@2
|
1736 |
The class uses the full filename structure supported by Symbian OS.
|
williamr@2
|
1737 |
|
williamr@2
|
1738 |
TParse works by using the Set() function to set up the filename to be parsed.
|
williamr@2
|
1739 |
Then, various getter functions defined in the base class, TParseBase, such as:
|
williamr@2
|
1740 |
FullName(), Drive(), Path(), DriveAndPath(), Name(), Ext() and NameAndExt()
|
williamr@2
|
1741 |
may be used to retrieve path components.
|
williamr@2
|
1742 |
|
williamr@2
|
1743 |
There are a number of restrictions to valid path components, which are
|
williamr@2
|
1744 |
described in guide documentation.
|
williamr@2
|
1745 |
*/
|
williamr@2
|
1746 |
{
|
williamr@2
|
1747 |
public:
|
williamr@2
|
1748 |
IMPORT_C TParse();
|
williamr@2
|
1749 |
IMPORT_C TInt Set(const TDesC& aName,const TDesC* aRelated,const TDesC* aDefault);
|
williamr@2
|
1750 |
IMPORT_C TInt SetNoWild(const TDesC& aName,const TDesC* aRelated,const TDesC* aDefault);
|
williamr@2
|
1751 |
protected:
|
williamr@2
|
1752 |
IMPORT_C TDes& NameBuf();
|
williamr@2
|
1753 |
IMPORT_C const TDesC& NameBufC() const;
|
williamr@2
|
1754 |
private:
|
williamr@2
|
1755 |
TFileName iNameBuf;
|
williamr@2
|
1756 |
};
|
williamr@2
|
1757 |
|
williamr@2
|
1758 |
|
williamr@2
|
1759 |
|
williamr@2
|
1760 |
|
williamr@2
|
1761 |
class CDir : public CBase
|
williamr@2
|
1762 |
/**
|
williamr@2
|
1763 |
@publishedAll
|
williamr@2
|
1764 |
@released
|
williamr@2
|
1765 |
|
williamr@2
|
1766 |
Array of directory entries that has been read into memory from the file system.
|
williamr@2
|
1767 |
|
williamr@2
|
1768 |
It can be read and sorted by user programs, but cannot be created by them.
|
williamr@2
|
1769 |
*/
|
williamr@2
|
1770 |
{
|
williamr@2
|
1771 |
public:
|
williamr@2
|
1772 |
IMPORT_C virtual ~CDir();
|
williamr@2
|
1773 |
IMPORT_C TInt Count() const;
|
williamr@2
|
1774 |
IMPORT_C const TEntry& operator[](TInt anIndex) const;
|
williamr@2
|
1775 |
IMPORT_C TInt Sort(TUint aEntrySortKey);
|
williamr@2
|
1776 |
protected:
|
williamr@2
|
1777 |
IMPORT_C CDir();
|
williamr@2
|
1778 |
IMPORT_C static CDir* NewL();
|
williamr@2
|
1779 |
IMPORT_C void AddL(const TEntry& anEntry);
|
williamr@2
|
1780 |
IMPORT_C void ExtractL(TBool aRemove,CDir*& aDir);
|
williamr@2
|
1781 |
IMPORT_C void Compress();
|
williamr@2
|
1782 |
protected:
|
williamr@2
|
1783 |
CArrayPakFlat<TEntry>* iArray;
|
williamr@2
|
1784 |
friend class RFs;
|
williamr@2
|
1785 |
friend class TOpenFileScan;
|
williamr@2
|
1786 |
};
|
williamr@2
|
1787 |
|
williamr@2
|
1788 |
|
williamr@2
|
1789 |
|
williamr@2
|
1790 |
|
williamr@2
|
1791 |
class RFs : public RSessionBase
|
williamr@2
|
1792 |
/**
|
williamr@2
|
1793 |
@publishedAll
|
williamr@2
|
1794 |
@released
|
williamr@2
|
1795 |
|
williamr@2
|
1796 |
A handle to a file server session.
|
williamr@2
|
1797 |
|
williamr@2
|
1798 |
A program or thread may have arbitrarily many sessions open simultaneously.
|
williamr@2
|
1799 |
|
williamr@2
|
1800 |
Use this class for all file system manipulation, including:
|
williamr@2
|
1801 |
|
williamr@2
|
1802 |
1. adding, removing, moving and renaming files and directories
|
williamr@2
|
1803 |
|
williamr@2
|
1804 |
2. inspecting and changing file attributes and directory entry details.
|
williamr@2
|
1805 |
These include the time and date when the file or directory was last
|
williamr@2
|
1806 |
written to, its size and various attribute flags such as read-only,
|
williamr@2
|
1807 |
hidden, archive or system.
|
williamr@2
|
1808 |
|
williamr@2
|
1809 |
3. finding a file’s real name; if the file system on which it is stored
|
williamr@2
|
1810 |
has to "mangle" the name into a shorter format
|
williamr@2
|
1811 |
|
williamr@2
|
1812 |
4. getting directory listings
|
williamr@2
|
1813 |
|
williamr@2
|
1814 |
5. maintaining a default path; unlike some other systems, there is a single
|
williamr@2
|
1815 |
system default path, rather than one for each drive: the default path
|
williamr@2
|
1816 |
consists of a drive and a path specification.
|
williamr@2
|
1817 |
|
williamr@2
|
1818 |
6. performing context-sensitive parses using TParse objects, and
|
williamr@2
|
1819 |
the session path
|
williamr@2
|
1820 |
|
williamr@2
|
1821 |
7. obtaining information on drives and volumes
|
williamr@2
|
1822 |
|
williamr@2
|
1823 |
8. formatting and labelling volumes
|
williamr@2
|
1824 |
|
williamr@2
|
1825 |
9. obtaining a list of valid drives
|
williamr@2
|
1826 |
|
williamr@2
|
1827 |
10. emulating the DOS subst command, which allows any directory to appear
|
williamr@2
|
1828 |
as if it were a separate drive
|
williamr@2
|
1829 |
|
williamr@2
|
1830 |
11. requesting notification of when significant change occurs.
|
williamr@2
|
1831 |
This can be used for programs which maintain file lists, but must
|
williamr@2
|
1832 |
update those lists when change occurs.
|
williamr@2
|
1833 |
|
williamr@2
|
1834 |
12. finding the version number of the file server
|
williamr@2
|
1835 |
|
williamr@2
|
1836 |
13. resource counting to ensure that all resources are closed when
|
williamr@2
|
1837 |
the session terminates.
|
williamr@2
|
1838 |
|
williamr@2
|
1839 |
This class is not intended for user derivation.
|
williamr@2
|
1840 |
|
williamr@2
|
1841 |
The following restrictions apply when a path is specified:
|
williamr@2
|
1842 |
|
williamr@2
|
1843 |
1. its total length must not exceed 256 characters
|
williamr@2
|
1844 |
|
williamr@2
|
1845 |
2. wildcards cannot be used in the drive or in any directory name,
|
williamr@2
|
1846 |
although they may be allowed in the filename and extension.
|
williamr@2
|
1847 |
|
williamr@2
|
1848 |
3. double backslashes are not allowed in the path.
|
williamr@2
|
1849 |
|
williamr@2
|
1850 |
4. the following characters must not be included anywhere in the path: < > " / |
|
williamr@2
|
1851 |
|
williamr@2
|
1852 |
5. a colon may only be included between the drive and path
|
williamr@2
|
1853 |
|
williamr@2
|
1854 |
6. no directory name or filename plus extension may consist solely
|
williamr@2
|
1855 |
of space characters, or of a single or double dot.
|
williamr@2
|
1856 |
|
williamr@2
|
1857 |
7. spaces between the drive, if specified, and the first directory in
|
williamr@2
|
1858 |
the path are illegal, although there may be spaces between other
|
williamr@2
|
1859 |
path components, for instance between directories.
|
williamr@2
|
1860 |
*/
|
williamr@2
|
1861 |
{
|
williamr@2
|
1862 |
public:
|
williamr@2
|
1863 |
IMPORT_C TInt Connect(TInt aMessageSlots=KFileServerDefaultMessageSlots);
|
williamr@2
|
1864 |
IMPORT_C TVersion Version() const;
|
williamr@2
|
1865 |
IMPORT_C TInt AddFileSystem(const TDesC& aFileName) const;
|
williamr@2
|
1866 |
IMPORT_C TInt MountFileSystem(const TDesC& aFileSystemName,TInt aDrive) const;
|
williamr@2
|
1867 |
IMPORT_C TInt MountFileSystem(const TDesC& aFileSystemName,TInt aDrive, TBool aIsSync) const;
|
williamr@2
|
1868 |
IMPORT_C TInt MountFileSystemAndScan(const TDesC& aFileSystemName,TInt aDrive,TBool& aIsMountSuccess) const;
|
williamr@2
|
1869 |
IMPORT_C TInt MountFileSystem(const TDesC& aFileSystemName,const TDesC& aExtensionName,TInt aDrive);
|
williamr@2
|
1870 |
IMPORT_C TInt MountFileSystem(const TDesC& aFileSystemName,const TDesC& aExtensionName,TInt aDrive, TBool aIsSync);
|
williamr@2
|
1871 |
IMPORT_C TInt MountFileSystemAndScan(const TDesC& aFileSystemName,const TDesC& aExtensionName,TInt aDrive,TBool& aIsMountSuccess) const;
|
williamr@2
|
1872 |
IMPORT_C TInt DismountFileSystem(const TDesC& aFileSystemName,TInt aDrive) const;
|
williamr@2
|
1873 |
IMPORT_C TInt RemoveFileSystem(const TDesC& aFileSystemName) const;
|
williamr@2
|
1874 |
IMPORT_C TInt FileSystemName(TDes& aName,TInt aDrive) const;
|
williamr@2
|
1875 |
IMPORT_C TInt AddExtension(const TDesC& aFileName);
|
williamr@2
|
1876 |
IMPORT_C TInt MountExtension(const TDesC& aExtensionName,TInt aDrive);
|
williamr@2
|
1877 |
IMPORT_C TInt DismountExtension(const TDesC& aExtensionName,TInt aDrive);
|
williamr@2
|
1878 |
IMPORT_C TInt RemoveExtension(const TDesC& aExtensionName);
|
williamr@2
|
1879 |
IMPORT_C TInt ExtensionName(TDes& aExtensionName,TInt aDrive,TInt aPos);
|
williamr@2
|
1880 |
IMPORT_C TInt RemountDrive(TInt aDrive,const TDesC8* aMountInfo=NULL,TUint aFlags=0);
|
williamr@2
|
1881 |
IMPORT_C void NotifyChange(TNotifyType aType,TRequestStatus& aStat);
|
williamr@2
|
1882 |
IMPORT_C void NotifyChange(TNotifyType aType,TRequestStatus& aStat,const TDesC& aPathName);
|
williamr@2
|
1883 |
IMPORT_C void NotifyChangeCancel();
|
williamr@2
|
1884 |
IMPORT_C void NotifyChangeCancel(TRequestStatus& aStat);
|
williamr@2
|
1885 |
IMPORT_C void NotifyDiskSpace(TInt64 aThreshold,TInt aDrive,TRequestStatus& aStat);
|
williamr@2
|
1886 |
IMPORT_C void NotifyDiskSpaceCancel(TRequestStatus& aStat);
|
williamr@2
|
1887 |
IMPORT_C void NotifyDiskSpaceCancel();
|
williamr@2
|
1888 |
IMPORT_C TInt DriveList(TDriveList& aList) const;
|
williamr@2
|
1889 |
IMPORT_C TInt DriveList(TDriveList& aList, TUint aFlags) const;
|
williamr@2
|
1890 |
IMPORT_C TInt Drive(TDriveInfo& anInfo,TInt aDrive=KDefaultDrive) const;
|
williamr@2
|
1891 |
IMPORT_C TInt Volume(TVolumeInfo& aVol,TInt aDrive=KDefaultDrive) const;
|
williamr@2
|
1892 |
IMPORT_C void Volume(TVolumeInfo& aVol,TInt aDrive, TRequestStatus& aStat) const;
|
williamr@2
|
1893 |
IMPORT_C TInt SetVolumeLabel(const TDesC& aName,TInt aDrive=KDefaultDrive);
|
williamr@2
|
1894 |
IMPORT_C TInt Subst(TDes& aPath,TInt aDrive=KDefaultDrive) const;
|
williamr@2
|
1895 |
IMPORT_C TInt SetSubst(const TDesC& aPath,TInt aDrive=KDefaultDrive);
|
williamr@2
|
1896 |
IMPORT_C TInt RealName(const TDesC& aName,TDes& aResult) const;
|
williamr@2
|
1897 |
IMPORT_C TInt GetMediaSerialNumber(TMediaSerialNumber& aSerialNum, TInt aDrive);
|
williamr@2
|
1898 |
IMPORT_C TInt SessionPath(TDes& aPath) const;
|
williamr@2
|
1899 |
IMPORT_C TInt SetSessionPath(const TDesC& aPath);
|
williamr@2
|
1900 |
IMPORT_C TInt Parse(const TDesC& aName,TParse& aParse) const;
|
williamr@2
|
1901 |
IMPORT_C TInt Parse(const TDesC& aName,const TDesC& aRelated,TParse& aParse) const;
|
williamr@2
|
1902 |
IMPORT_C TInt MkDir(const TDesC& aPath);
|
williamr@2
|
1903 |
IMPORT_C TInt MkDirAll(const TDesC& aPath);
|
williamr@2
|
1904 |
IMPORT_C TInt RmDir(const TDesC& aPath);
|
williamr@2
|
1905 |
IMPORT_C TInt GetDir(const TDesC& aName,TUint anEntryAttMask,TUint anEntrySortKey,CDir*& anEntryList) const;
|
williamr@2
|
1906 |
IMPORT_C TInt GetDir(const TDesC& aName,TUint anEntryAttMask,TUint anEntrySortKey,CDir*& anEntryList,CDir*& aDirList) const;
|
williamr@2
|
1907 |
IMPORT_C TInt GetDir(const TDesC& aName,const TUidType& anEntryUid,TUint anEntrySortKey,CDir*& aFileList) const;
|
williamr@2
|
1908 |
IMPORT_C TInt Delete(const TDesC& aName);
|
williamr@2
|
1909 |
IMPORT_C TInt Rename(const TDesC& anOldName,const TDesC& aNewName);
|
williamr@2
|
1910 |
IMPORT_C TInt Replace(const TDesC& anOldName,const TDesC& aNewName);
|
williamr@2
|
1911 |
IMPORT_C TInt Att(const TDesC& aName,TUint& aAttValue) const;
|
williamr@2
|
1912 |
IMPORT_C TInt SetAtt(const TDesC& aName,TUint aSetAttMask,TUint aClearAttMask);
|
williamr@2
|
1913 |
IMPORT_C TInt Modified(const TDesC& aName,TTime& aTime) const;
|
williamr@2
|
1914 |
IMPORT_C TInt SetModified(const TDesC& aName,const TTime& aTime);
|
williamr@2
|
1915 |
IMPORT_C TInt Entry(const TDesC& aName,TEntry& anEntry) const;
|
williamr@2
|
1916 |
IMPORT_C TInt SetEntry(const TDesC& aName,const TTime& aTime,TUint aSetAttMask,TUint aClearAttMask);
|
williamr@2
|
1917 |
IMPORT_C TInt ReadFileSection(const TDesC& aName,TInt aPos,TDes8& aDes,TInt aLength) const;
|
williamr@2
|
1918 |
IMPORT_C static TBool IsValidDrive(TInt aDrive);
|
williamr@2
|
1919 |
IMPORT_C static TInt CharToDrive(TChar aChar,TInt& aDrive);
|
williamr@2
|
1920 |
IMPORT_C static TInt DriveToChar(TInt aDrive,TChar& aChar);
|
williamr@2
|
1921 |
IMPORT_C static TBool IsRomAddress(TAny* aAny);
|
williamr@2
|
1922 |
IMPORT_C static TDriveNumber GetSystemDrive();
|
williamr@2
|
1923 |
IMPORT_C static TChar GetSystemDriveChar();
|
williamr@2
|
1924 |
IMPORT_C TInt SetSystemDrive(TDriveNumber aSystemDrive);
|
williamr@2
|
1925 |
IMPORT_C void ResourceCountMarkStart() const;
|
williamr@2
|
1926 |
IMPORT_C void ResourceCountMarkEnd() const;
|
williamr@2
|
1927 |
IMPORT_C TInt ResourceCount() const;
|
williamr@2
|
1928 |
IMPORT_C TInt IsFileOpen(const TDesC& aFile,TBool& anAnswer) const;
|
williamr@2
|
1929 |
IMPORT_C TInt CheckDisk(const TDesC& aDrive) const;
|
williamr@2
|
1930 |
IMPORT_C TInt ScanDrive(const TDesC& aDrive) const;
|
williamr@2
|
1931 |
IMPORT_C TInt GetShortName(const TDesC& aLongName,TDes& aShortName) const;
|
williamr@2
|
1932 |
IMPORT_C TInt GetLongName(const TDesC& aShortName,TDes& aLongName) const;
|
williamr@2
|
1933 |
IMPORT_C TBool GetNotifyUser();
|
williamr@2
|
1934 |
IMPORT_C void SetNotifyUser(TBool aValue);
|
williamr@2
|
1935 |
IMPORT_C TUint8* IsFileInRom(const TDesC& aFileName) const;
|
williamr@2
|
1936 |
IMPORT_C TBool IsValidName(const TDesC& anEntryName) const;
|
williamr@2
|
1937 |
IMPORT_C TBool IsValidName(const TDesC& aFileName,TText& aBadChar) const;
|
williamr@2
|
1938 |
IMPORT_C TInt GetDriveName(TInt aDrive,TDes& aDriveName) const;
|
williamr@2
|
1939 |
IMPORT_C TInt SetDriveName(TInt aDrive,const TDesC& aDriveName);
|
williamr@2
|
1940 |
IMPORT_C TInt LoaderHeapFunction(TInt aFunction, TAny *aArg1=NULL, TAny *aArg2=NULL);
|
williamr@2
|
1941 |
IMPORT_C TInt SetErrorCondition(TInt anError,TInt aCount=0);
|
williamr@2
|
1942 |
IMPORT_C TInt SetDebugRegister(TInt aVal);
|
williamr@2
|
1943 |
IMPORT_C TInt SetAllocFailure(TInt aAllocNum);
|
williamr@2
|
1944 |
IMPORT_C void DebugNotify(TInt aDrive,TUint aNotifyType,TRequestStatus& aStat);
|
williamr@2
|
1945 |
IMPORT_C TInt ControlIo(TInt aDrive,TInt aCommand);
|
williamr@2
|
1946 |
IMPORT_C TInt ControlIo(TInt aDrive,TInt aCommand,TDes8& aParam1);
|
williamr@2
|
1947 |
IMPORT_C TInt ControlIo(TInt aDrive,TInt aCommand,TDes8& aParam1,TDes8& aParam2);
|
williamr@2
|
1948 |
IMPORT_C TInt ControlIo(TInt aDrive,TInt aCommand,TAny* aParam1,TAny* aParam2);
|
williamr@2
|
1949 |
IMPORT_C TInt LockDrive(TInt aDrv, const TMediaPassword &aOld, const TMediaPassword &aNew, TBool aStr);
|
williamr@2
|
1950 |
IMPORT_C TInt UnlockDrive(TInt aDrv, const TMediaPassword &Pswd, TBool aStr);
|
williamr@2
|
1951 |
IMPORT_C TInt ClearPassword(TInt aDrv, const TMediaPassword &aPswd);
|
williamr@2
|
1952 |
IMPORT_C TInt ErasePassword(TInt aDrv);
|
williamr@2
|
1953 |
IMPORT_C TInt SetSessionToPrivate(TInt aDrive);
|
williamr@2
|
1954 |
IMPORT_C TInt PrivatePath(TDes& aPath);
|
williamr@2
|
1955 |
IMPORT_C TInt CreatePrivatePath(TInt aDrive);
|
williamr@2
|
1956 |
IMPORT_C void StartupInitComplete(TRequestStatus& aStat);
|
williamr@2
|
1957 |
IMPORT_C TInt SetLocalDriveMapping(const TDesC8& aMapping);
|
williamr@2
|
1958 |
|
williamr@2
|
1959 |
IMPORT_C TInt FinaliseDrives();
|
williamr@2
|
1960 |
|
williamr@2
|
1961 |
/** specifies drive finalisation modes */
|
williamr@2
|
1962 |
enum TFinaliseDrvMode
|
williamr@2
|
1963 |
{
|
williamr@2
|
1964 |
EFinal_RW, ///< after successful finalisation the drive remains writable and will become "not finalised" after the first write operation.
|
williamr@2
|
1965 |
EFinal_RO, ///< after successful finalisation the drive becomes read-only
|
williamr@2
|
1966 |
EForceUnfinalise///< @internalComponent mark the drive as "not finalised" can result in KErrAbort if the dive is in inconsistent state.
|
williamr@2
|
1967 |
};
|
williamr@2
|
1968 |
|
williamr@2
|
1969 |
IMPORT_C TInt FinaliseDrive(TInt aDriveNo, TFinaliseDrvMode aMode) const;
|
williamr@2
|
1970 |
|
williamr@2
|
1971 |
IMPORT_C TInt SwapFileSystem(const TDesC& aOldFileSystemName,const TDesC& aNewFileSystemName,TInt aDrive) const;
|
williamr@2
|
1972 |
IMPORT_C TInt ReserveDriveSpace(TInt aDriveNo, TInt aSpace);
|
williamr@2
|
1973 |
IMPORT_C TInt GetReserveAccess(TInt aDriveNo);
|
williamr@2
|
1974 |
IMPORT_C TInt ReleaseReserveAccess(TInt aDriveNo);
|
williamr@2
|
1975 |
|
williamr@2
|
1976 |
IMPORT_C TInt AddPlugin(const TDesC& aFileName) const;
|
williamr@2
|
1977 |
IMPORT_C TInt RemovePlugin(const TDesC& aPluginName) const;
|
williamr@2
|
1978 |
IMPORT_C TInt PluginName(TDes& aPluginName,TInt aDrive,TInt aPos);
|
williamr@2
|
1979 |
|
williamr@2
|
1980 |
IMPORT_C TInt MountPlugin(const TDesC& aPluginName) const;
|
williamr@2
|
1981 |
IMPORT_C TInt MountPlugin(const TDesC& aPluginName,TInt aDrive) const;
|
williamr@2
|
1982 |
IMPORT_C TInt MountPlugin(const TDesC& aPluginName,TInt aDrive, TInt aPos) const;
|
williamr@2
|
1983 |
|
williamr@2
|
1984 |
IMPORT_C TInt DismountPlugin(const TDesC& aPluginName) const;
|
williamr@2
|
1985 |
IMPORT_C TInt DismountPlugin(const TDesC& aPluginName,TInt aDrive) const;
|
williamr@2
|
1986 |
IMPORT_C TInt DismountPlugin(const TDesC& aPluginName,TInt aDrive,TInt aPos) const;
|
williamr@2
|
1987 |
|
williamr@2
|
1988 |
IMPORT_C void NotifyDismount(TInt aDrive, TRequestStatus& aStat, TNotifyDismountMode aMode=EFsDismountRegisterClient) const;
|
williamr@2
|
1989 |
IMPORT_C void NotifyDismountCancel(TRequestStatus& aStat) const;
|
williamr@2
|
1990 |
IMPORT_C void NotifyDismountCancel() const;
|
williamr@2
|
1991 |
IMPORT_C TInt AllowDismount(TInt aDrive) const;
|
williamr@2
|
1992 |
IMPORT_C TInt SetStartupConfiguration(TInt aCommand,TAny* aParam1,TAny* aParam2) const;
|
williamr@2
|
1993 |
IMPORT_C TInt AddCompositeMount(const TDesC& aFileSystemName,TInt aLocalDriveToMount,TInt aCompositeDrive, TBool aSync) const;
|
williamr@2
|
1994 |
IMPORT_C TInt SetNotifyChange(TBool aNotifyChange);
|
williamr@2
|
1995 |
IMPORT_C TInt QueryVolumeInfoExt(TInt aDrive, TQueryVolumeInfoExtCmd aCommand, TDes8& aInfo) const;
|
williamr@2
|
1996 |
IMPORT_C TInt VolumeIOParam(TInt aDriveNo, TVolumeIOParamInfo& aParamInfo) const;
|
williamr@2
|
1997 |
IMPORT_C TInt FileSystemSubType(TInt aDriveNo, TDes& aName) const;
|
williamr@2
|
1998 |
IMPORT_C TInt InitialisePropertiesFile(const TPtrC8& aPtr) const;
|
williamr@2
|
1999 |
|
williamr@2
|
2000 |
TInt Unclamp(const RFileClamp& aHandle);
|
williamr@2
|
2001 |
|
williamr@2
|
2002 |
private:
|
williamr@2
|
2003 |
void GetDirL(const TDesC& aMatchName,TUint anEntryAttMask,TUint anEntrySortKey,CDir*& anEntryList,CDir*& aDirList,RDir& aDir) const;
|
williamr@2
|
2004 |
void GetDirL(const TDesC& aMatchName,TUint anEntryAttMask,TUint anEntrySortKey,CDir*& anEntryList,RDir& aDir) const;
|
williamr@2
|
2005 |
void GetDirL(const TDesC& aMatchName,const TUidType& aUidType,TUint anEntrySortKey,CDir*& anEntryList,RDir& aDir) const;
|
williamr@2
|
2006 |
void DoGetDirL(TUint anEntrySortKey,CDir*& anEntryList,RDir& aDir) const;
|
williamr@2
|
2007 |
TInt GetOpenFileList(TInt& aSessionNum,TInt& aLocalPos,TThreadId& aThreadId,TEntryArray& anArray) const;
|
williamr@2
|
2008 |
friend class TOpenFileScan;
|
williamr@2
|
2009 |
};
|
williamr@2
|
2010 |
|
williamr@2
|
2011 |
|
williamr@2
|
2012 |
|
williamr@2
|
2013 |
|
williamr@2
|
2014 |
|
williamr@2
|
2015 |
|
williamr@2
|
2016 |
|
williamr@2
|
2017 |
/**
|
williamr@2
|
2018 |
@publishedAll
|
williamr@2
|
2019 |
@released
|
williamr@2
|
2020 |
|
williamr@2
|
2021 |
Creates and opens a file, and performs all operations on a single open file.
|
williamr@2
|
2022 |
|
williamr@2
|
2023 |
These include:
|
williamr@2
|
2024 |
|
williamr@2
|
2025 |
- reading from and writing to the file
|
williamr@2
|
2026 |
|
williamr@2
|
2027 |
- seeking to a position within the file
|
williamr@2
|
2028 |
|
williamr@2
|
2029 |
- locking and unlocking within the file
|
williamr@2
|
2030 |
|
williamr@2
|
2031 |
- setting file attributes
|
williamr@2
|
2032 |
|
williamr@2
|
2033 |
Before using any of these services, a connection to a file server session must
|
williamr@2
|
2034 |
have been made, and the file must be open.
|
williamr@2
|
2035 |
|
williamr@2
|
2036 |
Opening Files:
|
williamr@2
|
2037 |
|
williamr@2
|
2038 |
- use Open() to open an existing file for reading or writing; an error is
|
williamr@2
|
2039 |
returned if it does not already exist.
|
williamr@2
|
2040 |
To open an existing file for reading only, use Open() with an access mode of
|
williamr@2
|
2041 |
EFileRead, and a share mode of EFileShareReadersOnly.
|
williamr@2
|
2042 |
|
williamr@2
|
2043 |
- use Create() to create and open a new file for writing; an error is returned
|
williamr@2
|
2044 |
if it already exists.
|
williamr@2
|
2045 |
|
williamr@2
|
2046 |
- use Replace() to open a file for writing, replacing any existing file of
|
williamr@2
|
2047 |
the same name if one exists, or creating a new file if one does not exist.
|
williamr@2
|
2048 |
Note that if a file exists, its length is reset to zero.
|
williamr@2
|
2049 |
|
williamr@2
|
2050 |
- use Temp() to create and open a temporary file with a unique name,
|
williamr@2
|
2051 |
for writing and reading.
|
williamr@2
|
2052 |
|
williamr@2
|
2053 |
When opening a file, you must specify the file server session to use for
|
williamr@2
|
2054 |
operations with that file. If you do not close the file explicitly, it is
|
williamr@2
|
2055 |
closed when the server session associated with it is closed.
|
williamr@2
|
2056 |
|
williamr@2
|
2057 |
Reading and Writing:
|
williamr@2
|
2058 |
|
williamr@2
|
2059 |
There are several variants of both Read() and Write().
|
williamr@2
|
2060 |
The basic Read(TDes8& aDes) and Write(const TDesC8& aDes) are supplemented
|
williamr@2
|
2061 |
by variants allowing the descriptor length to be overridden, or the seek
|
williamr@2
|
2062 |
position of the first byte to be specified, or asynchronous completion,
|
williamr@2
|
2063 |
or any combination.
|
williamr@2
|
2064 |
|
williamr@2
|
2065 |
Reading transfers data from a file to a descriptor, and writing transfers
|
williamr@2
|
2066 |
data from a descriptor to a file. In all cases, the file data is treated
|
williamr@2
|
2067 |
as binary and byte descriptors are used (TDes8, TDesC8).
|
williamr@2
|
2068 |
|
williamr@2
|
2069 |
@see TDes8
|
williamr@2
|
2070 |
@see TDesC8
|
williamr@2
|
2071 |
*/
|
williamr@2
|
2072 |
class RFile : public RSubSessionBase
|
williamr@2
|
2073 |
{
|
williamr@2
|
2074 |
public:
|
williamr@2
|
2075 |
IMPORT_C TInt Open(RFs& aFs,const TDesC& aName,TUint aFileMode);
|
williamr@2
|
2076 |
IMPORT_C void Close();
|
williamr@2
|
2077 |
IMPORT_C TInt Create(RFs& aFs,const TDesC& aName,TUint aFileMode);
|
williamr@2
|
2078 |
IMPORT_C TInt Replace(RFs& aFs,const TDesC& aName,TUint aFileMode);
|
williamr@2
|
2079 |
IMPORT_C TInt Temp(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode);
|
williamr@2
|
2080 |
IMPORT_C TInt Read(TDes8& aDes) const;
|
williamr@2
|
2081 |
IMPORT_C void Read(TDes8& aDes,TRequestStatus& aStatus) const;
|
williamr@2
|
2082 |
IMPORT_C TInt Read(TDes8& aDes,TInt aLength) const;
|
williamr@2
|
2083 |
IMPORT_C void Read(TDes8& aDes,TInt aLength,TRequestStatus& aStatus) const;
|
williamr@2
|
2084 |
IMPORT_C TInt Read(TInt aPos,TDes8& aDes) const;
|
williamr@2
|
2085 |
IMPORT_C void Read(TInt aPos,TDes8& aDes,TRequestStatus& aStatus) const;
|
williamr@2
|
2086 |
IMPORT_C TInt Read(TInt aPos,TDes8& aDes,TInt aLength) const;
|
williamr@2
|
2087 |
IMPORT_C void Read(TInt aPos,TDes8& aDes,TInt aLength,TRequestStatus& aStatus) const;
|
williamr@2
|
2088 |
IMPORT_C void ReadCancel(TRequestStatus& aStatus) const;
|
williamr@2
|
2089 |
IMPORT_C void ReadCancel() const;
|
williamr@2
|
2090 |
IMPORT_C TInt Write(const TDesC8& aDes);
|
williamr@2
|
2091 |
IMPORT_C void Write(const TDesC8& aDes,TRequestStatus& aStatus);
|
williamr@2
|
2092 |
IMPORT_C TInt Write(const TDesC8& aDes,TInt aLength);
|
williamr@2
|
2093 |
IMPORT_C void Write(const TDesC8& aDes,TInt aLength,TRequestStatus& aStatus);
|
williamr@2
|
2094 |
IMPORT_C TInt Write(TInt aPos,const TDesC8& aDes);
|
williamr@2
|
2095 |
IMPORT_C void Write(TInt aPos,const TDesC8& aDes,TRequestStatus& aStatus);
|
williamr@2
|
2096 |
IMPORT_C TInt Write(TInt aPos,const TDesC8& aDes,TInt aLength);
|
williamr@2
|
2097 |
IMPORT_C void Write(TInt aPos,const TDesC8& aDes,TInt aLength,TRequestStatus& aStatus);
|
williamr@2
|
2098 |
IMPORT_C TInt Lock(TInt aPos,TInt aLength) const;
|
williamr@2
|
2099 |
IMPORT_C TInt UnLock(TInt aPos,TInt aLength) const;
|
williamr@2
|
2100 |
IMPORT_C TInt Seek(TSeek aMode,TInt& aPos) const;
|
williamr@2
|
2101 |
IMPORT_C TInt Flush();
|
williamr@2
|
2102 |
IMPORT_C void Flush(TRequestStatus& aStatus);
|
williamr@2
|
2103 |
IMPORT_C TInt Size(TInt& aSize) const;
|
williamr@2
|
2104 |
IMPORT_C TInt SetSize(TInt aSize);
|
williamr@2
|
2105 |
IMPORT_C TInt Att(TUint& aAttValue) const;
|
williamr@2
|
2106 |
IMPORT_C TInt SetAtt(TUint aSetAttMask,TUint aClearAttMask);
|
williamr@2
|
2107 |
IMPORT_C TInt Modified(TTime& aTime) const;
|
williamr@2
|
2108 |
IMPORT_C TInt SetModified(const TTime& aTime);
|
williamr@2
|
2109 |
IMPORT_C TInt Set(const TTime& aTime,TUint aSetAttMask,TUint aClearAttMask);
|
williamr@2
|
2110 |
IMPORT_C TInt ChangeMode(TFileMode aNewMode);
|
williamr@2
|
2111 |
IMPORT_C TInt Rename(const TDesC& aNewName);
|
williamr@2
|
2112 |
IMPORT_C TInt Drive(TInt &aDriveNumber, TDriveInfo &aDriveInfo) const;
|
williamr@2
|
2113 |
IMPORT_C TInt Adopt(RFs& aFs, TInt aHandle);
|
williamr@2
|
2114 |
IMPORT_C TInt AdoptFromClient(const RMessage2& aMsg, TInt aFsHandleIndex, TInt aFileHandleIndex);
|
williamr@2
|
2115 |
IMPORT_C TInt AdoptFromServer(TInt aFsHandle, TInt aFileHandle);
|
williamr@2
|
2116 |
IMPORT_C TInt AdoptFromCreator(TInt aFsIndex, TInt aFileHandleIndex);
|
williamr@2
|
2117 |
IMPORT_C TInt Name(TDes& aName) const;
|
williamr@2
|
2118 |
IMPORT_C TInt TransferToServer(TIpcArgs& aIpcArgs, TInt aFsHandleIndex, TInt aFileHandleIndex) const;
|
williamr@2
|
2119 |
IMPORT_C TInt TransferToClient(const RMessage2& aMsg, TInt aFileHandleIndex) const;
|
williamr@2
|
2120 |
IMPORT_C TInt TransferToProcess(RProcess& aProcess, TInt aFsHandleIndex, TInt aFileHandleIndex) const;
|
williamr@2
|
2121 |
IMPORT_C TInt Duplicate(const RFile& aFile, TOwnerType aType=EOwnerProcess);
|
williamr@2
|
2122 |
IMPORT_C TInt FullName(TDes& aName) const;
|
williamr@2
|
2123 |
IMPORT_C TInt BlockMap(SBlockMapInfo& aInfo, TInt64& aStartPos, TInt64 aEndPos=-1, TInt aBlockMapusage=EBlockMapUsagePaging) const;
|
williamr@2
|
2124 |
// IMPORT_C TInt Clamp(RFileClamp& aHandle);
|
williamr@2
|
2125 |
TInt Clamp(RFileClamp& aHandle);
|
williamr@2
|
2126 |
|
williamr@2
|
2127 |
private:
|
williamr@2
|
2128 |
TInt DuplicateHandle(TInt& aSubSessionHandle) const;
|
williamr@2
|
2129 |
};
|
williamr@2
|
2130 |
|
williamr@2
|
2131 |
|
williamr@2
|
2132 |
|
williamr@2
|
2133 |
class RDir : public RSubSessionBase
|
williamr@2
|
2134 |
/**
|
williamr@2
|
2135 |
@publishedAll
|
williamr@2
|
2136 |
@released
|
williamr@2
|
2137 |
|
williamr@2
|
2138 |
Reads the entries contained in a directory.
|
williamr@2
|
2139 |
|
williamr@2
|
2140 |
You must first open the directory, specifying an attribute mask which is used
|
williamr@2
|
2141 |
by Read() calls to filter the entry types required. Then, use one of
|
williamr@2
|
2142 |
the Read() functions to read the filtered entries. When the operation
|
williamr@2
|
2143 |
is complete, the directory should be closed using Close()
|
williamr@2
|
2144 |
|
williamr@2
|
2145 |
There are two types of Read(): one works with a single entry at a time,
|
williamr@2
|
2146 |
requiring programs to iterate through the entries explicitly.
|
williamr@2
|
2147 |
The other works with an entire TEntryArray, allowing multiple entries to be
|
williamr@2
|
2148 |
read in one call.
|
williamr@2
|
2149 |
As well as making application program logic somewhat simpler, this type
|
williamr@2
|
2150 |
uses fewer calls to the server, and is more efficient.
|
williamr@2
|
2151 |
|
williamr@2
|
2152 |
Each type of Read() can be performed either synchronously or asynchronously.
|
williamr@2
|
2153 |
|
williamr@2
|
2154 |
It may be more convenient to use RFs::GetDir() than the Read() calls supported
|
williamr@2
|
2155 |
by this class.
|
williamr@2
|
2156 |
RFs::GetDir() has the advantage that it allows a directory’s entries to be
|
williamr@2
|
2157 |
sorted in various ways.
|
williamr@2
|
2158 |
However, it does not provide asynchronous as well as synchronous variants
|
williamr@2
|
2159 |
and does not allow entries to be read individually.
|
williamr@2
|
2160 |
|
williamr@2
|
2161 |
@see RFs
|
williamr@2
|
2162 |
*/
|
williamr@2
|
2163 |
{
|
williamr@2
|
2164 |
public:
|
williamr@2
|
2165 |
IMPORT_C TInt Open(RFs& aFs,const TDesC& aMatchName,const TUidType& aUidType);
|
williamr@2
|
2166 |
IMPORT_C TInt Open(RFs& aFs,const TDesC& aMatchName,TUint anAttMask);
|
williamr@2
|
2167 |
IMPORT_C void Close();
|
williamr@2
|
2168 |
IMPORT_C TInt Read(TEntryArray& anArray) const;
|
williamr@2
|
2169 |
IMPORT_C void Read(TEntryArray& anArray,TRequestStatus& aStatus) const;
|
williamr@2
|
2170 |
IMPORT_C TInt Read(TEntry& anEntry) const;
|
williamr@2
|
2171 |
IMPORT_C void Read(TPckg<TEntry>& anEntry,TRequestStatus& aStatus) const;
|
williamr@2
|
2172 |
};
|
williamr@2
|
2173 |
|
williamr@2
|
2174 |
|
williamr@2
|
2175 |
class RFormat : public RSubSessionBase
|
williamr@2
|
2176 |
/**
|
williamr@2
|
2177 |
@publishedAll
|
williamr@2
|
2178 |
@released
|
williamr@2
|
2179 |
|
williamr@2
|
2180 |
Formats a device, one step at a time.
|
williamr@2
|
2181 |
|
williamr@2
|
2182 |
RFormat must first be opened on a device before formatting each
|
williamr@2
|
2183 |
track using Next().
|
williamr@2
|
2184 |
|
williamr@2
|
2185 |
There is also an asynchronous version of Next() which, if encapsulated into
|
williamr@2
|
2186 |
a suitable active object, can be used to implement a
|
williamr@2
|
2187 |
user-interruptible formatting process.
|
williamr@2
|
2188 |
*/
|
williamr@2
|
2189 |
{
|
williamr@2
|
2190 |
public:
|
williamr@2
|
2191 |
IMPORT_C TInt Open(RFs& aFs,const TDesC& aName,TUint aFormatMode,TInt& aCount);
|
williamr@2
|
2192 |
IMPORT_C TInt Open(RFs& aFs,const TDesC& aName,TUint aFormatMode,TInt& aCount,const TDesC8& anInfo);
|
williamr@2
|
2193 |
IMPORT_C void Close();
|
williamr@2
|
2194 |
IMPORT_C TInt Next(TInt& aStep);
|
williamr@2
|
2195 |
IMPORT_C void Next(TPckgBuf<TInt>& aStep,TRequestStatus& aStatus);
|
williamr@2
|
2196 |
};
|
williamr@2
|
2197 |
|
williamr@2
|
2198 |
|
williamr@2
|
2199 |
|
williamr@2
|
2200 |
|
williamr@2
|
2201 |
class RRawDisk : public RSubSessionBase
|
williamr@2
|
2202 |
/**
|
williamr@2
|
2203 |
@publishedAll
|
williamr@2
|
2204 |
@released
|
williamr@2
|
2205 |
|
williamr@2
|
2206 |
Enables direct disk access.
|
williamr@2
|
2207 |
|
williamr@2
|
2208 |
No other resources can access the disk while direct access to it is in effect.
|
williamr@2
|
2209 |
|
williamr@2
|
2210 |
This class is not intended for user derivation.
|
williamr@2
|
2211 |
*/
|
williamr@2
|
2212 |
{
|
williamr@2
|
2213 |
public:
|
williamr@2
|
2214 |
IMPORT_C TInt Open(RFs& aFs,TInt aDrive);
|
williamr@2
|
2215 |
IMPORT_C void Close();
|
williamr@2
|
2216 |
IMPORT_C TInt Read(TInt64 aPos,TDes8& aDes);
|
williamr@2
|
2217 |
IMPORT_C TInt Write(TInt64 aPos,TDesC8& aDes);
|
williamr@2
|
2218 |
private:
|
williamr@2
|
2219 |
TInt iDrive;
|
williamr@2
|
2220 |
};
|
williamr@2
|
2221 |
|
williamr@2
|
2222 |
|
williamr@2
|
2223 |
|
williamr@2
|
2224 |
|
williamr@2
|
2225 |
class CDirStack;
|
williamr@2
|
2226 |
NONSHARABLE_CLASS(CDirScan) : public CBase
|
williamr@2
|
2227 |
/**
|
williamr@2
|
2228 |
@publishedAll
|
williamr@2
|
2229 |
@released
|
williamr@2
|
2230 |
|
williamr@2
|
2231 |
Scans a directory structure.
|
williamr@2
|
2232 |
|
williamr@2
|
2233 |
The scan moves from directory to directory through the hierarchy, returning
|
williamr@2
|
2234 |
a list of the entries contained in each. The order in which the directories
|
williamr@2
|
2235 |
are scanned is determined by a sort key which is specified when setting up
|
williamr@2
|
2236 |
the scan. The base directory to be scanned and the entry types of interest
|
williamr@2
|
2237 |
must also be specified before performing the scan.
|
williamr@2
|
2238 |
|
williamr@2
|
2239 |
This class is not intended for user derivation
|
williamr@2
|
2240 |
*/
|
williamr@2
|
2241 |
{
|
williamr@2
|
2242 |
public:
|
williamr@2
|
2243 |
/**
|
williamr@2
|
2244 |
Defines the scan direction.
|
williamr@2
|
2245 |
*/
|
williamr@2
|
2246 |
enum TScanDirection
|
williamr@2
|
2247 |
{
|
williamr@2
|
2248 |
/**
|
williamr@2
|
2249 |
Scan upwards from the lowest level directory in the hierarchy to
|
williamr@2
|
2250 |
the top level directory.
|
williamr@2
|
2251 |
*/
|
williamr@2
|
2252 |
EScanUpTree,
|
williamr@2
|
2253 |
|
williamr@2
|
2254 |
/**
|
williamr@2
|
2255 |
Scan downwards from the top level directory in the hierarchy to
|
williamr@2
|
2256 |
the bottom level directory.
|
williamr@2
|
2257 |
*/
|
williamr@2
|
2258 |
EScanDownTree
|
williamr@2
|
2259 |
};
|
williamr@2
|
2260 |
public:
|
williamr@2
|
2261 |
IMPORT_C static CDirScan* NewL(RFs& aFs);
|
williamr@2
|
2262 |
IMPORT_C static CDirScan* NewLC(RFs& aFs);
|
williamr@2
|
2263 |
IMPORT_C ~CDirScan();
|
williamr@2
|
2264 |
IMPORT_C void SetScanDataL(const TDesC& aMatchName,TUint anEntryAttMask,TUint anEntrySortMask,TScanDirection aScanDir=EScanDownTree);
|
williamr@2
|
2265 |
IMPORT_C void NextL(CDir*& aDirEntries);
|
williamr@2
|
2266 |
IMPORT_C TPtrC AbbreviatedPath();
|
williamr@2
|
2267 |
IMPORT_C TPtrC FullPath();
|
williamr@2
|
2268 |
protected:
|
williamr@2
|
2269 |
CDirScan(RFs& aFs);
|
williamr@2
|
2270 |
private:
|
williamr@2
|
2271 |
inline RFs& Fs();
|
williamr@2
|
2272 |
void UpdateAbbreviatedPath();
|
williamr@2
|
2273 |
void ScanUpTreeL(CDir*& aDirEntries);
|
williamr@2
|
2274 |
void ScanDownTreeL(CDir*& aDirEntries);
|
williamr@2
|
2275 |
void GetDirEntriesL(CDir*& aDirEntries);
|
williamr@2
|
2276 |
private:
|
williamr@2
|
2277 |
RFs* const iFs;
|
williamr@2
|
2278 |
TParse iFullPath;
|
williamr@2
|
2279 |
TPtrC iAbbreviatedPath;
|
williamr@2
|
2280 |
TInt iAbbreviatedPathPos;
|
williamr@2
|
2281 |
TUint iEntryAttMask;
|
williamr@2
|
2282 |
TUint iEntrySortMask;
|
williamr@2
|
2283 |
TBool iScanning;
|
williamr@2
|
2284 |
TScanDirection iScanDir;
|
williamr@2
|
2285 |
CDirStack* iStack;
|
williamr@2
|
2286 |
};
|
williamr@2
|
2287 |
|
williamr@2
|
2288 |
|
williamr@2
|
2289 |
|
williamr@2
|
2290 |
|
williamr@2
|
2291 |
enum TFileManError
|
williamr@2
|
2292 |
/**
|
williamr@2
|
2293 |
@publishedAll
|
williamr@2
|
2294 |
@released
|
williamr@2
|
2295 |
|
williamr@2
|
2296 |
A list of CFileMan error codes.
|
williamr@2
|
2297 |
|
williamr@2
|
2298 |
@see CFileMan
|
williamr@2
|
2299 |
*/
|
williamr@2
|
2300 |
{
|
williamr@2
|
2301 |
/**
|
williamr@2
|
2302 |
No additional error information is available, either because
|
williamr@2
|
2303 |
the latest CFileMan operation did not return an error, or if it did,
|
williamr@2
|
2304 |
the error was not one for which additional information is available.
|
williamr@2
|
2305 |
*/
|
williamr@2
|
2306 |
ENoExtraInformation,
|
williamr@2
|
2307 |
|
williamr@2
|
2308 |
|
williamr@2
|
2309 |
/**
|
williamr@2
|
2310 |
A leave occurred while setting up the initial scan.
|
williamr@2
|
2311 |
|
williamr@2
|
2312 |
This indicates that the operation did not begin.
|
williamr@2
|
2313 |
|
williamr@2
|
2314 |
@see CDirScan.
|
williamr@2
|
2315 |
*/
|
williamr@2
|
2316 |
EInitializationFailed,
|
williamr@2
|
2317 |
|
williamr@2
|
2318 |
|
williamr@2
|
2319 |
/**
|
williamr@2
|
2320 |
A leave occurred while scanning the next directory in the course of a file
|
williamr@2
|
2321 |
management function.
|
williamr@2
|
2322 |
|
williamr@2
|
2323 |
This indicates that the operation did begin.
|
williamr@2
|
2324 |
|
williamr@2
|
2325 |
@see CDirScan.
|
williamr@2
|
2326 |
*/
|
williamr@2
|
2327 |
EScanNextDirectoryFailed,
|
williamr@2
|
2328 |
|
williamr@2
|
2329 |
|
williamr@2
|
2330 |
/**
|
williamr@2
|
2331 |
Error occurred when attempting to open the source file for a file copy
|
williamr@2
|
2332 |
or move.
|
williamr@2
|
2333 |
*/
|
williamr@2
|
2334 |
ESrcOpenFailed,
|
williamr@2
|
2335 |
|
williamr@2
|
2336 |
|
williamr@2
|
2337 |
/**
|
williamr@2
|
2338 |
Error occurred while attempting to create, or, if overwriting is in effect,
|
williamr@2
|
2339 |
replace the target file for a file copy or move.
|
williamr@2
|
2340 |
*/
|
williamr@2
|
2341 |
ETrgOpenFailed,
|
williamr@2
|
2342 |
|
williamr@2
|
2343 |
|
williamr@2
|
2344 |
/**
|
williamr@2
|
2345 |
The operation completed without processing any files because no matching
|
williamr@2
|
2346 |
files were found.
|
williamr@2
|
2347 |
*/
|
williamr@2
|
2348 |
ENoFilesProcessed
|
williamr@2
|
2349 |
};
|
williamr@2
|
2350 |
|
williamr@2
|
2351 |
|
williamr@2
|
2352 |
|
williamr@2
|
2353 |
|
williamr@2
|
2354 |
class MFileManObserver
|
williamr@2
|
2355 |
/**
|
williamr@2
|
2356 |
@publishedAll
|
williamr@2
|
2357 |
@released
|
williamr@2
|
2358 |
|
williamr@2
|
2359 |
Provides notification of the progress of synchronous or asynchronous
|
williamr@2
|
2360 |
file management operations.
|
williamr@2
|
2361 |
|
williamr@2
|
2362 |
It should be inherited by classes which implement this protocol.
|
williamr@2
|
2363 |
|
williamr@2
|
2364 |
The enquiry functions provided by CFileBase and CFileMan may be used by
|
williamr@2
|
2365 |
the observer to display information about the progress of the operation
|
williamr@2
|
2366 |
such as error messages, the names of the target and destination files,
|
williamr@2
|
2367 |
and the number of bytes transferred during a copy operation.
|
williamr@2
|
2368 |
Notification may take place before or after an entry has been processed,
|
williamr@2
|
2369 |
or during a file copy or move.
|
williamr@2
|
2370 |
Each notification function returns a value which can be used to enable
|
williamr@2
|
2371 |
the user to control the progress of the operation, for example to cancel
|
williamr@2
|
2372 |
a long-running multiple file copy.
|
williamr@2
|
2373 |
To use this class, pass a pointer to an instance of the class to
|
williamr@2
|
2374 |
the CFileMan constructor, or use SetObserver(), defined in CFileBase.
|
williamr@2
|
2375 |
*/
|
williamr@2
|
2376 |
{
|
williamr@2
|
2377 |
public:
|
williamr@2
|
2378 |
/**
|
williamr@2
|
2379 |
Control for the current CFileMan operation.
|
williamr@2
|
2380 |
*/
|
williamr@2
|
2381 |
enum TControl
|
williamr@2
|
2382 |
{
|
williamr@2
|
2383 |
/**
|
williamr@2
|
2384 |
Proceed with the current or the next entry.
|
williamr@2
|
2385 |
*/
|
williamr@2
|
2386 |
EContinue,
|
williamr@2
|
2387 |
|
williamr@2
|
2388 |
|
williamr@2
|
2389 |
/**
|
williamr@2
|
2390 |
Retry processing the previous entry.
|
williamr@2
|
2391 |
*/
|
williamr@2
|
2392 |
ERetry,
|
williamr@2
|
2393 |
|
williamr@2
|
2394 |
|
williamr@2
|
2395 |
/**
|
williamr@2
|
2396 |
Abort operation, causes function to return KErrCancel.
|
williamr@2
|
2397 |
*/
|
williamr@2
|
2398 |
EAbort,
|
williamr@2
|
2399 |
|
williamr@2
|
2400 |
|
williamr@2
|
2401 |
/**
|
williamr@2
|
2402 |
Cancel processing the current entry.
|
williamr@2
|
2403 |
*/
|
williamr@2
|
2404 |
ECancel
|
williamr@2
|
2405 |
};
|
williamr@2
|
2406 |
public:
|
williamr@2
|
2407 |
IMPORT_C virtual TControl NotifyFileManStarted();
|
williamr@2
|
2408 |
IMPORT_C virtual TControl NotifyFileManOperation();
|
williamr@2
|
2409 |
IMPORT_C virtual TControl NotifyFileManEnded();
|
williamr@2
|
2410 |
};
|
williamr@2
|
2411 |
|
williamr@2
|
2412 |
|
williamr@2
|
2413 |
|
williamr@2
|
2414 |
|
williamr@2
|
2415 |
class CFileBase : public CBase
|
williamr@2
|
2416 |
/**
|
williamr@2
|
2417 |
@publishedAll
|
williamr@2
|
2418 |
@released
|
williamr@2
|
2419 |
|
williamr@2
|
2420 |
Abstract base class for file management.
|
williamr@2
|
2421 |
|
williamr@2
|
2422 |
It provides functions to set an observer for the derived class
|
williamr@2
|
2423 |
CFileMan, and to get information about the entry being processed.
|
williamr@2
|
2424 |
|
williamr@2
|
2425 |
@see CFileMan
|
williamr@2
|
2426 |
*/
|
williamr@2
|
2427 |
{
|
williamr@2
|
2428 |
public:
|
williamr@2
|
2429 |
IMPORT_C void SetObserver(MFileManObserver* anObserver);
|
williamr@2
|
2430 |
public:
|
williamr@2
|
2431 |
IMPORT_C const TEntry& CurrentEntry();
|
williamr@2
|
2432 |
IMPORT_C TPtrC AbbreviatedPath();
|
williamr@2
|
2433 |
IMPORT_C TPtrC FullPath();
|
williamr@2
|
2434 |
IMPORT_C TInt GetLastError();
|
williamr@2
|
2435 |
IMPORT_C TFileManError GetMoreInfoAboutError();
|
williamr@2
|
2436 |
protected:
|
williamr@2
|
2437 |
IMPORT_C CFileBase(RFs& anFs);
|
williamr@2
|
2438 |
IMPORT_C void ConstructL();
|
williamr@2
|
2439 |
IMPORT_C ~CFileBase();
|
williamr@2
|
2440 |
IMPORT_C void RunL();
|
williamr@2
|
2441 |
IMPORT_C void RunInSeparateThreadL(TThreadFunction aThreadFunction);
|
williamr@2
|
2442 |
// virtual
|
williamr@2
|
2443 |
/**
|
williamr@2
|
2444 |
Called from RunL to perform tidy up after an operation.
|
williamr@2
|
2445 |
|
williamr@2
|
2446 |
@see CFileMan
|
williamr@2
|
2447 |
@see CFileBase::RunL
|
williamr@2
|
2448 |
*/
|
williamr@2
|
2449 |
virtual void CompleteOperationL() {};
|
williamr@2
|
2450 |
|
williamr@2
|
2451 |
//pure virtual
|
williamr@2
|
2452 |
/**
|
williamr@2
|
2453 |
Called from RunL to perform the requested operation.
|
williamr@2
|
2454 |
|
williamr@2
|
2455 |
@see CFileMan
|
williamr@2
|
2456 |
@see CFileBase::RunL
|
williamr@2
|
2457 |
*/
|
williamr@2
|
2458 |
virtual void DoOperationL() = 0;
|
williamr@2
|
2459 |
protected:
|
williamr@2
|
2460 |
RFs iFs;
|
williamr@2
|
2461 |
RFs iFsOld;
|
williamr@2
|
2462 |
RThread iFManThread;
|
williamr@2
|
2463 |
RSemaphore iSynchronizer;
|
williamr@2
|
2464 |
CDirScan* iScanner;
|
williamr@2
|
2465 |
CDir* iDirList;
|
williamr@2
|
2466 |
TInt iCurrentEntry;
|
williamr@2
|
2467 |
TUint iMatchEntry;
|
williamr@2
|
2468 |
TUint iSwitches;
|
williamr@2
|
2469 |
TParse iSrcFile;
|
williamr@2
|
2470 |
MFileManObserver* iObserver;
|
williamr@2
|
2471 |
TInt iLastError;
|
williamr@2
|
2472 |
TFileManError iErrorInfo;
|
williamr@2
|
2473 |
TRequestStatus* iStatus;
|
williamr@2
|
2474 |
HBufC* iSessionPath;
|
williamr@2
|
2475 |
TInt iNumberOfFilesProcessed;
|
williamr@2
|
2476 |
|
williamr@2
|
2477 |
|
williamr@2
|
2478 |
|
williamr@2
|
2479 |
|
williamr@2
|
2480 |
friend void DoFManBaseOperationL(TAny* aPtr);
|
williamr@2
|
2481 |
friend TInt FManBaseThreadFunction(TAny* aPtr);
|
williamr@2
|
2482 |
};
|
williamr@2
|
2483 |
|
williamr@2
|
2484 |
|
williamr@2
|
2485 |
|
williamr@2
|
2486 |
|
williamr@2
|
2487 |
NONSHARABLE_CLASS(CFileMan) : public CFileBase
|
williamr@2
|
2488 |
/**
|
williamr@2
|
2489 |
@publishedAll
|
williamr@2
|
2490 |
@released
|
williamr@2
|
2491 |
|
williamr@2
|
2492 |
Offers file management services which accept the use of wildcards;
|
williamr@2
|
2493 |
synchronous and asynchronous.
|
williamr@2
|
2494 |
|
williamr@2
|
2495 |
It also provides enquiry functions, which, like those provided by
|
williamr@2
|
2496 |
the base class CFileBase, may be used by an observer class object
|
williamr@2
|
2497 |
to provide the user with information about the progress of the operation.
|
williamr@2
|
2498 |
|
williamr@2
|
2499 |
All of the file management functions provided by this class accept the use of
|
williamr@2
|
2500 |
wildcards, and may operate either synchronously or asynchronously.
|
williamr@2
|
2501 |
When CFileMan is operating asynchronously, the operation takes place in
|
williamr@2
|
2502 |
a separate thread from the calling code.
|
williamr@2
|
2503 |
|
williamr@2
|
2504 |
A file notification observer (an instance of a class deriving
|
williamr@2
|
2505 |
from MFileManObserver) may optionally be used by CFileMan when operating
|
williamr@2
|
2506 |
synchronously or asynchronously. If provided, the appropriate notification
|
williamr@2
|
2507 |
function is called before or after each entry has been processed,
|
williamr@2
|
2508 |
or during a file copy or move.
|
williamr@2
|
2509 |
This notification can be used to provide information about the state of
|
williamr@2
|
2510 |
the operation, such as the number of bytes transferred during a
|
williamr@2
|
2511 |
large-scale file copy. It can also be used to allow the user to cancel,
|
williamr@2
|
2512 |
retry or continue processing an entry, or to abort the whole operation.
|
williamr@2
|
2513 |
If such notification is required, specify an object deriving from
|
williamr@2
|
2514 |
MFileManObserver class in the constructor, or call SetObserver(),
|
williamr@2
|
2515 |
defined in the base class, CFileBase.
|
williamr@2
|
2516 |
|
williamr@2
|
2517 |
All of the file manipulation functions except Rename() may operate recursively,
|
williamr@2
|
2518 |
and all can operate non-recursively. When operating recursively,
|
williamr@2
|
2519 |
these functions will act on all matching files located throughout
|
williamr@2
|
2520 |
the source directory’s hierarchy. When operating non-recursively,
|
williamr@2
|
2521 |
these functions act upon files contained in the single top level source
|
williamr@2
|
2522 |
directory only. Recursion is set or unset using the switch parameter to
|
williamr@2
|
2523 |
these functions.
|
williamr@2
|
2524 |
|
williamr@2
|
2525 |
This class is not intended for user derivation.
|
williamr@2
|
2526 |
|
williamr@2
|
2527 |
@see MFileManObserver
|
williamr@2
|
2528 |
*/
|
williamr@2
|
2529 |
{
|
williamr@2
|
2530 |
public:
|
williamr@2
|
2531 |
/**
|
williamr@2
|
2532 |
An enumeration that identifies CFileMan tasks. This enumeration is used
|
williamr@2
|
2533 |
by CurrentAction() to identify which task currently being carried out.
|
williamr@2
|
2534 |
|
williamr@2
|
2535 |
@see CFileMan::CurrentAction
|
williamr@2
|
2536 |
*/
|
williamr@2
|
2537 |
enum TAction
|
williamr@2
|
2538 |
{
|
williamr@2
|
2539 |
/**
|
williamr@2
|
2540 |
Inactive
|
williamr@2
|
2541 |
*/
|
williamr@2
|
2542 |
ENone,
|
williamr@2
|
2543 |
|
williamr@2
|
2544 |
|
williamr@2
|
2545 |
/**
|
williamr@2
|
2546 |
Setting attributes
|
williamr@2
|
2547 |
*/
|
williamr@2
|
2548 |
EAttribs,
|
williamr@2
|
2549 |
|
williamr@2
|
2550 |
|
williamr@2
|
2551 |
/**
|
williamr@2
|
2552 |
Copying files
|
williamr@2
|
2553 |
*/
|
williamr@2
|
2554 |
ECopy,
|
williamr@2
|
2555 |
|
williamr@2
|
2556 |
|
williamr@2
|
2557 |
/**
|
williamr@2
|
2558 |
Deleting files
|
williamr@2
|
2559 |
*/
|
williamr@2
|
2560 |
EDelete,
|
williamr@2
|
2561 |
|
williamr@2
|
2562 |
|
williamr@2
|
2563 |
/**
|
williamr@2
|
2564 |
Moving files
|
williamr@2
|
2565 |
*/
|
williamr@2
|
2566 |
EMove,
|
williamr@2
|
2567 |
|
williamr@2
|
2568 |
|
williamr@2
|
2569 |
/**
|
williamr@2
|
2570 |
Renaming files
|
williamr@2
|
2571 |
*/
|
williamr@2
|
2572 |
ERename,
|
williamr@2
|
2573 |
|
williamr@2
|
2574 |
|
williamr@2
|
2575 |
/**
|
williamr@2
|
2576 |
Deleting a directory and all contents
|
williamr@2
|
2577 |
*/
|
williamr@2
|
2578 |
ERmDir,
|
williamr@2
|
2579 |
|
williamr@2
|
2580 |
|
williamr@2
|
2581 |
/**
|
williamr@2
|
2582 |
Renaming component to VFAT short name (guaranteed to be unique)
|
williamr@2
|
2583 |
*/
|
williamr@2
|
2584 |
ERenameInvalidEntry,
|
williamr@2
|
2585 |
|
williamr@2
|
2586 |
/**
|
williamr@2
|
2587 |
Copying file from open file handle
|
williamr@2
|
2588 |
*/
|
williamr@2
|
2589 |
ECopyFromHandle,
|
williamr@2
|
2590 |
};
|
williamr@2
|
2591 |
|
williamr@2
|
2592 |
|
williamr@2
|
2593 |
/**
|
williamr@2
|
2594 |
Overwriting and recursion switch.
|
williamr@2
|
2595 |
|
williamr@2
|
2596 |
Used in CFileMan functions to set whether operations are applied to
|
williamr@2
|
2597 |
the specified directory and all directories below it, or
|
williamr@2
|
2598 |
the specified directory only.
|
williamr@2
|
2599 |
*/
|
williamr@2
|
2600 |
enum TSwitch
|
williamr@2
|
2601 |
{
|
williamr@2
|
2602 |
/**
|
williamr@2
|
2603 |
Any files in the destination directory that have the same name as
|
williamr@2
|
2604 |
the source files in a rename, move or copy operation, will
|
williamr@2
|
2605 |
be overwritten.
|
williamr@2
|
2606 |
*/
|
williamr@2
|
2607 |
EOverWrite=1,
|
williamr@2
|
2608 |
|
williamr@2
|
2609 |
|
williamr@2
|
2610 |
/**
|
williamr@2
|
2611 |
Recursive operation.
|
williamr@2
|
2612 |
*/
|
williamr@2
|
2613 |
ERecurse=2
|
williamr@2
|
2614 |
};
|
williamr@2
|
2615 |
public:
|
williamr@2
|
2616 |
IMPORT_C static CFileMan* NewL(RFs& aFs);
|
williamr@2
|
2617 |
IMPORT_C static CFileMan* NewL(RFs& aFs,MFileManObserver* anObserver);
|
williamr@2
|
2618 |
~CFileMan();
|
williamr@2
|
2619 |
IMPORT_C TAction CurrentAction();
|
williamr@2
|
2620 |
IMPORT_C void GetCurrentTarget(TFileName& aFile);
|
williamr@2
|
2621 |
IMPORT_C void GetCurrentSource(TFileName& aFile);
|
williamr@2
|
2622 |
IMPORT_C TInt BytesTransferredByCopyStep();
|
williamr@2
|
2623 |
public:
|
williamr@2
|
2624 |
IMPORT_C TInt Attribs(const TDesC& aName,TUint aSetMask,TUint aClearMask,const TTime& aTime,TUint aSwitch=0);
|
williamr@2
|
2625 |
IMPORT_C TInt Attribs(const TDesC& aName,TUint aSetMask,TUint aClearMask,const TTime& aTime,TUint aSwitch,TRequestStatus& aStatus);
|
williamr@2
|
2626 |
IMPORT_C TInt Copy(const TDesC& anOld,const TDesC& aNew,TUint aSwitch=EOverWrite);
|
williamr@2
|
2627 |
IMPORT_C TInt Copy(const TDesC& anOld,const TDesC& aNew,TUint aSwitch,TRequestStatus& aStatus);
|
williamr@2
|
2628 |
IMPORT_C TInt Delete(const TDesC& aName,TUint aSwitch=0);
|
williamr@2
|
2629 |
IMPORT_C TInt Delete(const TDesC& aName,TUint aSwitch,TRequestStatus& aStatus);
|
williamr@2
|
2630 |
IMPORT_C TInt Move(const TDesC& anOld,const TDesC& aNew,TUint aSwitch=EOverWrite);
|
williamr@2
|
2631 |
IMPORT_C TInt Move(const TDesC& anOld,const TDesC& aNew,TUint aSwitch,TRequestStatus& aStatus);
|
williamr@2
|
2632 |
IMPORT_C TInt Rename(const TDesC& anOld,const TDesC& aNew,TUint aSwitch=EOverWrite);
|
williamr@2
|
2633 |
IMPORT_C TInt Rename(const TDesC& anOld,const TDesC& aNew,TUint aSwitch,TRequestStatus& aStatus);
|
williamr@2
|
2634 |
IMPORT_C TInt RmDir(const TDesC& aDirName);
|
williamr@2
|
2635 |
IMPORT_C TInt RmDir(const TDesC& aDirName,TRequestStatus& aStatus);
|
williamr@2
|
2636 |
IMPORT_C TInt Copy(const RFile& anOld,const TDesC& aNew,TUint aSwitches=EOverWrite);
|
williamr@2
|
2637 |
IMPORT_C TInt Copy(const RFile& anOld,const TDesC& aNew,TUint aSwitches,TRequestStatus& aStatus);
|
williamr@2
|
2638 |
protected:
|
williamr@2
|
2639 |
CFileMan(RFs& aFs);
|
williamr@2
|
2640 |
TInt RenameInvalidEntry(const TDesC& anOld,const TDesC& aNew,TUint aSwitch=EOverWrite);
|
williamr@2
|
2641 |
private:
|
williamr@2
|
2642 |
/**
|
williamr@2
|
2643 |
This is an internal enumeration for CFileMan implementation.
|
williamr@2
|
2644 |
THis enumeration is mapped into TAction when user wants to identify the current
|
williamr@2
|
2645 |
task of CFileMan by CurrentAction().
|
williamr@2
|
2646 |
|
williamr@2
|
2647 |
@see CFileMan::TAction
|
williamr@2
|
2648 |
@see CFileMan::CurrentAction
|
williamr@2
|
2649 |
*/
|
williamr@2
|
2650 |
enum TInternalAction
|
williamr@2
|
2651 |
{
|
williamr@2
|
2652 |
/**
|
williamr@2
|
2653 |
Internal indicator for None operation.
|
williamr@2
|
2654 |
This is mapped to CFileMan::ENone.
|
williamr@2
|
2655 |
*/
|
williamr@2
|
2656 |
EInternalNone,
|
williamr@2
|
2657 |
|
williamr@2
|
2658 |
/**
|
williamr@2
|
2659 |
Internal indicator for Attribs() operation.
|
williamr@2
|
2660 |
This is mapped to CFileMan::EAttribs.
|
williamr@2
|
2661 |
*/
|
williamr@2
|
2662 |
EInternalAttribs,
|
williamr@2
|
2663 |
|
williamr@2
|
2664 |
/**
|
williamr@2
|
2665 |
Internal indicator for Copy() operation.
|
williamr@2
|
2666 |
This is mapped to CFileMan::ECopy.
|
williamr@2
|
2667 |
*/
|
williamr@2
|
2668 |
EInternalCopy,
|
williamr@2
|
2669 |
|
williamr@2
|
2670 |
/**
|
williamr@2
|
2671 |
Internal indicator for Delete() operation.
|
williamr@2
|
2672 |
This is mapped to CFileMan::EDelete.
|
williamr@2
|
2673 |
*/
|
williamr@2
|
2674 |
EInternalDelete,
|
williamr@2
|
2675 |
|
williamr@2
|
2676 |
/**
|
williamr@2
|
2677 |
Internal indicator for Move() operation on different drives.
|
williamr@2
|
2678 |
This is mapped to CFileMan::Move.
|
williamr@2
|
2679 |
*/
|
williamr@2
|
2680 |
EInternalCopyForMove,
|
williamr@2
|
2681 |
|
williamr@2
|
2682 |
/**
|
williamr@2
|
2683 |
Internal indicator for Move() operation on the same drive.
|
williamr@2
|
2684 |
This is mapped to CFileMan::Rename.
|
williamr@2
|
2685 |
Note for compatibility reasons, it is not mapped to CFileMan::Move.
|
williamr@2
|
2686 |
*/
|
williamr@2
|
2687 |
EInternalRenameForMove,
|
williamr@2
|
2688 |
|
williamr@2
|
2689 |
/**
|
williamr@2
|
2690 |
Internal indicator for Rename() operation.
|
williamr@2
|
2691 |
This is mapped to CFileMan::ERename.
|
williamr@2
|
2692 |
*/
|
williamr@2
|
2693 |
EInternalRename,
|
williamr@2
|
2694 |
|
williamr@2
|
2695 |
/**
|
williamr@2
|
2696 |
Internal indicator for RmDir() operation.
|
williamr@2
|
2697 |
This is mapped to CFileMan::ERmDir.
|
williamr@2
|
2698 |
*/
|
williamr@2
|
2699 |
EInternalRmDir,
|
williamr@2
|
2700 |
|
williamr@2
|
2701 |
/**
|
williamr@2
|
2702 |
Internal indicator for RenameInvalidEntry() operation.
|
williamr@2
|
2703 |
This is mapped to CFileMan::ERenameInvalidEntry.
|
williamr@2
|
2704 |
*/
|
williamr@2
|
2705 |
EInternalRenameInvalidEntry,
|
williamr@2
|
2706 |
|
williamr@2
|
2707 |
/**
|
williamr@2
|
2708 |
Internal indicator for CopyFromHandle() operation.
|
williamr@2
|
2709 |
This is mapped to CFileMan::ECopyFromHandle.
|
williamr@2
|
2710 |
*/
|
williamr@2
|
2711 |
EInternalCopyFromHandle,
|
williamr@2
|
2712 |
};
|
williamr@2
|
2713 |
|
williamr@2
|
2714 |
void CompleteOperationL();
|
williamr@2
|
2715 |
void DoOperationL();
|
williamr@2
|
2716 |
void CheckForDirectory();
|
williamr@2
|
2717 |
void SetFlags(TBool aOverWrite,TBool aRecurse,TBool aScanDirection,TBool aMoveRename);
|
williamr@2
|
2718 |
void GetSrcAndTrg(TParse& aSrcName,TFileName& aTrgName);
|
williamr@2
|
2719 |
void DoSynchronize(TInt aRetVal);
|
williamr@2
|
2720 |
TInt CheckRenameAllowed(const TDesC& aSrcName,const TDesC& aTrgName);
|
williamr@2
|
2721 |
TInt SetupMoveOnSameDrive(TUint aSwitches, TBool& aComplete);
|
williamr@2
|
2722 |
TInt SetupMoveAcrossDrives(TUint aSwitches);
|
williamr@2
|
2723 |
TInt SetupTargetDirectory(TBool aOverWrite, TBool& aComplete);
|
williamr@2
|
2724 |
TBool SrcTrgDrivesIdentical();
|
williamr@2
|
2725 |
TBool SetupDirectoryForMove();
|
williamr@2
|
2726 |
private:
|
williamr@2
|
2727 |
void DoAttribsL();
|
williamr@2
|
2728 |
void DoCopyOrMoveL();
|
williamr@2
|
2729 |
void DoDeleteL();
|
williamr@2
|
2730 |
void DoRenameL();
|
williamr@2
|
2731 |
void DoRmDirL();
|
williamr@2
|
2732 |
void DoCopyFromHandleL();
|
williamr@2
|
2733 |
TInt DoCopy(const RFile& aSrcFile, RFile& aDstFile, TInt& aRet);
|
williamr@2
|
2734 |
private:
|
williamr@2
|
2735 |
TParse iTrgFile;
|
williamr@2
|
2736 |
TInternalAction iAction;
|
williamr@2
|
2737 |
TUint iSetMask;
|
williamr@2
|
2738 |
TUint iClearMask;
|
williamr@2
|
2739 |
TTime iTime;
|
williamr@2
|
2740 |
TInt iBytesTransferred;
|
williamr@2
|
2741 |
RFile iSrcFileHandle;
|
williamr@2
|
2742 |
TBool iMovingContents;
|
williamr@2
|
2743 |
TEntry iTmpEntry;
|
williamr@2
|
2744 |
TParse iTmpParse;
|
williamr@2
|
2745 |
TFileName iTmpName1;
|
williamr@2
|
2746 |
TFileName iTmpName2;
|
williamr@2
|
2747 |
|
williamr@2
|
2748 |
friend void RenameInvalidEntryL(RFs& aFs,TParse& aSrcFile);
|
williamr@2
|
2749 |
};
|
williamr@2
|
2750 |
|
williamr@2
|
2751 |
|
williamr@2
|
2752 |
|
williamr@2
|
2753 |
|
williamr@2
|
2754 |
class TFindFile
|
williamr@2
|
2755 |
/**
|
williamr@2
|
2756 |
@publishedAll
|
williamr@2
|
2757 |
@released
|
williamr@2
|
2758 |
|
williamr@2
|
2759 |
Searches for files and directories.
|
williamr@2
|
2760 |
|
williamr@2
|
2761 |
Each function has a variant which searches for multiple files/directories,
|
williamr@2
|
2762 |
using one or more wildcard characters in the filename.
|
williamr@2
|
2763 |
If an initial search is successful, further searches can be carried out
|
williamr@2
|
2764 |
using Find() or FindWild().
|
williamr@2
|
2765 |
You can also retrieve the fully qualified file specification,
|
williamr@2
|
2766 |
and manipulate and interrogate it using the TParse class (or related classes).
|
williamr@2
|
2767 |
|
williamr@2
|
2768 |
Note that when specifying the path of a directory to search, the path should
|
williamr@2
|
2769 |
always end with a backslash character.When trailing backslash is not present
|
williamr@2
|
2770 |
then it is considered as file. And path will be taken till last backslash.
|
williamr@2
|
2771 |
The client must have appropriate capabilities for the directory to be searched.
|
williamr@2
|
2772 |
For example without ALL FILES Capability, it is not possible to successfully
|
williamr@2
|
2773 |
find any files under \sys\bin directory.
|
williamr@2
|
2774 |
|
williamr@2
|
2775 |
By default if the file is not found in the current drive the rest of the drives,
|
williamr@2
|
2776 |
excluding the remote ones, will be searched. Using function SetFindMask it is
|
williamr@2
|
2777 |
possible to specify a combination of drive attributes(aMask) that the drives to
|
williamr@2
|
2778 |
be searched must match.
|
williamr@2
|
2779 |
|
williamr@2
|
2780 |
*/
|
williamr@2
|
2781 |
{
|
williamr@2
|
2782 |
public:
|
williamr@2
|
2783 |
IMPORT_C TFindFile(RFs& aFs);
|
williamr@2
|
2784 |
IMPORT_C TInt FindByPath(const TDesC& aFileName,const TDesC* aPathList);
|
williamr@2
|
2785 |
IMPORT_C TInt FindByDir(const TDesC& aFileName,const TDesC& aDirPath);
|
williamr@2
|
2786 |
IMPORT_C TInt Find();
|
williamr@2
|
2787 |
IMPORT_C TInt FindWildByPath(const TDesC& aFileName,const TDesC* aPathList,CDir*& aDirList);
|
williamr@2
|
2788 |
IMPORT_C TInt FindWildByDir(const TDesC& aFileName,const TDesC& aDirPath,CDir*& aDir);
|
williamr@2
|
2789 |
IMPORT_C TInt FindWild(CDir*& aDirList);
|
williamr@2
|
2790 |
IMPORT_C TInt SetFindMask(TUint aMask);
|
williamr@2
|
2791 |
inline const TDesC& File() const;
|
williamr@2
|
2792 |
private:
|
williamr@2
|
2793 |
TInt DoFind();
|
williamr@2
|
2794 |
TInt DoFindByPath(const TDesC& aFileName,const TDesC* aPathList);
|
williamr@2
|
2795 |
TInt DoFindByDir(const TDesC& aFileName,const TDesC& aDir);
|
williamr@2
|
2796 |
TInt DoFindInDir();
|
williamr@2
|
2797 |
TInt DoFindNextInPath();
|
williamr@2
|
2798 |
TInt DoFindNextInDriveList();
|
williamr@2
|
2799 |
private:
|
williamr@2
|
2800 |
RFs* const iFs;
|
williamr@2
|
2801 |
TParse iFile;
|
williamr@2
|
2802 |
TInt iPathPos;
|
williamr@2
|
2803 |
TInt iCurrentDrive;
|
williamr@2
|
2804 |
TInt iMode;
|
williamr@2
|
2805 |
const TDesC* iPath;
|
williamr@2
|
2806 |
TDriveList iDrvList;
|
williamr@2
|
2807 |
CDir** iDir;
|
williamr@2
|
2808 |
TUint32 iMatchMask;
|
williamr@2
|
2809 |
};
|
williamr@2
|
2810 |
|
williamr@2
|
2811 |
|
williamr@2
|
2812 |
|
williamr@2
|
2813 |
|
williamr@2
|
2814 |
/**
|
williamr@2
|
2815 |
@publishedAll
|
williamr@2
|
2816 |
@released
|
williamr@2
|
2817 |
|
williamr@2
|
2818 |
Contains a list of entries for the files which were opened in
|
williamr@2
|
2819 |
a file server session.
|
williamr@2
|
2820 |
|
williamr@2
|
2821 |
@see CDir
|
williamr@2
|
2822 |
*/
|
williamr@2
|
2823 |
typedef CDir CFileList;
|
williamr@2
|
2824 |
|
williamr@2
|
2825 |
|
williamr@2
|
2826 |
|
williamr@2
|
2827 |
|
williamr@2
|
2828 |
class TOpenFileScan
|
williamr@2
|
2829 |
/**
|
williamr@2
|
2830 |
@publishedAll
|
williamr@2
|
2831 |
@released
|
williamr@2
|
2832 |
|
williamr@2
|
2833 |
Scans open files to get a list of the entries for all files which are currently
|
williamr@2
|
2834 |
open in a particular file server session.
|
williamr@2
|
2835 |
|
williamr@2
|
2836 |
NextL() creates a list of the files opened by the session.
|
williamr@2
|
2837 |
The ID of the thread which opened the files listed may be obtained by calling ThreadId().
|
williamr@2
|
2838 |
If multiple sessions are in use, repeatedly calling NextL() will return a list
|
williamr@2
|
2839 |
of open files in each session.
|
williamr@2
|
2840 |
*/
|
williamr@2
|
2841 |
{
|
williamr@2
|
2842 |
public:
|
williamr@2
|
2843 |
IMPORT_C TOpenFileScan(RFs& aFs);
|
williamr@2
|
2844 |
IMPORT_C void NextL(CFileList*& aFileList);
|
williamr@2
|
2845 |
IMPORT_C TThreadId ThreadId() const;
|
williamr@2
|
2846 |
private:
|
williamr@2
|
2847 |
RFs* iFs;
|
williamr@2
|
2848 |
TThreadId iThreadId;
|
williamr@2
|
2849 |
TInt iScanPos;
|
williamr@2
|
2850 |
TInt iEntryListPos;
|
williamr@2
|
2851 |
};
|
williamr@2
|
2852 |
|
williamr@2
|
2853 |
|
williamr@2
|
2854 |
|
williamr@2
|
2855 |
|
williamr@2
|
2856 |
class TFileText
|
williamr@2
|
2857 |
/**
|
williamr@2
|
2858 |
@publishedAll
|
williamr@2
|
2859 |
@released
|
williamr@2
|
2860 |
|
williamr@2
|
2861 |
Reads and writes single lines of text to or from a Unicode file.
|
williamr@2
|
2862 |
*/
|
williamr@2
|
2863 |
{
|
williamr@2
|
2864 |
public:
|
williamr@2
|
2865 |
/**
|
williamr@2
|
2866 |
@internalComponent
|
williamr@2
|
2867 |
*/
|
williamr@2
|
2868 |
enum TFileState
|
williamr@2
|
2869 |
{
|
williamr@2
|
2870 |
EStartOfFile,
|
williamr@2
|
2871 |
ENormal,
|
williamr@2
|
2872 |
EReverse
|
williamr@2
|
2873 |
};
|
williamr@2
|
2874 |
public:
|
williamr@2
|
2875 |
IMPORT_C TFileText();
|
williamr@2
|
2876 |
IMPORT_C void Set(RFile& aFile);
|
williamr@2
|
2877 |
IMPORT_C TInt Read(TDes& aDes);
|
williamr@2
|
2878 |
IMPORT_C TInt Write(const TDesC& aDes);
|
williamr@2
|
2879 |
IMPORT_C TInt Seek(TSeek aMode);
|
williamr@2
|
2880 |
private:
|
williamr@2
|
2881 |
void NextRecord();
|
williamr@2
|
2882 |
TInt CheckForTerminator(TBool& anAnswer);
|
williamr@2
|
2883 |
TInt FillBuffer();
|
williamr@2
|
2884 |
private:
|
williamr@2
|
2885 |
const TText* iNext;
|
williamr@2
|
2886 |
const TText* iEnd;
|
williamr@2
|
2887 |
TFileState iState;
|
williamr@2
|
2888 |
RFile iFile;
|
williamr@2
|
2889 |
TBuf8<0x100> iReadBuf;
|
williamr@2
|
2890 |
};
|
williamr@2
|
2891 |
|
williamr@2
|
2892 |
|
williamr@2
|
2893 |
|
williamr@2
|
2894 |
|
williamr@2
|
2895 |
/**
|
williamr@2
|
2896 |
@publishedAll
|
williamr@2
|
2897 |
@released
|
williamr@2
|
2898 |
*/
|
williamr@2
|
2899 |
IMPORT_C TBool FileNamesIdentical(const TDesC& aFileName1,const TDesC& aFileName2);
|
williamr@2
|
2900 |
|
williamr@2
|
2901 |
|
williamr@2
|
2902 |
|
williamr@2
|
2903 |
/**
|
williamr@2
|
2904 |
Local drive mapping list - passed as argument to RFs::SetLocalDriveMapping().
|
williamr@2
|
2905 |
|
williamr@2
|
2906 |
@publishedPartner
|
williamr@2
|
2907 |
@released
|
williamr@2
|
2908 |
*/
|
williamr@2
|
2909 |
class TLocalDriveMappingInfo
|
williamr@2
|
2910 |
{
|
williamr@2
|
2911 |
public:
|
williamr@2
|
2912 |
enum TDrvMapOperation {EWriteMappingsAndSet=0,EWriteMappingsNoSet=1,ESwapIntMappingAndSet=2};
|
williamr@2
|
2913 |
public:
|
williamr@2
|
2914 |
TInt iDriveMapping[KMaxLocalDrives];
|
williamr@2
|
2915 |
TDrvMapOperation iOperation;
|
williamr@2
|
2916 |
};
|
williamr@2
|
2917 |
typedef TPckgBuf<TLocalDriveMappingInfo> TLocalDriveMappingInfoBuf;
|
williamr@2
|
2918 |
|
williamr@2
|
2919 |
/**
|
williamr@2
|
2920 |
Client side plugin API.
|
williamr@2
|
2921 |
|
williamr@2
|
2922 |
@publishedPartner
|
williamr@2
|
2923 |
@released
|
williamr@2
|
2924 |
*/
|
williamr@2
|
2925 |
class RPlugin : public RSubSessionBase
|
williamr@2
|
2926 |
{
|
williamr@2
|
2927 |
public:
|
williamr@2
|
2928 |
IMPORT_C TInt Open(RFs& aFs, TInt aPos);
|
williamr@2
|
2929 |
IMPORT_C void Close();
|
williamr@2
|
2930 |
protected:
|
williamr@2
|
2931 |
IMPORT_C void DoRequest(TInt aReqNo,TRequestStatus& aStatus) const;
|
williamr@2
|
2932 |
IMPORT_C void DoRequest(TInt aReqNo,TRequestStatus& aStatus,TDes8& a1) const;
|
williamr@2
|
2933 |
IMPORT_C void DoRequest(TInt aReqNo,TRequestStatus& aStatus,TDes8& a1,TDes8& a2) const;
|
williamr@2
|
2934 |
IMPORT_C TInt DoControl(TInt aFunction) const;
|
williamr@2
|
2935 |
IMPORT_C TInt DoControl(TInt aFunction,TDes8& a1) const;
|
williamr@2
|
2936 |
IMPORT_C TInt DoControl(TInt aFunction,TDes8& a1,TDes8& a2) const;
|
williamr@2
|
2937 |
IMPORT_C void DoCancel(TUint aReqMask) const;
|
williamr@2
|
2938 |
};
|
williamr@2
|
2939 |
|
williamr@2
|
2940 |
/**
|
williamr@2
|
2941 |
@publishedPartner
|
williamr@2
|
2942 |
@released
|
williamr@2
|
2943 |
|
williamr@2
|
2944 |
Specifies that a plugin should determine for itself which drives it attaches to.
|
williamr@2
|
2945 |
|
williamr@2
|
2946 |
@see RFs::MountPlugin
|
williamr@2
|
2947 |
@see RFs::DismountPlugin
|
williamr@2
|
2948 |
*/
|
williamr@2
|
2949 |
const TInt KPluginAutoAttach = 0x19;
|
williamr@2
|
2950 |
|
williamr@2
|
2951 |
/**
|
williamr@2
|
2952 |
@publishedPartner
|
williamr@2
|
2953 |
@released
|
williamr@2
|
2954 |
|
williamr@2
|
2955 |
Specifies that a plugin should determine its own position in the plugin stack.
|
williamr@2
|
2956 |
|
williamr@2
|
2957 |
@see RFs::MountPlugin
|
williamr@2
|
2958 |
@see RFs::DismountPlugin
|
williamr@2
|
2959 |
*/
|
williamr@2
|
2960 |
const TInt KPluginAutoLocate = 0xC8;
|
williamr@2
|
2961 |
|
williamr@2
|
2962 |
/**
|
williamr@2
|
2963 |
@publishedAll
|
williamr@2
|
2964 |
@released
|
williamr@2
|
2965 |
|
williamr@2
|
2966 |
The UID of the File Server process
|
williamr@2
|
2967 |
*/
|
williamr@2
|
2968 |
const TInt KFileServerUidValue = 0x100039e3;
|
williamr@2
|
2969 |
|
williamr@2
|
2970 |
enum TSessionFlags
|
williamr@2
|
2971 |
/**
|
williamr@2
|
2972 |
@internalTechnology
|
williamr@2
|
2973 |
|
williamr@2
|
2974 |
A set of session specific configuration flags.
|
williamr@2
|
2975 |
*/
|
williamr@2
|
2976 |
{
|
williamr@2
|
2977 |
/**
|
williamr@2
|
2978 |
Notify the user or write failures
|
williamr@2
|
2979 |
*/
|
williamr@2
|
2980 |
EFsSessionNotifyUser = KBit0,
|
williamr@2
|
2981 |
|
williamr@2
|
2982 |
/**
|
williamr@2
|
2983 |
Notify clients registered for change notification
|
williamr@2
|
2984 |
*/
|
williamr@2
|
2985 |
EFsSessionNotifyChange = KBit1,
|
williamr@2
|
2986 |
|
williamr@2
|
2987 |
/**
|
williamr@2
|
2988 |
Enables all session flags
|
williamr@2
|
2989 |
*/
|
williamr@2
|
2990 |
EFsSessionFlagsAll = KSet32,
|
williamr@2
|
2991 |
};
|
williamr@2
|
2992 |
|
williamr@2
|
2993 |
/**
|
williamr@2
|
2994 |
@internalTechnology
|
williamr@2
|
2995 |
*/
|
williamr@2
|
2996 |
struct SBlockMapArgs
|
williamr@2
|
2997 |
{
|
williamr@2
|
2998 |
TInt64 iStartPos;
|
williamr@2
|
2999 |
TInt64 iEndPos;
|
williamr@2
|
3000 |
};
|
williamr@2
|
3001 |
|
williamr@2
|
3002 |
|
williamr@2
|
3003 |
/**
|
williamr@2
|
3004 |
@internalTechnology
|
williamr@2
|
3005 |
|
williamr@2
|
3006 |
Validates the mask used to match drive attributes.
|
williamr@2
|
3007 |
|
williamr@2
|
3008 |
@see RFs::DriveList
|
williamr@2
|
3009 |
@see TFindFile::SetFindMask
|
williamr@2
|
3010 |
*/
|
williamr@2
|
3011 |
TInt ValidateMatchMask( TUint aMask);
|
williamr@2
|
3012 |
|
williamr@2
|
3013 |
|
williamr@2
|
3014 |
|
williamr@2
|
3015 |
|
williamr@2
|
3016 |
#include "f32file.inl"
|
williamr@2
|
3017 |
#endif
|