author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Thu, 02 Sep 2010 21:54:16 +0300 | |
changeset 259 | 57b9594f5772 |
parent 247 | d8d70de2bd36 |
child 257 | 3e88ff8f41d5 |
child 273 | 6a75fa55495f |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 |
// All rights reserved. |
|
3 |
// This component and the accompanying materials are made available |
|
4 |
// under the terms of the License "Eclipse Public License v1.0" |
|
5 |
// which accompanies this distribution, and is available |
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// f32\inc\f32fsys.inl |
|
15 |
// |
|
16 |
// WARNING: This file contains some APIs which are internal and are subject |
|
17 |
// to change without noticed. Such APIs should therefore not be used |
|
18 |
// outside the Kernel and Hardware Services package. |
|
19 |
// |
|
20 |
||
21 |
#define __IS_DRIVETHREAD() {__ASSERT_DEBUG(IsDriveThread(),DriveFault(ETrue));} |
|
22 |
#define __IS_MAINTHREAD() {__ASSERT_DEBUG(IsMainThread(),DriveFault(EFalse));} |
|
23 |
||
24 |
||
25 |
//--------------------------------------------------------------------------------------------------------------------------------- |
|
26 |
// Class TDrive |
|
27 |
||
28 |
/** |
|
29 |
Gets last error reason. |
|
30 |
||
31 |
@return TInt Returns last error reason. |
|
32 |
*/ |
|
33 |
inline TInt TDrive::GetReason() const |
|
34 |
{ |
|
35 |
__IS_DRIVETHREAD(); |
|
36 |
return(iReason); |
|
37 |
} |
|
38 |
||
39 |
||
40 |
||
41 |
/** |
|
42 |
Sets a flag to state that the drive contents has changed. |
|
43 |
||
44 |
@param aValue True if contents has changed; False if unchanged. |
|
45 |
*/ |
|
46 |
inline void TDrive::SetChanged(TBool aValue) |
|
47 |
{ |
|
48 |
iChanged=aValue; |
|
49 |
} |
|
50 |
||
51 |
||
52 |
||
53 |
||
54 |
/** |
|
55 |
Determines whether the drive content has changed. |
|
56 |
||
57 |
@return True if contents changed , False if unchanged. |
|
58 |
*/ |
|
59 |
inline TBool TDrive::IsChanged() const |
|
60 |
{ |
|
61 |
return(iChanged); |
|
62 |
} |
|
63 |
||
64 |
||
65 |
||
66 |
||
67 |
/** |
|
68 |
Returns the drive number. |
|
69 |
||
70 |
@return The drive number. |
|
71 |
||
72 |
@see TDriveNumber |
|
73 |
*/ |
|
74 |
inline TInt TDrive::DriveNumber() const |
|
75 |
{return(iDriveNumber);} |
|
76 |
||
77 |
||
78 |
||
79 |
||
80 |
/** |
|
81 |
Determines whether the drive is mounted. |
|
82 |
||
83 |
@return True if drive is mounted, False if drive is not mounted. |
|
84 |
*/ |
|
85 |
inline TBool TDrive::IsMounted() const |
|
86 |
{ |
|
87 |
__IS_DRIVETHREAD(); |
|
88 |
return(iCurrentMount!=NULL); |
|
89 |
} |
|
90 |
||
91 |
||
92 |
||
93 |
||
94 |
/** |
|
95 |
Determines whether attribute is set to local. |
|
96 |
||
97 |
@return True if attribute is set to KDriveAttLocal, False for all other attributes. |
|
98 |
*/ |
|
99 |
inline TBool TDrive::IsLocal() const |
|
100 |
{return(iAtt & KDriveAttLocal);} |
|
101 |
||
102 |
||
103 |
||
104 |
||
105 |
/** |
|
106 |
Determines whether the drive is ROM drive. |
|
107 |
||
108 |
@return True if drive attribute is set as ROM drive , False if not set as ROM drive. |
|
109 |
*/ |
|
110 |
inline TBool TDrive::IsRom() const |
|
111 |
{return( iAtt & KDriveAttRom);} |
|
112 |
||
113 |
||
114 |
||
115 |
||
116 |
/** |
|
117 |
Determines whether the drive is removable. |
|
118 |
||
119 |
@return True if drive attribute is set to removable , False for all other attributes. |
|
120 |
*/ |
|
121 |
inline TBool TDrive::IsRemovable() const |
|
122 |
{return( iAtt & KDriveAttRemovable);} |
|
123 |
||
124 |
||
125 |
||
126 |
||
127 |
/** |
|
128 |
Determines whether the drive is substed. |
|
129 |
||
130 |
@return True if drive attribute is set to substed (KDriveAttSubsted), False for all other attributes. |
|
131 |
*/ |
|
132 |
inline TBool TDrive::IsSubsted() const |
|
133 |
{return( iAtt & KDriveAttSubsted);}// KDriveAttSubsted = 0x08 |
|
134 |
||
135 |
||
136 |
||
137 |
||
138 |
/** |
|
139 |
Gets a reference to the object representing the current mount. |
|
140 |
||
141 |
@return The file's mount. |
|
142 |
*/ |
|
143 |
inline CMountCB& TDrive::CurrentMount() const |
|
144 |
{ |
|
145 |
__IS_DRIVETHREAD(); |
|
146 |
return(*iCurrentMount); |
|
147 |
} |
|
148 |
||
149 |
inline TBool TDrive::IsCurrentMount(CMountCB& aMount) const |
|
150 |
{return(iCurrentMount == &aMount);} |
|
151 |
||
152 |
||
153 |
||
154 |
/** |
|
155 |
Gets the substed drive. |
|
156 |
||
157 |
@return A pointer to the drive which is substed. |
|
158 |
*/ |
|
159 |
inline TDrive& TDrive::SubstedDrive()const |
|
160 |
{ |
|
161 |
__IS_MAINTHREAD(); |
|
162 |
return(*iSubstedDrive); |
|
163 |
} |
|
164 |
||
165 |
||
166 |
||
167 |
||
168 |
/** |
|
169 |
||
170 |
Sets the drive as substed to the path set by an earlier call to SetSubst(). |
|
171 |
||
172 |
@param aDrive A pointer to the drive on which the volume is mounted. |
|
173 |
||
174 |
*/ |
|
175 |
inline void TDrive::SetSubstedDrive(TDrive* aDrive) |
|
176 |
{ |
|
177 |
__IS_MAINTHREAD(); |
|
178 |
iSubstedDrive=aDrive; |
|
179 |
} |
|
180 |
||
181 |
||
182 |
||
183 |
||
184 |
/** |
|
185 |
Gets the substed path set by an earlier call to SetSubst(). |
|
186 |
||
187 |
@return A reference to a heap descriptor containing the substed path. |
|
188 |
*/ |
|
189 |
inline HBufC& TDrive::Subst() const |
|
190 |
{ |
|
191 |
__IS_MAINTHREAD(); |
|
192 |
return(*iSubst); |
|
193 |
} |
|
194 |
||
195 |
||
196 |
||
197 |
||
198 |
/** |
|
199 |
Assigns a path to a drive. |
|
200 |
||
201 |
@param aSubst Path will be assigned to a drive. |
|
202 |
||
203 |
*/ |
|
204 |
inline void TDrive::SetSubst(HBufC* aSubst) |
|
205 |
{ |
|
206 |
__IS_MAINTHREAD(); |
|
207 |
iSubst=aSubst; |
|
208 |
} |
|
209 |
||
210 |
||
211 |
||
212 |
/** |
|
213 |
||
214 |
Gets a reference to the object representing the mount on which the file resides. |
|
215 |
||
216 |
@return The Drives's mount. |
|
217 |
||
218 |
*/ |
|
219 |
inline CFsObjectCon& TDrive::Mount() const |
|
220 |
{return(*iMount);} |
|
221 |
/** |
|
222 |
||
223 |
Gets a reference to the object representing the file system |
|
224 |
||
225 |
@return The reference to file system. |
|
226 |
||
227 |
*/ |
|
228 |
inline CFileSystem& TDrive::FSys() |
|
229 |
{return(*iFSys);} |
|
230 |
/** |
|
231 |
||
232 |
Gets the object representing the file system |
|
233 |
||
234 |
@return The file system. |
|
235 |
||
236 |
*/ |
|
237 |
inline CFileSystem*& TDrive::GetFSys() |
|
238 |
{return(iFSys);} |
|
239 |
/** |
|
240 |
||
241 |
Gets the object representing the TDriveExtInfo. |
|
242 |
||
243 |
@return The Drive extension information object. |
|
244 |
||
245 |
@see TDriveExtInfo |
|
246 |
||
247 |
*/ |
|
248 |
inline TDriveExtInfo& TDrive::ExtInfo() |
|
249 |
{ |
|
250 |
__IS_DRIVETHREAD(); |
|
251 |
return(iExtInfo); |
|
252 |
} |
|
253 |
/** |
|
254 |
Sets the notification flag ON. The client will receive notifications on Read or Write |
|
255 |
failures from the file system. |
|
256 |
||
257 |
*/ |
|
258 |
inline void TDrive::SetNotifyOn() |
|
259 |
{ |
|
260 |
__IS_DRIVETHREAD(); |
|
261 |
iDriveFlags &= ~ENotifyOff; |
|
262 |
} |
|
263 |
/** |
|
264 |
Sets the notification flag OFF. The client will not receive notifications on Read or Write |
|
265 |
failures from the file system. |
|
266 |
||
267 |
*/ |
|
268 |
inline void TDrive::SetNotifyOff() |
|
269 |
{ |
|
270 |
__IS_DRIVETHREAD(); |
|
271 |
iDriveFlags |= ENotifyOff; |
|
272 |
} |
|
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
273 |
|
0 | 274 |
/** |
275 |
Locks the drive.This function acquires iLock mutex. |
|
276 |
*/ |
|
277 |
inline void TDrive::Lock() |
|
278 |
{iLock.Wait();} |
|
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
279 |
|
0 | 280 |
/** |
281 |
UnLocks the drive.This function signals the iLock mutex. |
|
282 |
*/ |
|
283 |
inline void TDrive::UnLock() |
|
284 |
{iLock.Signal();} |
|
285 |
||
286 |
||
287 |
/** |
|
288 |
@return Amount of space reserved in bytes. |
|
289 |
*/ |
|
290 |
inline TInt TDrive::ReservedSpace() const |
|
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
291 |
{ |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
292 |
return iReservedSpace; |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
293 |
} |
0 | 294 |
|
295 |
/** |
|
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
296 |
Reserves space on a drive. The amount of 'reserved space' is subtracted |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
297 |
from the amount of available free space on the volume reported by file system, when the user |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
298 |
queries it. |
0 | 299 |
|
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
300 |
@param aReservedSpace Amount of space to reserve in bytes. |
0 | 301 |
*/ |
302 |
inline void TDrive::SetReservedSpace(const TInt aReservedSpace) |
|
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
303 |
{ |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
304 |
iReservedSpace=aReservedSpace; |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
305 |
} |
0 | 306 |
|
307 |
/** |
|
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
308 |
Sets the 'rugged mode' flag in the drive object. The file system associated with this TDrive object |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
309 |
can use this flag for changing its behaviour. |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
310 |
For example, FAT file system if this flag is set, operates in 'Rugged FAT' mode, when the performance is |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
311 |
sacrificed for the sake of reliability. |
0 | 312 |
|
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
313 |
@param aIsRugged the 'rugged mode' flag. |
0 | 314 |
*/ |
315 |
inline void TDrive::SetRugged(TBool aIsRugged) |
|
316 |
{ |
|
317 |
if (!aIsRugged) |
|
318 |
iDriveFlags |= ENotRugged; |
|
319 |
else |
|
320 |
iDriveFlags &= ~ENotRugged; |
|
321 |
} |
|
322 |
||
323 |
/** |
|
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
324 |
@return 'Is rugged' flag. |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
325 |
See TDrive::SetRugged() |
0 | 326 |
*/ |
327 |
inline TBool TDrive::IsRugged() const |
|
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
328 |
{ |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
329 |
return !(iDriveFlags & ENotRugged); |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
330 |
} |
0 | 331 |
|
332 |
||
333 |
/** |
|
334 |
@return ETrue if the drive is synchronous, i.e. runs in the main file server thread. |
|
335 |
*/ |
|
336 |
inline TBool TDrive::IsSynchronous() const |
|
337 |
{ |
|
338 |
return iDriveFlags & EDriveIsSynch; |
|
339 |
} |
|
340 |
||
341 |
/** |
|
342 |
Set or reset internal EDriveIsSynch flag for the TDrive. |
|
343 |
*/ |
|
344 |
inline void TDrive::SetSynchronous(TBool aIsSynch) |
|
345 |
{ |
|
346 |
if(aIsSynch) |
|
347 |
iDriveFlags |= EDriveIsSynch; |
|
348 |
else |
|
349 |
iDriveFlags &= ~EDriveIsSynch; |
|
350 |
||
351 |
} |
|
352 |
||
353 |
inline TBool TDrive::DismountDeferred() const |
|
354 |
{ return(iDriveFlags & EDismountDeferred); } |
|
355 |
||
356 |
||
357 |
// Class CMountCB |
|
358 |
||
359 |
/** |
|
360 |
Gets a reference to the object representing the drive on which |
|
361 |
the volume is mounted. |
|
362 |
||
363 |
@return The drive on which the volume is mounted. |
|
364 |
*/ |
|
365 |
inline TDrive& CMountCB::Drive() const |
|
366 |
{return(*iDrive);} |
|
367 |
||
368 |
||
369 |
||
370 |
||
371 |
/** |
|
372 |
Sets a pointer to the object representing the drive on which |
|
373 |
the volume is mounted. |
|
374 |
||
375 |
@param aDrive A pointer to the drive on which the volume is mounted. |
|
376 |
*/ |
|
377 |
inline void CMountCB::SetDrive(TDrive* aDrive) |
|
378 |
{iDrive=aDrive;} |
|
379 |
||
380 |
||
381 |
||
382 |
||
383 |
/** |
|
384 |
Gets a reference to a heap descriptor containing the name of |
|
385 |
the mounted volume. |
|
386 |
||
387 |
@return A reference to a heap descriptor containing the volume name. |
|
388 |
*/ |
|
389 |
inline HBufC& CMountCB::VolumeName() const |
|
390 |
{return(*iVolumeName);} |
|
391 |
||
392 |
||
393 |
||
394 |
||
395 |
/** |
|
396 |
Sets a pointer to a heap descriptor containing the name of the mounted volume. |
|
397 |
||
398 |
@param aName A pointer to a heap descriptor containing the name of |
|
399 |
the mounted volume to be set. |
|
400 |
*/ |
|
401 |
inline void CMountCB::SetVolumeName(HBufC* aName) |
|
402 |
{iVolumeName=aName;} |
|
403 |
||
404 |
||
405 |
||
406 |
||
407 |
/** |
|
408 |
Tests whether the client is notified of any read or write failures. |
|
409 |
||
410 |
The notification status is a property of the current session with |
|
411 |
the file server, the value of which is stored in CSessionFs::iNotifyUser. |
|
412 |
If set to true, the client will receive notifications from the file system. |
|
413 |
||
414 |
Typically, this function might be used to save the current notification |
|
415 |
state prior to temporarily disabling notifiers. This allows the original |
|
416 |
notification state to be restored. |
|
417 |
||
418 |
Note that GetNotifyUser() is only available once the drive has been set for |
|
419 |
the mount control block (using SetDrive()), since the notification status |
|
420 |
is held by the session and accessed via the drive. |
|
421 |
||
422 |
@return True if the client receives notifications from the file system, |
|
423 |
false otherwise. |
|
424 |
*/ |
|
425 |
inline TBool CMountCB::GetNotifyUser() const |
|
426 |
{return(Drive().GetNotifyUser());} |
|
427 |
||
428 |
||
429 |
||
430 |
||
431 |
/** |
|
432 |
*/ |
|
433 |
inline void CMountCB::SetNotifyOn() |
|
434 |
{Drive().SetNotifyOn();} |
|
435 |
||
436 |
||
437 |
||
438 |
||
439 |
/** |
|
440 |
*/ |
|
441 |
inline void CMountCB::SetNotifyOff() |
|
442 |
{Drive().SetNotifyOff();} |
|
443 |
||
444 |
||
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
445 |
//--------------------------------------------------------------------------------------------------------------------------------- |
0 | 446 |
|
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
447 |
/** |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
448 |
|
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
449 |
Increment mount's lock counter. This happens on following events: |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
450 |
- RemoveResource() call, when file (share) or directory is closed |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
451 |
- AddDiskAccess() call, when disk access object (like Format or RawDisk access) is opened on the mount. |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
452 |
|
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
453 |
See also: CMountCB::LockStatus() |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
454 |
*/ |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
455 |
inline void CMountCB::IncLock() |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
456 |
{ |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
457 |
iLockMount++; |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
458 |
} |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
459 |
|
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
460 |
|
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
461 |
//--------------------------------------------------------------------------------------------------------------------------------- |
0 | 462 |
|
463 |
/** |
|
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
464 |
Decrement mount's lock counter. This happens on following events: |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
465 |
|
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
466 |
AddResource() call when file (share) or directory is opened on the mount |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
467 |
RemoveDiskAccess() call when disk access object (like Format or RawDisk access) is closed. |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
468 |
|
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
469 |
See also: CMountCB::LockStatus() |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
470 |
*/ |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
471 |
inline void CMountCB::DecLock() |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
472 |
{ |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
473 |
iLockMount--; |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
474 |
} |
0 | 475 |
|
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
476 |
//--------------------------------------------------------------------------------------------------------------------------------- |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
477 |
|
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
478 |
/** |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
479 |
@return value of the Mount's lock counter value. |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
480 |
|
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
481 |
The meaning of 'iLockMount' is overloaded a bit, it's value is: |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
482 |
0 when there are no files, directories, formats and any other objects opened on the mount |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
483 |
>0 when there are disk access objects opened (raw disk access or format) |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
484 |
<0 when there are files or directories opened on the mount, and the value reflects their total number |
0 | 485 |
*/ |
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
486 |
inline TInt CMountCB::LockStatus() const |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
487 |
{ |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
488 |
return iLockMount; |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
489 |
} |
0 | 490 |
|
491 |
||
492 |
||
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
493 |
//--------------------------------------------------------------------------------------------------------------------------------- |
0 | 494 |
/** |
495 |
Tests whether the mount is currently locked. |
|
496 |
||
497 |
A mount is locked when the internal lock counter is greater than zero. |
|
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
498 |
This happens when a format, resource or raw disk subsession is opened on the mount. |
0 | 499 |
|
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
500 |
See also: CMountCB::LockStatus() |
0 | 501 |
|
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
502 |
@return True if the mount is locked by having disk access objects opened |
0 | 503 |
*/ |
504 |
inline TBool CMountCB::Locked() const |
|
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
505 |
{ |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
506 |
return iLockMount > 0; |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
507 |
} |
0 | 508 |
|
509 |
||
510 |
||
511 |
||
512 |
/** |
|
513 |
Tests whether the mount control block represents the current mount on |
|
514 |
the associated drive. |
|
515 |
||
516 |
A drive has only one mount which is accessible: the current mount. |
|
517 |
Any mount other than the current mount relates to a partition (i.e. volume) |
|
518 |
that was present on a removable media which has since been removed. |
|
519 |
The reason the mount has persisted is because resources (i.e. files/directories) |
|
520 |
are still open on it. |
|
521 |
||
522 |
This function is only available when the drive has been set for the mount |
|
523 |
control block (using SetDrive()), since the current mount is held by the drive. |
|
524 |
||
525 |
@return True if the mount is the current mount on the drive, false otherwise. |
|
526 |
*/ |
|
527 |
inline TBool CMountCB::IsCurrentMount() const |
|
528 |
{return(this==&iDrive->CurrentMount());} |
|
529 |
||
530 |
||
531 |
||
532 |
||
533 |
/** |
|
534 |
*/ |
|
535 |
inline TInt64 CMountCB::Size() const |
|
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
536 |
{ |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
537 |
return iSize; |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
538 |
} |
0 | 539 |
|
540 |
||
541 |
||
542 |
||
543 |
/** |
|
544 |
Set the unique mount number |
|
545 |
@param aMountNumber - The unique mount number |
|
546 |
*/ |
|
547 |
const TInt KMountDismounted = 0x80000000; |
|
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
548 |
|
0 | 549 |
inline void CMountCB::SetMountNumber(TInt aMountNumber) |
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
550 |
{ |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
551 |
iMountNumber = (aMountNumber & ~KMountDismounted); |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
552 |
} |
0 | 553 |
|
554 |
||
555 |
||
556 |
||
557 |
/** |
|
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
558 |
Set the mount flag indicating that it is in 'dismounted' state. |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
559 |
The CMountCB object in this case is still alive, but any attempts to access resources on this |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
560 |
mount result in KErrDismounted. |
0 | 561 |
*/ |
562 |
inline void CMountCB::SetDismounted(TBool aDismounted) |
|
563 |
{ |
|
564 |
if(aDismounted) |
|
565 |
iMountNumber |= KMountDismounted; |
|
566 |
else |
|
567 |
iMountNumber &= ~KMountDismounted; |
|
568 |
} |
|
569 |
||
570 |
||
571 |
||
572 |
||
573 |
/** |
|
574 |
@return The unique mount number |
|
575 |
*/ |
|
576 |
inline TInt CMountCB::MountNumber() const |
|
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
577 |
{ |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
578 |
return(iMountNumber &~ KMountDismounted); |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
579 |
} |
0 | 580 |
|
581 |
||
582 |
||
583 |
||
584 |
/** |
|
585 |
@return ETrue if the mount is flagged as dismounted |
|
586 |
*/ |
|
587 |
inline TBool CMountCB::IsDismounted() const |
|
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
588 |
{ |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
589 |
return(iMountNumber & KMountDismounted); |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
590 |
} |
0 | 591 |
|
592 |
||
593 |
||
594 |
/** |
|
595 |
Retrieves TBusLocalDrive object associated with the mount |
|
596 |
*/ |
|
597 |
inline TInt CMountCB::LocalDrive(TBusLocalDrive*& aLocalDrive) |
|
598 |
{ |
|
599 |
aLocalDrive = NULL; |
|
600 |
return GetInterface(EGetLocalDrive, (TAny*&) aLocalDrive, NULL); |
|
601 |
} |
|
602 |
||
603 |
/** |
|
604 |
Retrieves CProxyDrive object associated with the mount |
|
605 |
*/ |
|
606 |
inline TInt CMountCB::ProxyDrive(CProxyDrive*& aProxyDrive) |
|
607 |
{ |
|
608 |
aProxyDrive = NULL; |
|
609 |
return GetInterface(EGetProxyDrive, (TAny*&) aProxyDrive, NULL); |
|
610 |
} |
|
611 |
||
612 |
inline TInt CMountCB::AddToCompositeMount(TInt aMountIndex) |
|
613 |
{ |
|
614 |
TAny *mountInterface = NULL; |
|
615 |
return(GetInterface(EAddToCompositeMount, mountInterface, (TAny*)aMountIndex)); |
|
616 |
} |
|
617 |
||
618 |
/** |
|
619 |
Returns whether the mount (and any extensions) support file caching |
|
620 |
*/ |
|
621 |
inline TInt CMountCB::LocalBufferSupport(CFileCB* aFile) |
|
622 |
{ |
|
623 |
TAny* dummyInterface; |
|
624 |
return GetInterface(ELocalBufferSupport, dummyInterface, aFile); |
|
625 |
} |
|
626 |
||
627 |
inline TInt CMountCB::MountControl(TInt /*aLevel*/, TInt /*aOption*/, TAny* /*aParam*/) |
|
628 |
{ |
|
629 |
return KErrNotSupported; |
|
630 |
} |
|
631 |
||
632 |
||
633 |
inline void CMountCB::FinaliseMountL(TInt aOperation, TAny* /*aParam1=NULL*/, TAny* /*aParam2=NULL*/) |
|
634 |
{ |
|
635 |
if(aOperation == RFs::EFinal_RW) |
|
636 |
{//-- call the legacy method |
|
637 |
FinaliseMountL(); |
|
638 |
return; |
|
639 |
} |
|
640 |
||
641 |
User::Leave(KErrNotSupported); |
|
642 |
} |
|
643 |
||
644 |
inline TInt CMountCB::CheckDisk(TInt /*aOperation*/, TAny* /*aParam1=NULL*/, TAny* /*aParam2=NULL*/) |
|
645 |
{ |
|
646 |
return(KErrNotSupported); |
|
647 |
} |
|
648 |
||
649 |
inline TInt CMountCB::ScanDrive(TInt /*aOperation*/, TAny* /*aParam1=NULL*/, TAny* /*aParam2=NULL*/) |
|
650 |
{ |
|
651 |
return(KErrNotSupported); |
|
652 |
} |
|
653 |
||
654 |
||
655 |
//--------------------------------------------------------------------------------------------------------------------------------- |
|
656 |
||
657 |
/** |
|
658 |
Check is this file system can be mounted on the drive at all. The file system implementation may, for example, |
|
659 |
read and validate the boot region without real mounting overhead. |
|
660 |
||
661 |
||
662 |
@return KErrNotSupported this feature is not supported by the file system |
|
663 |
KErrNone this file system can be mounted on this drive |
|
664 |
KErrLocked the media is locked on a physical level. |
|
665 |
other error codes depending on the implementation, indicating that this filesystem can't be mouned |
|
666 |
*/ |
|
667 |
inline TInt CMountCB::CheckFileSystemMountable() |
|
668 |
{ |
|
669 |
return MountControl(ECheckFsMountable, 0, NULL); |
|
670 |
} |
|
671 |
||
672 |
//--------------------------------------------------------------------------------------------------------------------------------- |
|
673 |
/** |
|
674 |
Query if the mount is finalised, corresponds to the EMountStateQuery control code only. |
|
675 |
@param aFinalised out: ETrue if the mount is finalised, EFalse otherwise. |
|
676 |
||
677 |
@return KErrNotSupported this feature is not supported by the file system |
|
678 |
KErrNone on success |
|
679 |
*/ |
|
680 |
inline TInt CMountCB::IsMountFinalised(TBool &aFinalised) |
|
681 |
{ |
|
682 |
return MountControl(EMountStateQuery, ESQ_IsMountFinalised, &aFinalised); |
|
683 |
} |
|
684 |
||
685 |
//--------------------------------------------------------------------------------------------------------------------------------- |
|
686 |
/** |
|
687 |
Corresponds to EMountVolParamQuery. Request a certain amount of free space on the volume. |
|
688 |
If _current_ amount of free space is >= than required or it is not being updated in background by the mount, returns immediately; |
|
689 |
If mount is still counting free space and If _current_ amount of free space is < than required, the caller will be blocked |
|
690 |
until mount finds enough free space or reports that the _final_ amount of free space is less than required. |
|
691 |
||
692 |
@param aFreeSpaceBytes in: number of free bytes on the volume required, out: resulted amount of free space. It can be less than |
|
693 |
required if there isn't enough free space on the volume at all. |
|
694 |
||
695 |
@return KErrNotSupported this feature is not supported by the file system |
|
696 |
KErrNone on success |
|
697 |
*/ |
|
698 |
inline TInt CMountCB::RequestFreeSpace(TUint64 &aFreeSpaceBytes) |
|
699 |
{ |
|
700 |
return MountControl(EMountVolParamQuery, ESQ_RequestFreeSpace, &aFreeSpaceBytes); |
|
701 |
} |
|
702 |
||
703 |
//--------------------------------------------------------------------------------------------------------------------------------- |
|
704 |
/** |
|
705 |
Corresponds to EMountVolParamQuery. A request to obtain the _current_ amount of free space on the volume asynchronously, without blocking. |
|
706 |
Some mounts implementations can count volume free space in the background. |
|
707 |
||
708 |
@param aFreeSpaceBytes in: none; out: _current_ amount of free space on the volume. |
|
709 |
||
710 |
@return KErrNotSupported this feature is not supported by the file system |
|
711 |
KErrNone on success |
|
712 |
*/ |
|
713 |
inline TInt CMountCB::GetCurrentFreeSpaceAvailable(TInt64 &aFreeSpaceBytes) |
|
714 |
{ |
|
715 |
return MountControl(EMountVolParamQuery, ESQ_GetCurrentFreeSpace, &aFreeSpaceBytes); |
|
716 |
} |
|
717 |
||
718 |
//--------------------------------------------------------------------------------------------------------------------------------- |
|
719 |
/** |
|
720 |
Corresponds to EMountVolParamQuery. A request to obtain size of the mounted volume without blocking (CMountCB::VolumeL() can block). |
|
721 |
@param aVolSizeBytes in: none; out: mounted volume size, same as TVolumeInfo::iSize |
|
722 |
||
723 |
@return KErrNotSupported this feature is not supported by the file system |
|
724 |
KErrNone on success |
|
725 |
*/ |
|
726 |
inline TInt CMountCB::MountedVolumeSize(TUint64& aVolSizeBytes) |
|
727 |
{ |
|
728 |
return MountControl(EMountVolParamQuery, ESQ_MountedVolumeSize, &aVolSizeBytes); |
|
729 |
} |
|
730 |
||
731 |
||
732 |
//--------------------------------------------------------------------------------------------------------------------------------- |
|
733 |
/** |
|
734 |
Get Maximum file size, which is supported by the file system that has produced this mount. |
|
735 |
@param aVolSizeBytes in: none; out: Theoretical max. supported by this file system file size. |
|
736 |
||
737 |
@return KErrNotSupported this feature is not supported by the file system |
|
738 |
KErrNone on success |
|
739 |
*/ |
|
740 |
inline TInt CMountCB::GetMaxSupportedFileSize(TUint64 &aSize) |
|
741 |
{ |
|
742 |
return MountControl(EMountFsParamQuery, ESQ_GetMaxSupportedFileSize, &aSize); |
|
743 |
} |
|
744 |
||
745 |
||
746 |
||
747 |
//############################################################################################### |
|
748 |
// Class CFileCB |
|
749 |
||
750 |
/** |
|
751 |
Sets the mount associated with the file. |
|
752 |
||
753 |
@param aMount The mount. |
|
754 |
*/ |
|
755 |
inline void CFileCB::SetMount(CMountCB * aMount) |
|
756 |
{iMount=aMount;} |
|
757 |
||
758 |
/** |
|
759 |
Gets a reference to the object representing the drive on which |
|
760 |
the file resides. |
|
761 |
||
762 |
@return A reference to the file's drive. |
|
763 |
*/ |
|
764 |
inline TDrive& CFileCB::Drive() const |
|
765 |
{return(*iDrive);} |
|
766 |
||
767 |
||
768 |
||
769 |
||
770 |
/** |
|
771 |
Gets a reference to the object representing the drive on which the file was created. |
|
772 |
||
773 |
The 'created drive' is only different from the 'drive', as returned by Drive(), if |
|
774 |
the 'drive' was a substitute for the 'created drive' in the file server session. |
|
775 |
||
776 |
@return A reference to the drive on which the file was created. |
|
777 |
*/ |
|
778 |
inline TDrive& CFileCB::CreatedDrive() const |
|
779 |
{return(*iCreatedDrive);} |
|
780 |
||
781 |
||
782 |
||
783 |
||
784 |
/** |
|
785 |
Gets a reference to the object representing the mount on which the file resides. |
|
786 |
||
787 |
@return The file's mount. |
|
788 |
*/ |
|
789 |
inline CMountCB& CFileCB::Mount() const |
|
790 |
{return(*iMount);} |
|
791 |
||
792 |
||
793 |
||
794 |
||
795 |
/** |
|
796 |
Gets a reference to a heap descriptor containing the full file name. |
|
797 |
||
798 |
@return A heap descriptor containing the full file name. |
|
799 |
*/ |
|
800 |
inline HBufC& CFileCB::FileName() const |
|
801 |
{return(*iFileName);} |
|
802 |
||
803 |
/** |
|
804 |
Gets a reference to a heap descriptor containing the folded full file name. |
|
805 |
||
806 |
@return A heap descriptor containing the full file name. |
|
807 |
*/ |
|
808 |
inline HBufC& CFileCB::FileNameF() const |
|
809 |
{return(*iFileNameF);} |
|
810 |
||
811 |
/** |
|
812 |
Gets the hash of the folded filename |
|
813 |
||
814 |
@return hash of the folded file name |
|
815 |
*/ |
|
816 |
inline TUint32 CFileCB::NameHash() const |
|
817 |
{return(iNameHash);} |
|
818 |
||
819 |
||
820 |
/** |
|
821 |
Gets a reference to the file share locks array being used by the file. |
|
822 |
@return The file share lock. |
|
823 |
*/ |
|
824 |
inline TFileLocksArray& CFileCB::FileLocks() |
|
825 |
{return(*iFileLocks);} |
|
826 |
||
827 |
||
828 |
||
829 |
||
830 |
/** |
|
831 |
Gets the file object's unique ID, as returned by CObject::UniqueID(). |
|
832 |
||
833 |
@return The object's unique ID. |
|
834 |
||
835 |
@see CObject |
|
836 |
*/ |
|
837 |
inline TInt CFileCB::UniqueID() const |
|
838 |
{return(CFsObject::UniqueID());} |
|
839 |
||
840 |
||
841 |
||
842 |
||
843 |
/** |
|
844 |
Gets the iShare value, which defines the level of access allowed to the file. |
|
845 |
||
846 |
@return The value of iShare |
|
847 |
||
848 |
@see CFileCB::iShare |
|
849 |
*/ |
|
850 |
inline TShare CFileCB::Share() const |
|
851 |
{return(iShare);} |
|
852 |
||
853 |
||
854 |
||
855 |
||
856 |
/** |
|
857 |
Sets the iShare value, which defines the level of access allowed to the file. |
|
858 |
||
859 |
@param aShare The new value. |
|
860 |
||
861 |
@see CFileCB::iShare |
|
862 |
*/ |
|
863 |
inline void CFileCB::SetShare(TShare aShare) |
|
864 |
{iShare=aShare;} |
|
865 |
||
866 |
||
867 |
||
868 |
||
869 |
/** |
|
870 |
Gets the size of the file. |
|
871 |
||
872 |
@return The size of the file. |
|
873 |
*/ |
|
874 |
inline TInt CFileCB::Size() const |
|
875 |
{return(iSize);} |
|
876 |
||
877 |
||
878 |
||
879 |
||
880 |
/** |
|
881 |
Sets the size of the file. |
|
882 |
||
883 |
@param aSize The size of the file. |
|
884 |
*/ |
|
885 |
inline void CFileCB::SetSize(TInt aSize) |
|
886 |
{iSize=aSize;} |
|
887 |
||
888 |
||
889 |
||
890 |
||
891 |
/** |
|
892 |
Gets the file's attributes. |
|
893 |
||
894 |
@return An integer containing the file attribute bit mask. |
|
895 |
*/ |
|
896 |
inline TInt CFileCB::Att() const |
|
897 |
{return(iAtt);} |
|
898 |
||
899 |
||
900 |
||
901 |
||
902 |
/** |
|
903 |
Sets the file's attributes. |
|
904 |
||
905 |
@param aAtt The file attribute bit mask. |
|
906 |
*/ |
|
907 |
inline void CFileCB::SetAtt(TInt aAtt) |
|
908 |
{iAtt=aAtt;} |
|
909 |
||
910 |
||
911 |
||
912 |
||
913 |
/** |
|
914 |
Gets the universal time when the file was last modified. |
|
915 |
||
916 |
@return The universal time when the file was last modiified. |
|
917 |
*/ |
|
918 |
inline TTime CFileCB::Modified() const |
|
919 |
{return(iModified);} |
|
920 |
||
921 |
||
922 |
||
923 |
||
924 |
/** |
|
925 |
Sets the universal time when the file was last modified. |
|
926 |
||
927 |
@param aModified The universal time when the file was last modified. |
|
928 |
*/ |
|
929 |
inline void CFileCB::SetModified(TTime aModified) |
|
930 |
{iModified=aModified;} |
|
931 |
||
932 |
||
933 |
||
934 |
||
935 |
/** |
|
936 |
Tests whether the file is corrupt. |
|
937 |
||
938 |
@return ETrue if the file is corrupt; EFalse otherwise. |
|
939 |
*/ |
|
940 |
inline TBool CFileCB::FileCorrupt() const |
|
941 |
{return iFileCorrupt;} |
|
942 |
||
943 |
||
944 |
||
945 |
||
946 |
/** |
|
947 |
Sets whether the file is corrupt. |
|
948 |
||
949 |
@param aFileCorrupt ETrue, if the file is corrupt; EFalse, otherwise. |
|
950 |
*/ |
|
951 |
inline void CFileCB::SetFileCorrupt(TBool aFileCorrupt) |
|
952 |
{iFileCorrupt=aFileCorrupt;} |
|
953 |
||
954 |
||
955 |
||
956 |
||
957 |
/** |
|
958 |
Gets the iBadPower value. |
|
959 |
||
960 |
@return The value of iBadPower |
|
961 |
||
962 |
@see CFileCB::iBadPower |
|
963 |
*/ |
|
964 |
inline TBool CFileCB::BadPower() const |
|
965 |
{return (iBadPower);} |
|
966 |
||
967 |
||
968 |
||
969 |
||
970 |
/** |
|
971 |
Sets the iBadPower value. |
|
972 |
||
973 |
@param aBadPower ETrue, if an operation on the file has failed due |
|
974 |
to bad power; |
|
975 |
EFalse if power has been found to be good. |
|
976 |
||
977 |
@see CFileCB::iBadPower |
|
978 |
*/ |
|
979 |
inline void CFileCB::SetBadPower(TBool aBadPower) |
|
980 |
{iBadPower=aBadPower;} |
|
981 |
||
982 |
||
983 |
/** |
|
984 |
Retrieves the BlockMap of a file. |
|
985 |
||
986 |
@param aInfo |
|
987 |
||
988 |
@param aStartPos |
|
989 |
||
990 |
@param aEndPos |
|
991 |
||
992 |
@return |
|
993 |
*/ |
|
994 |
inline TInt CFileCB::BlockMap(SBlockMapInfo& aInfo, TInt64& aStartPos, TInt64 aEndPos) |
|
995 |
{ |
|
996 |
TAny* pM; |
|
997 |
TInt r = GetInterface(EBlockMapInterface, pM, (TAny*) this); |
|
998 |
if (KErrNone!=r) |
|
999 |
return r; |
|
1000 |
return reinterpret_cast<CFileCB::MBlockMapInterface*>(pM)->BlockMap(aInfo, aStartPos, aEndPos); |
|
1001 |
} |
|
1002 |
||
1003 |
||
1004 |
/** |
|
1005 |
Retrieves TBusLocalDrive object associated with an open file. |
|
1006 |
*/ |
|
1007 |
inline TInt CFileCB::LocalDrive(TBusLocalDrive*& aLocalDrive) |
|
1008 |
{ |
|
1009 |
aLocalDrive = NULL; |
|
1010 |
return GetInterface(EGetLocalDrive, (TAny*&) aLocalDrive, NULL); |
|
1011 |
} |
|
1012 |
||
1013 |
//--------------------------------------------------------------------------------------------------------------------------------- |
|
1014 |
// Class RLocalMessage |
|
1015 |
inline RLocalMessage::RLocalMessage() |
|
1016 |
{InitHandle();} |
|
1017 |
||
1018 |
inline void RLocalMessage::InitHandle() |
|
1019 |
{iHandle = KLocalMessageHandle; iFunction=-1;} |
|
1020 |
||
1021 |
inline void RLocalMessage::SetFunction(TInt aFunction) |
|
1022 |
{iFunction = aFunction;} |
|
1023 |
||
1024 |
inline void RLocalMessage::SetArgs(TIpcArgs& aArgs) |
|
1025 |
{ |
|
1026 |
iArgs[0] = aArgs.iArgs[0]; |
|
1027 |
iArgs[1] = aArgs.iArgs[1]; |
|
1028 |
iArgs[2] = aArgs.iArgs[2]; |
|
1029 |
iArgs[3] = aArgs.iArgs[3]; |
|
1030 |
||
1031 |
} |
|
1032 |
||
1033 |
inline TInt RLocalMessage::Arg(TInt aIndex) const |
|
1034 |
{return iArgs[aIndex];} |
|
1035 |
||
1036 |
//--------------------------------------------------------------------------------------------------------------------------------- |
|
1037 |
// Class CFileShare |
|
1038 |
/** |
|
1039 |
Gets a reference to the object representing an open file that is being shared. |
|
1040 |
||
1041 |
@return A reference to the shared file. |
|
1042 |
*/ |
|
1043 |
inline CFileCB& CFileShare::File() |
|
1044 |
{return(*iFile);} |
|
1045 |
||
1046 |
||
1047 |
// Returns ETrue if the file share mode is EFileBifFile |
|
1048 |
// indicating large file access for the file share |
|
1049 |
inline TBool CFileShare::IsFileModeBig() |
|
1050 |
{ |
|
1051 |
return (iMode & EFileBigFile) ? (TBool)ETrue:(TBool)EFalse; |
|
1052 |
} |
|
1053 |
||
1054 |
||
1055 |
//--------------------------------------------------------------------------------------------------------------------------------- |
|
1056 |
// Class CDirCB |
|
1057 |
||
1058 |
/** |
|
1059 |
Gets a reference to the object representing the drive on which |
|
1060 |
the directory resides. |
|
1061 |
||
1062 |
@return A reference to the directory's drive. |
|
1063 |
*/ |
|
1064 |
inline TDrive& CDirCB::Drive() const |
|
1065 |
{return(*iDrive);} |
|
1066 |
||
1067 |
||
1068 |
||
1069 |
||
1070 |
/** |
|
1071 |
Gets a reference to the object representing the mount on which |
|
1072 |
the directory resides. |
|
1073 |
||
1074 |
@return A reference to the directory's mount. |
|
1075 |
*/ |
|
1076 |
inline CMountCB& CDirCB::Mount() const |
|
1077 |
{return(*iMount);} |
|
1078 |
||
1079 |
||
1080 |
||
1081 |
||
1082 |
/** |
|
1083 |
Tests whether the preceding entry details should be returned when |
|
1084 |
multiple entries are being read. |
|
1085 |
||
1086 |
@return True if the preceding entry details should be returned; |
|
1087 |
false otherwise. |
|
1088 |
*/ |
|
1089 |
inline TBool CDirCB::Pending() const |
|
1090 |
{return iPending;} |
|
1091 |
||
1092 |
||
1093 |
||
1094 |
||
1095 |
/** |
|
1096 |
Sets whether the preceding entry details should be returned when |
|
1097 |
multiple entries are being read. |
|
1098 |
||
1099 |
@param aPending ETrue if the preceding entry details should be returned; |
|
1100 |
EFalse otherwise. |
|
1101 |
*/ |
|
1102 |
inline void CDirCB::SetPending(TBool aPending) |
|
1103 |
{iPending=aPending;} |
|
1104 |
||
1105 |
||
1106 |
||
1107 |
//--------------------------------------------------------------------------------------------------------------------------------- |
|
1108 |
// class CFormatCB |
|
1109 |
||
1110 |
/** |
|
1111 |
Gets the object representing the drive on which the disk to |
|
1112 |
be formatted resides. |
|
1113 |
||
1114 |
@return The drive for the format action. |
|
1115 |
*/ |
|
1116 |
inline TDrive& CFormatCB::Drive() const |
|
1117 |
{return(*iDrive);} |
|
1118 |
||
1119 |
||
1120 |
||
1121 |
||
1122 |
/** |
|
1123 |
Gets the object representing the mount on which the disk to |
|
1124 |
be formatted resides. |
|
1125 |
||
1126 |
@return The mount for the format action. |
|
1127 |
*/ |
|
1128 |
inline CMountCB& CFormatCB::Mount() const |
|
1129 |
{return(*iMount);} |
|
1130 |
||
1131 |
||
1132 |
||
1133 |
||
1134 |
/** |
|
1135 |
Gets the mode of the format operation. |
|
1136 |
||
1137 |
@return The value of the format mode. |
|
1138 |
*/ |
|
1139 |
inline TFormatMode CFormatCB::Mode() const |
|
1140 |
{return(iMode);} |
|
1141 |
||
1142 |
||
1143 |
||
1144 |
||
1145 |
/** |
|
1146 |
Gets the current stage in the format operation. |
|
1147 |
||
1148 |
@return The stage the current format operation has reached. |
|
1149 |
*/ |
|
1150 |
inline TInt& CFormatCB::CurrentStep() |
|
1151 |
{return(iCurrentStep);} |
|
1152 |
||
1153 |
||
1154 |
||
1155 |
//--------------------------------------------------------------------------------------------------------------------------------- |
|
1156 |
// class CRawDiskCB |
|
1157 |
||
1158 |
/** |
|
1159 |
Gets a reference to an object representing the drive on which the disk resides. |
|
1160 |
||
1161 |
@return A reference to the drive on which the disk resides. |
|
1162 |
*/ |
|
1163 |
inline TDrive& CRawDiskCB::Drive() |
|
1164 |
{return(iMount->Drive());} |
|
1165 |
||
1166 |
||
1167 |
||
1168 |
||
1169 |
/** |
|
1170 |
Gets an object representing the mount on which the disk resides. |
|
1171 |
||
1172 |
@return The mount on which the disk resides. |
|
1173 |
*/ |
|
1174 |
inline CMountCB& CRawDiskCB::Mount() |
|
1175 |
{return(*iMount);} |
|
1176 |
||
1177 |
||
1178 |
||
1179 |
||
1180 |
/** |
|
1181 |
Tests whether the mount on which the disk resides is write protected. |
|
1182 |
||
1183 |
@return True if the mount is write protected, false otherwise. |
|
1184 |
*/ |
|
1185 |
inline TBool CRawDiskCB::IsWriteProtected() const |
|
1186 |
{ return(iFlags & EWriteProtected); } |
|
1187 |
||
1188 |
||
1189 |
||
1190 |
||
1191 |
||
1192 |
/** |
|
1193 |
Stores the write protected state of the disk. |
|
1194 |
*/ |
|
1195 |
inline void CRawDiskCB::SetWriteProtected() |
|
1196 |
{ iFlags |= EWriteProtected; } |
|
1197 |
||
1198 |
||
1199 |
||
1200 |
||
1201 |
/** |
|
1202 |
Tests whether the disk contents has changed (due to a write operation) |
|
1203 |
||
1204 |
@return True if the disk contents has changed |
|
1205 |
*/ |
|
1206 |
inline TBool CRawDiskCB::IsChanged() const |
|
1207 |
{ return(iFlags & EChanged); } |
|
1208 |
||
1209 |
||
1210 |
||
1211 |
||
1212 |
/** |
|
1213 |
Set a flag to state that the disk contents has changed (due to a write operation) |
|
1214 |
*/ |
|
1215 |
inline void CRawDiskCB::SetChanged() |
|
1216 |
{ iFlags |= EChanged; } |
|
1217 |
||
1218 |
||
1219 |
||
1220 |
//--------------------------------------------------------------------------------------------------------------------------------- |
|
1221 |
// class CProxyDriveFactory |
|
1222 |
/** |
|
1223 |
Sets the Library (DLL) handle to be used by the CProxyDriveFactory |
|
1224 |
*/ |
|
1225 |
inline void CProxyDriveFactory::SetLibrary(RLibrary aLib) |
|
1226 |
{iLibrary=aLib;} |
|
1227 |
/** |
|
1228 |
Gets the Library (DLL) handle in use by the CProxyDriveFactory |
|
1229 |
@return Library (DLL) handle |
|
1230 |
*/ |
|
1231 |
inline RLibrary CProxyDriveFactory::Library() const |
|
1232 |
{return(iLibrary);} |
|
1233 |
||
1234 |
||
1235 |
inline void CExtProxyDriveFactory::SetLibrary(RLibrary aLib) |
|
1236 |
{iLibrary=aLib;} |
|
1237 |
||
1238 |
inline RLibrary CExtProxyDriveFactory::Library() const |
|
1239 |
{return(iLibrary);} |
|
1240 |
||
1241 |
||
1242 |
//--------------------------------------------------------------------------------------------------------------------------------- |
|
1243 |
// class CProxyDrive |
|
1244 |
/** |
|
1245 |
Gets the mount control block object for a specific volume on a drive. |
|
1246 |
||
1247 |
@return either a currently mounted volume in the system or the volume that has been removed but still has |
|
1248 |
subsession objects open. |
|
1249 |
*/ |
|
1250 |
inline CMountCB* CProxyDrive::Mount() const |
|
1251 |
{return(iMount);} |
|
1252 |
||
1253 |
inline void CProxyDrive::SetMount(CMountCB *aMount) |
|
1254 |
{ |
|
1255 |
iMount = aMount; |
|
1256 |
} |
|
1257 |
||
1258 |
/** |
|
1259 |
Returns wheher the drive (and any extensions) support file caching |
|
1260 |
*/ |
|
1261 |
inline TInt CProxyDrive::LocalBufferSupport() |
|
1262 |
{ |
|
1263 |
TAny* dummyInterface; |
|
1264 |
return GetInterface(ELocalBufferSupport, dummyInterface, NULL); |
|
1265 |
} |
|
1266 |
||
1267 |
/** |
|
1268 |
return whether proxy drive supports file caching |
|
1269 |
*/ |
|
1270 |
inline TInt CBaseExtProxyDrive::LocalBufferSupport() |
|
1271 |
{ |
|
1272 |
return iProxy->LocalBufferSupport(); |
|
1273 |
} |
|
1274 |
||
1275 |
//--------------------------------------------------------------------------------------------------------------------------------- |
|
1276 |
// Surrogate Pair hepler apis |
|
1277 |
/** |
|
1278 |
Determines if aChar is the outsite BMP. |
|
1279 |
||
1280 |
@param aChar character to checked if that is outside BMP. |
|
1281 |
@return ETrue if outside BMP, EFalse otherwise. |
|
1282 |
*/ |
|
1283 |
inline TBool IsSupplementary(TUint aChar) |
|
1284 |
{ |
|
1285 |
return (aChar > 0xFFFF); |
|
1286 |
} |
|
1287 |
||
1288 |
/** |
|
1289 |
Determines if aInt16 is a high surrogate. |
|
1290 |
||
1291 |
@param aInt16 character to checked if that is high surrogate. |
|
1292 |
@return ETrue if high surrogate, EFalse otherwise. |
|
1293 |
*/ |
|
1294 |
inline TBool IsHighSurrogate(TText16 aInt16) |
|
1295 |
{ |
|
1296 |
return (aInt16 & 0xFC00) == 0xD800; |
|
1297 |
} |
|
1298 |
||
1299 |
/** |
|
1300 |
Determines if aInt16 is a low surrogate. |
|
1301 |
||
1302 |
@param aInt16 character to checked if that is low surrogate. |
|
1303 |
@return ETrue if low surrogate, EFalse otherwise. |
|
1304 |
*/ |
|
1305 |
inline TBool IsLowSurrogate(TText16 aInt16) |
|
1306 |
{ |
|
1307 |
return (aInt16 & 0xFC00) == 0xDC00; |
|
1308 |
} |
|
1309 |
||
1310 |
/** |
|
1311 |
Joins high surrogate character aHighSurrogate and low surrogate character aLowSurrogate. |
|
1312 |
||
1313 |
@param aHighSurrogate a high surrogate character to be joined. |
|
1314 |
@param aLowSurrogate a low surrogate character to be joined. |
|
1315 |
@return joined character that is outside BMP. |
|
1316 |
*/ |
|
1317 |
inline TUint JoinSurrogate(TText16 aHighSurrogate, TText16 aLowSurrogate) |
|
1318 |
{ |
|
1319 |
return ((aHighSurrogate - 0xD7F7) << 10) + aLowSurrogate; |
|
1320 |
} |
|
1321 |
||
1322 |
//--------------------------------------------------------------------------------------------------------------------------------- |
|
1323 |
// class CExtProxyDrive |
|
1324 |
inline TInt CExtProxyDrive::DriveNumber() |
|
1325 |
{return iDriveNumber;}; |
|
1326 |
inline void CExtProxyDrive::SetDriveNumber(TInt aDrive) |
|
1327 |
{iDriveNumber = aDrive;}; |
|
1328 |
inline CExtProxyDriveFactory* CExtProxyDrive::FactoryP() |
|
1329 |
{return iFactory;}; |
|
1330 |
||
1331 |
//--------------------------------------------------------------------------------------------------------------------------------- |
|
1332 |
// class CLocDrvMountCB |
|
1333 |
/** |
|
1334 |
Gets the mounted local drive object |
|
1335 |
||
1336 |
@return The local drive. |
|
1337 |
*/ |
|
1338 |
inline CProxyDrive* CLocDrvMountCB::LocalDrive() const |
|
1339 |
{return(iProxyDrive);} |
|
1340 |
||
1341 |
//--------------------------------------------------------------------------------------------------------------------------------- |
|
1342 |
// class CFsObject |
|
1343 |
inline CFsObjectCon* CFsObject::Container() const |
|
1344 |
{ return iContainer; } |
|
1345 |
inline TInt CFsObject::Inc() |
|
1346 |
{ return __e32_atomic_tas_ord32(&iAccessCount, 1, 1, 0); } |
|
1347 |
inline TInt CFsObject::Dec() |
|
1348 |
{ return __e32_atomic_tas_ord32(&iAccessCount, 1, -1, 0); } |
|
1349 |
||
1350 |