1.1 --- a/epoc32/include/f32fsys.inl Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/f32fsys.inl Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,1150 @@
1.4 -f32fsys.inl
1.5 +// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// 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
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +// f32\inc\f32fsys.inl
1.19 +//
1.20 +//
1.21 +
1.22 +#define __IS_DRIVETHREAD() {__ASSERT_DEBUG(IsDriveThread(),DriveFault(ETrue));}
1.23 +#define __IS_MAINTHREAD() {__ASSERT_DEBUG(IsMainThread(),DriveFault(EFalse));}
1.24 +
1.25 +
1.26 +//---------------------------------------------------------------------------------------------------------------------------------
1.27 +// Class TDrive
1.28 +
1.29 +/**
1.30 +Gets last error reason.
1.31 +
1.32 +@return TInt Returns last error reason.
1.33 +*/
1.34 +inline TInt TDrive::GetReason() const
1.35 + {
1.36 + __IS_DRIVETHREAD();
1.37 + return(iReason);
1.38 + }
1.39 +
1.40 +
1.41 +
1.42 +/**
1.43 +Sets a flag to state that the drive contents has changed.
1.44 +
1.45 +@param aValue True if contents has changed; False if unchanged.
1.46 +*/
1.47 +inline void TDrive::SetChanged(TBool aValue)
1.48 + {
1.49 +// __IS_DRIVETHREAD();//scan drive running in new thread
1.50 + iChanged=aValue;
1.51 + }
1.52 +
1.53 +
1.54 +
1.55 +
1.56 +/**
1.57 +Determines whether the drive content has changed.
1.58 +
1.59 +@return True if contents changed , False if unchanged.
1.60 +*/
1.61 +inline TBool TDrive::IsChanged() const
1.62 + {
1.63 +// __IS_DRIVETHREAD();
1.64 + return(iChanged);
1.65 + }
1.66 +
1.67 +
1.68 +
1.69 +
1.70 +/**
1.71 +Returns the drive number.
1.72 +
1.73 +@return The drive number.
1.74 +
1.75 +@see TDriveNumber
1.76 +*/
1.77 +inline TInt TDrive::DriveNumber() const
1.78 + {return(iDriveNumber);}
1.79 +
1.80 +
1.81 +
1.82 +
1.83 +/**
1.84 +Determines whether the drive is mounted.
1.85 +
1.86 +@return True if drive is mounted, False if drive is not mounted.
1.87 +*/
1.88 +inline TBool TDrive::IsMounted() const
1.89 + {
1.90 + __IS_DRIVETHREAD();
1.91 + return(iCurrentMount!=NULL);
1.92 + }
1.93 +
1.94 +
1.95 +
1.96 +
1.97 +/**
1.98 +Determines whether attribute is set to local.
1.99 +
1.100 +@return True if attribute is set to KDriveAttLocal, False for all other attributes.
1.101 +*/
1.102 +inline TBool TDrive::IsLocal() const
1.103 + {return(iAtt & KDriveAttLocal);}
1.104 +
1.105 +
1.106 +
1.107 +
1.108 +/**
1.109 +Determines whether the drive is ROM drive.
1.110 +
1.111 +@return True if drive attribute is set as ROM drive , False if not set as ROM drive.
1.112 +*/
1.113 +inline TBool TDrive::IsRom() const
1.114 + {return( iAtt & KDriveAttRom);}
1.115 +
1.116 +
1.117 +
1.118 +
1.119 +/**
1.120 +Determines whether the drive is removable.
1.121 +
1.122 +@return True if drive attribute is set to removable , False for all other attributes.
1.123 +*/
1.124 +inline TBool TDrive::IsRemovable() const
1.125 + {return( iAtt & KDriveAttRemovable);}
1.126 +
1.127 +
1.128 +
1.129 +
1.130 +/**
1.131 +Determines whether the drive is substed.
1.132 +
1.133 +@return True if drive attribute is set to substed (KDriveAttSubsted), False for all other attributes.
1.134 +*/
1.135 +inline TBool TDrive::IsSubsted() const
1.136 + {return( iAtt & KDriveAttSubsted);}// KDriveAttSubsted = 0x08
1.137 +
1.138 +
1.139 +
1.140 +
1.141 +/**
1.142 +Gets a reference to the object representing the current mount.
1.143 +
1.144 +@return The file's mount.
1.145 +*/
1.146 +inline CMountCB& TDrive::CurrentMount() const
1.147 + {
1.148 + __IS_DRIVETHREAD();
1.149 + return(*iCurrentMount);
1.150 + }
1.151 +
1.152 +
1.153 +
1.154 +
1.155 +/**
1.156 +Gets the substed drive.
1.157 +
1.158 +@return A pointer to the drive which is substed.
1.159 +*/
1.160 +inline TDrive& TDrive::SubstedDrive()const
1.161 + {
1.162 + __IS_MAINTHREAD();
1.163 + return(*iSubstedDrive);
1.164 + }
1.165 +
1.166 +
1.167 +
1.168 +
1.169 +/**
1.170 +
1.171 +Sets the drive as substed to the path set by an earlier call to SetSubst().
1.172 +
1.173 +@param aDrive A pointer to the drive on which the volume is mounted.
1.174 +
1.175 +*/
1.176 +inline void TDrive::SetSubstedDrive(TDrive* aDrive)
1.177 + {
1.178 + __IS_MAINTHREAD();
1.179 + iSubstedDrive=aDrive;
1.180 + }
1.181 +
1.182 +
1.183 +
1.184 +
1.185 +/**
1.186 +Gets the substed path set by an earlier call to SetSubst().
1.187 +
1.188 +@return A reference to a heap descriptor containing the substed path.
1.189 +*/
1.190 +inline HBufC& TDrive::Subst() const
1.191 + {
1.192 + __IS_MAINTHREAD();
1.193 + return(*iSubst);
1.194 + }
1.195 +
1.196 +
1.197 +
1.198 +
1.199 +/**
1.200 +Assigns a path to a drive.
1.201 +
1.202 +@param aSubst Path will be assigned to a drive.
1.203 +
1.204 +*/
1.205 +inline void TDrive::SetSubst(HBufC* aSubst)
1.206 + {
1.207 + __IS_MAINTHREAD();
1.208 + iSubst=aSubst;
1.209 + }
1.210 +
1.211 +
1.212 +
1.213 +/**
1.214 +
1.215 +Gets a reference to the object representing the mount on which the file resides.
1.216 +
1.217 +@return The Drives's mount.
1.218 +
1.219 +*/
1.220 +inline CFsObjectCon& TDrive::Mount() const
1.221 + {return(*iMount);}
1.222 +/**
1.223 +
1.224 +Gets a reference to the object representing the file system
1.225 +
1.226 +@return The reference to file system.
1.227 +
1.228 +*/
1.229 +inline CFileSystem& TDrive::FSys()
1.230 + {return(*iFSys);}
1.231 +/**
1.232 +
1.233 +Gets the object representing the file system
1.234 +
1.235 +@return The file system.
1.236 +
1.237 +*/
1.238 +inline CFileSystem*& TDrive::GetFSys()
1.239 + {return(iFSys);}
1.240 +/**
1.241 +
1.242 +Gets the object representing the TDriveExtInfo.
1.243 +
1.244 +@return The Drive extension information object.
1.245 +
1.246 +@see TDriveExtInfo
1.247 +
1.248 +*/
1.249 +inline TDriveExtInfo& TDrive::ExtInfo()
1.250 + {
1.251 + __IS_DRIVETHREAD();
1.252 + return(iExtInfo);
1.253 + }
1.254 +/**
1.255 +Sets the notification flag ON. The client will receive notifications on Read or Write
1.256 +failures from the file system.
1.257 +
1.258 +*/
1.259 +inline void TDrive::SetNotifyOn()
1.260 + {
1.261 + __IS_DRIVETHREAD();
1.262 + iDriveFlags &= ~ENotifyOff;
1.263 + }
1.264 +/**
1.265 +Sets the notification flag OFF. The client will not receive notifications on Read or Write
1.266 +failures from the file system.
1.267 +
1.268 +*/
1.269 +inline void TDrive::SetNotifyOff()
1.270 + {
1.271 + __IS_DRIVETHREAD();
1.272 + iDriveFlags |= ENotifyOff;
1.273 + }
1.274 +/**
1.275 +
1.276 +Locks the drive.This function acquires iLock mutex.
1.277 +
1.278 +*/
1.279 +inline void TDrive::Lock()
1.280 + {iLock.Wait();}
1.281 +/**
1.282 +
1.283 +UnLocks the drive.This function signals the iLock mutex.
1.284 +
1.285 +*/
1.286 +
1.287 +inline void TDrive::UnLock()
1.288 + {iLock.Signal();}
1.289 +
1.290 +
1.291 +/**
1.292 +
1.293 +Gets the reserved space of a drive
1.294 +
1.295 +@return Amount of space reserved in bytes.
1.296 +
1.297 +*/
1.298 +
1.299 +inline TInt TDrive::ReservedSpace() const
1.300 + {return iReservedSpace;}
1.301 +
1.302 +/**
1.303 +
1.304 +Reserves a space of a drive.
1.305 +
1.306 +@param aReservedSpace Amount of space to reserve in bytes.
1.307 +
1.308 +*/
1.309 +inline void TDrive::SetReservedSpace(const TInt aReservedSpace)
1.310 + {iReservedSpace=aReservedSpace; }
1.311 +
1.312 +/**
1.313 +
1.314 +Sets the rugged flag in the drive object.
1.315 +
1.316 +@param Flag to set or clear the rugged flag.
1.317 +@see IsRugged()
1.318 +
1.319 +*/
1.320 +
1.321 +inline void TDrive::SetRugged(TBool aIsRugged)
1.322 + {
1.323 + if (!aIsRugged)
1.324 + iDriveFlags |= ENotRugged;
1.325 + else
1.326 + iDriveFlags &= ~ENotRugged;
1.327 + }
1.328 +
1.329 +/**
1.330 +
1.331 +Returns whether the current drive is running as rugged Fat
1.332 +or not.If IsRugged flag is set then in the event of power
1.333 +failure fat/metadata will be in a valid state if the scandrive
1.334 +utility is run immediately after.
1.335 +
1.336 +@return Is rugged fat flag.
1.337 +*/
1.338 +
1.339 +inline TBool TDrive::IsRugged() const
1.340 + {return !(iDriveFlags & ENotRugged); }
1.341 +
1.342 +
1.343 +/**
1.344 + @return ETrue if the drive is synchronous, i.e. runs in the main file server thread.
1.345 +*/
1.346 +inline TBool TDrive::IsSynchronous() const
1.347 +{
1.348 + return iDriveFlags & EDriveIsSynch;
1.349 +}
1.350 +
1.351 +/**
1.352 + Set or reset internal EDriveIsSynch flag for the TDrive.
1.353 +*/
1.354 +inline void TDrive::SetSynchronous(TBool aIsSynch)
1.355 +{
1.356 + if(aIsSynch)
1.357 + iDriveFlags |= EDriveIsSynch;
1.358 + else
1.359 + iDriveFlags &= ~EDriveIsSynch;
1.360 +
1.361 +}
1.362 +
1.363 +
1.364 +// Class CMountCB
1.365 +
1.366 +/**
1.367 +Gets a reference to the object representing the drive on which
1.368 +the volume is mounted.
1.369 +
1.370 +@return The drive on which the volume is mounted.
1.371 +*/
1.372 +inline TDrive& CMountCB::Drive() const
1.373 + {return(*iDrive);}
1.374 +
1.375 +
1.376 +
1.377 +
1.378 +/**
1.379 +Sets a pointer to the object representing the drive on which
1.380 +the volume is mounted.
1.381 +
1.382 +@param aDrive A pointer to the drive on which the volume is mounted.
1.383 +*/
1.384 +inline void CMountCB::SetDrive(TDrive* aDrive)
1.385 + {iDrive=aDrive;}
1.386 +
1.387 +
1.388 +
1.389 +
1.390 +/**
1.391 +Gets a reference to a heap descriptor containing the name of
1.392 +the mounted volume.
1.393 +
1.394 +@return A reference to a heap descriptor containing the volume name.
1.395 +*/
1.396 +inline HBufC& CMountCB::VolumeName() const
1.397 + {return(*iVolumeName);}
1.398 +
1.399 +
1.400 +
1.401 +
1.402 +/**
1.403 +Sets a pointer to a heap descriptor containing the name of the mounted volume.
1.404 +
1.405 +@param aName A pointer to a heap descriptor containing the name of
1.406 + the mounted volume to be set.
1.407 +*/
1.408 +inline void CMountCB::SetVolumeName(HBufC* aName)
1.409 + {iVolumeName=aName;}
1.410 +
1.411 +
1.412 +
1.413 +
1.414 +/**
1.415 +Tests whether the client is notified of any read or write failures.
1.416 +
1.417 +The notification status is a property of the current session with
1.418 +the file server, the value of which is stored in CSessionFs::iNotifyUser.
1.419 +If set to true, the client will receive notifications from the file system.
1.420 +
1.421 +Typically, this function might be used to save the current notification
1.422 +state prior to temporarily disabling notifiers. This allows the original
1.423 +notification state to be restored.
1.424 +
1.425 +Note that GetNotifyUser() is only available once the drive has been set for
1.426 +the mount control block (using SetDrive()), since the notification status
1.427 +is held by the session and accessed via the drive.
1.428 +
1.429 +@return True if the client receives notifications from the file system,
1.430 + false otherwise.
1.431 +*/
1.432 +inline TBool CMountCB::GetNotifyUser() const
1.433 + {return(Drive().GetNotifyUser());}
1.434 +
1.435 +
1.436 +
1.437 +
1.438 +/**
1.439 +*/
1.440 +inline void CMountCB::SetNotifyOn()
1.441 + {Drive().SetNotifyOn();}
1.442 +
1.443 +
1.444 +
1.445 +
1.446 +/**
1.447 +*/
1.448 +inline void CMountCB::SetNotifyOff()
1.449 + {Drive().SetNotifyOff();}
1.450 +
1.451 +
1.452 +
1.453 +
1.454 +/**
1.455 +Locks the mount by incrementing the internal lock counter.
1.456 +
1.457 +The mount becomes locked on formatting or on the opening of a resource
1.458 +(a file or a directory) or raw disk subsession.
1.459 +A format, resource or raw disk subsession can only be opened if the mount
1.460 +is not locked.
1.461 +*/
1.462 +inline void CMountCB::IncLock()
1.463 + {iLockMount++;}
1.464 +
1.465 +
1.466 +
1.467 +
1.468 +/**
1.469 +Unlocks the mount by decrementing the internal lock counter.
1.470 +
1.471 +The mount becomes locked on formatting or on the opening of a resource
1.472 +(a file or a directory) or raw disk subsession.
1.473 +A format, resource or raw disk subsession can only be opened if the mount
1.474 +is not locked.
1.475 +*/
1.476 +inline void CMountCB::DecLock()
1.477 + {iLockMount--;}
1.478 +
1.479 +
1.480 +
1.481 +
1.482 +/**
1.483 +Gets the current lock status.
1.484 +
1.485 +It delivers the current lock status by returning the internal lock counter.
1.486 +
1.487 +@return The current lock status.
1.488 +*/
1.489 +inline TInt CMountCB::LockStatus() const
1.490 + {return(iLockMount);}
1.491 +
1.492 +
1.493 +
1.494 +
1.495 +/**
1.496 +Tests whether the mount is currently locked.
1.497 +
1.498 +A mount is locked when the internal lock counter is greater than zero.
1.499 +On creation, the lock counter is set to zero.
1.500 +
1.501 +The mount becomes locked on formatting or on the opening of a resource
1.502 +(a file or a directory) or raw disk subsession.
1.503 +A format, resource or raw disk subsession can only be opened if the mount
1.504 +is not locked.
1.505 +
1.506 +@return True if the mount is locked, false, otherwise.
1.507 +*/
1.508 +inline TBool CMountCB::Locked() const
1.509 + {return iLockMount>0; }
1.510 +
1.511 +
1.512 +
1.513 +
1.514 +/**
1.515 +Tests whether the mount control block represents the current mount on
1.516 +the associated drive.
1.517 +
1.518 +A drive has only one mount which is accessible: the current mount.
1.519 +Any mount other than the current mount relates to a partition (i.e. volume)
1.520 +that was present on a removable media which has since been removed.
1.521 +The reason the mount has persisted is because resources (i.e. files/directories)
1.522 +are still open on it.
1.523 +
1.524 +This function is only available when the drive has been set for the mount
1.525 +control block (using SetDrive()), since the current mount is held by the drive.
1.526 +
1.527 +@return True if the mount is the current mount on the drive, false otherwise.
1.528 +*/
1.529 +inline TBool CMountCB::IsCurrentMount() const
1.530 + {return(this==&iDrive->CurrentMount());}
1.531 +
1.532 +
1.533 +
1.534 +
1.535 +/**
1.536 +*/
1.537 +inline TInt64 CMountCB::Size() const
1.538 + {return(iSize);}
1.539 +
1.540 +
1.541 +
1.542 +
1.543 +/**
1.544 +Set the unique mount number
1.545 +@param aMountNumber - The unique mount number
1.546 +*/
1.547 +const TInt KMountDismounted = 0x80000000;
1.548 +inline void CMountCB::SetMountNumber(TInt aMountNumber)
1.549 + { iMountNumber = (aMountNumber &~ KMountDismounted); }
1.550 +
1.551 +
1.552 +
1.553 +
1.554 +/**
1.555 +Set the mount to be dismounted
1.556 +*/
1.557 +inline void CMountCB::SetDismounted(TBool aDismounted)
1.558 + {
1.559 + if(aDismounted)
1.560 + iMountNumber |= KMountDismounted;
1.561 + else
1.562 + iMountNumber &= ~KMountDismounted;
1.563 + }
1.564 +
1.565 +
1.566 +
1.567 +
1.568 +/**
1.569 +Returns the unique mount number
1.570 +@return The unique mount number
1.571 +*/
1.572 +inline TInt CMountCB::MountNumber() const
1.573 + { return(iMountNumber &~ KMountDismounted); }
1.574 +
1.575 +
1.576 +
1.577 +
1.578 +/**
1.579 +Returns ETrue if the mount is flagged as dismounted.
1.580 +@return ETrue if the mount is flagged as dismounted
1.581 +*/
1.582 +inline TBool CMountCB::IsDismounted() const
1.583 + { return(iMountNumber & KMountDismounted); }
1.584 +
1.585 +
1.586 +
1.587 +/**
1.588 +Retrieves TBusLocalDrive object associated with the mount
1.589 +*/
1.590 +inline TInt CMountCB::LocalDrive(TBusLocalDrive*& aLocalDrive)
1.591 + {
1.592 + aLocalDrive = NULL;
1.593 + return GetInterface(EGetLocalDrive, (TAny*&) aLocalDrive, NULL);
1.594 + }
1.595 +
1.596 +inline TInt CMountCB::AddToCompositeMount(TInt aMountIndex)
1.597 + {
1.598 + TAny *mountInterface = NULL;
1.599 + return(GetInterface(EAddToCompositeMount, mountInterface, (TAny*)aMountIndex));
1.600 + }
1.601 +
1.602 +/**
1.603 +Returns whether the mount (and any extensions) support file caching
1.604 +*/
1.605 +inline TInt CMountCB::LocalBufferSupport(CFileCB* aFile)
1.606 + {
1.607 + TAny* dummyInterface;
1.608 + return GetInterface(ELocalBufferSupport, dummyInterface, aFile);
1.609 + }
1.610 +
1.611 +inline TInt CMountCB::MountControl(TInt /*aLevel*/, TInt /*aOption*/, TAny* /*aParam*/)
1.612 + {
1.613 + return KErrNotSupported;
1.614 + }
1.615 +
1.616 +
1.617 +inline void CMountCB::FinaliseMountL(TInt aOperation, TAny* /*aParam1=NULL*/, TAny* /*aParam2=NULL*/)
1.618 + {
1.619 + if(aOperation == RFs::EFinal_RW)
1.620 + {//-- call the legacy method
1.621 + FinaliseMountL();
1.622 + return;
1.623 + }
1.624 +
1.625 + User::Leave(KErrNotSupported);
1.626 + }
1.627 +
1.628 +inline TInt CMountCB::CheckDisk(TInt /*aOperation*/, TAny* /*aParam1=NULL*/, TAny* /*aParam2=NULL*/)
1.629 + {
1.630 + return(KErrNotSupported);
1.631 + }
1.632 +
1.633 +inline TInt CMountCB::ScanDrive(TInt /*aOperation*/, TAny* /*aParam1=NULL*/, TAny* /*aParam2=NULL*/)
1.634 + {
1.635 + return(KErrNotSupported);
1.636 + }
1.637 +
1.638 +//---------------------------------------------------------------------------------------------------------------------------------
1.639 +// Class CFileCB
1.640 +
1.641 +/**
1.642 +Sets the mount associated with the file.
1.643 +
1.644 +@param aMount The mount.
1.645 +*/
1.646 +inline void CFileCB::SetMount(CMountCB * aMount)
1.647 + {iMount=aMount;}
1.648 +
1.649 +/**
1.650 +Gets a reference to the object representing the drive on which
1.651 +the file resides.
1.652 +
1.653 +@return A reference to the file's drive.
1.654 +*/
1.655 +inline TDrive& CFileCB::Drive() const
1.656 + {return(*iDrive);}
1.657 +
1.658 +
1.659 +
1.660 +
1.661 +/**
1.662 +Gets a reference to the object representing the drive on which the file was created.
1.663 +
1.664 +The 'created drive' is only different from the 'drive', as returned by Drive(), if
1.665 +the 'drive' was a substitute for the 'created drive' in the file server session.
1.666 +
1.667 +@return A reference to the drive on which the file was created.
1.668 +*/
1.669 +inline TDrive& CFileCB::CreatedDrive() const
1.670 + {return(*iCreatedDrive);}
1.671 +
1.672 +
1.673 +
1.674 +
1.675 +/**
1.676 +Gets a reference to the object representing the mount on which the file resides.
1.677 +
1.678 +@return The file's mount.
1.679 +*/
1.680 +inline CMountCB& CFileCB::Mount() const
1.681 + {return(*iMount);}
1.682 +
1.683 +
1.684 +
1.685 +
1.686 +/**
1.687 +Gets a reference to a heap descriptor containing the full file name.
1.688 +
1.689 +@return A heap descriptor containing the full file name.
1.690 +*/
1.691 +inline HBufC& CFileCB::FileName() const
1.692 + {return(*iFileName);}
1.693 +
1.694 +/**
1.695 +Gets a reference to a heap descriptor containing the folded full file name.
1.696 +
1.697 +@return A heap descriptor containing the full file name.
1.698 +*/
1.699 +inline HBufC& CFileCB::FileNameF() const
1.700 + {return(*iFileNameF);}
1.701 +
1.702 +/**
1.703 +Gets the hash of the folded filename
1.704 +
1.705 +@return hash of the folded file name
1.706 +*/
1.707 +inline TUint32 CFileCB::NameHash() const
1.708 + {return(iNameHash);}
1.709 +
1.710 +
1.711 +/**
1.712 +Gets a reference to the file share lock being used by the file.
1.713 +
1.714 +@return The file share lock.
1.715 +*/
1.716 +inline RArray<SFileShareLock>& CFileCB::Lock()
1.717 + {return(*iLock);}
1.718 +
1.719 +
1.720 +
1.721 +
1.722 +/**
1.723 +Gets the file object's unique ID, as returned by CObject::UniqueID().
1.724 +
1.725 +@return The object's unique ID.
1.726 +
1.727 +@see CObject
1.728 +*/
1.729 +inline TInt CFileCB::UniqueID() const
1.730 + {return(CFsObject::UniqueID());}
1.731 +
1.732 +
1.733 +
1.734 +
1.735 +/**
1.736 +Gets the iShare value, which defines the level of access allowed to the file.
1.737 +
1.738 +@return The value of iShare
1.739 +
1.740 +@see CFileCB::iShare
1.741 +*/
1.742 +inline TShare CFileCB::Share() const
1.743 + {return(iShare);}
1.744 +
1.745 +
1.746 +
1.747 +
1.748 +/**
1.749 +Sets the iShare value, which defines the level of access allowed to the file.
1.750 +
1.751 +@param aShare The new value.
1.752 +
1.753 +@see CFileCB::iShare
1.754 +*/
1.755 +inline void CFileCB::SetShare(TShare aShare)
1.756 + {iShare=aShare;}
1.757 +
1.758 +
1.759 +
1.760 +
1.761 +/**
1.762 +Gets the size of the file.
1.763 +
1.764 +@return The size of the file.
1.765 +*/
1.766 +inline TInt CFileCB::Size() const
1.767 + {return(iSize);}
1.768 +
1.769 +
1.770 +
1.771 +
1.772 +/**
1.773 +Sets the size of the file.
1.774 +
1.775 +@param aSize The size of the file.
1.776 +*/
1.777 +inline void CFileCB::SetSize(TInt aSize)
1.778 + {iSize=aSize;}
1.779 +
1.780 +
1.781 +
1.782 +
1.783 +/**
1.784 +Gets the file's attributes.
1.785 +
1.786 +@return An integer containing the file attribute bit mask.
1.787 +*/
1.788 +inline TInt CFileCB::Att() const
1.789 + {return(iAtt);}
1.790 +
1.791 +
1.792 +
1.793 +
1.794 +/**
1.795 +Sets the file's attributes.
1.796 +
1.797 +@param aAtt The file attribute bit mask.
1.798 +*/
1.799 +inline void CFileCB::SetAtt(TInt aAtt)
1.800 + {iAtt=aAtt;}
1.801 +
1.802 +
1.803 +
1.804 +
1.805 +/**
1.806 +Gets the universal time when the file was last modified.
1.807 +
1.808 +@return The universal time when the file was last modiified.
1.809 +*/
1.810 +inline TTime CFileCB::Modified() const
1.811 + {return(iModified);}
1.812 +
1.813 +
1.814 +
1.815 +
1.816 +/**
1.817 +Sets the universal time when the file was last modified.
1.818 +
1.819 +@param aModified The universal time when the file was last modified.
1.820 +*/
1.821 +inline void CFileCB::SetModified(TTime aModified)
1.822 + {iModified=aModified;}
1.823 +
1.824 +
1.825 +
1.826 +
1.827 +/**
1.828 +Tests whether the file is corrupt.
1.829 +
1.830 +@return ETrue if the file is corrupt; EFalse otherwise.
1.831 +*/
1.832 +inline TBool CFileCB::FileCorrupt() const
1.833 + {return iFileCorrupt;}
1.834 +
1.835 +
1.836 +
1.837 +
1.838 +/**
1.839 +Sets whether the file is corrupt.
1.840 +
1.841 +@param aFileCorrupt ETrue, if the file is corrupt; EFalse, otherwise.
1.842 +*/
1.843 +inline void CFileCB::SetFileCorrupt(TBool aFileCorrupt)
1.844 + {iFileCorrupt=aFileCorrupt;}
1.845 +
1.846 +
1.847 +
1.848 +
1.849 +/**
1.850 +Gets the iBadPower value.
1.851 +
1.852 +@return The value of iBadPower
1.853 +
1.854 +@see CFileCB::iBadPower
1.855 +*/
1.856 +inline TBool CFileCB::BadPower() const
1.857 + {return (iBadPower);}
1.858 +
1.859 +
1.860 +
1.861 +
1.862 +/**
1.863 +Sets the iBadPower value.
1.864 +
1.865 +@param aBadPower ETrue, if an operation on the file has failed due
1.866 + to bad power;
1.867 + EFalse if power has been found to be good.
1.868 +
1.869 +@see CFileCB::iBadPower
1.870 +*/
1.871 +inline void CFileCB::SetBadPower(TBool aBadPower)
1.872 + {iBadPower=aBadPower;}
1.873 +
1.874 +
1.875 +/**
1.876 +Retrieves the BlockMap of a file.
1.877 +
1.878 +@param aInfo
1.879 +
1.880 +@param aStartPos
1.881 +
1.882 +@param aEndPos
1.883 +
1.884 +@return
1.885 +*/
1.886 +inline TInt CFileCB::BlockMap(SBlockMapInfo& aInfo, TInt64& aStartPos, TInt64 aEndPos)
1.887 + {
1.888 + TAny* pM;
1.889 + TInt r = GetInterface(EBlockMapInterface, pM, (TAny*) this);
1.890 + if (KErrNone!=r)
1.891 + return r;
1.892 + return reinterpret_cast<CFileCB::MBlockMapInterface*>(pM)->BlockMap(aInfo, aStartPos, aEndPos);
1.893 + }
1.894 +
1.895 +
1.896 +/**
1.897 +Retrieves TBusLocalDrive object associated with an open file.
1.898 +*/
1.899 +inline TInt CFileCB::LocalDrive(TBusLocalDrive*& aLocalDrive)
1.900 + {
1.901 + aLocalDrive = NULL;
1.902 + return GetInterface(EGetLocalDrive, (TAny*&) aLocalDrive, NULL);
1.903 + }
1.904 +
1.905 +//---------------------------------------------------------------------------------------------------------------------------------
1.906 +// Class RLocalMessage
1.907 +inline RLocalMessage::RLocalMessage()
1.908 + {iHandle = KLocalMessageHandle; iFunction=-1;}
1.909 +
1.910 +//---------------------------------------------------------------------------------------------------------------------------------
1.911 +// Class CFileShare
1.912 +/**
1.913 +Gets a reference to the object representing an open file that is being shared.
1.914 +
1.915 +@return A reference to the shared file.
1.916 +*/
1.917 +inline CFileCB& CFileShare::File()
1.918 + {return(*iFile);}
1.919 +
1.920 +
1.921 +//---------------------------------------------------------------------------------------------------------------------------------
1.922 +// Class CDirCB
1.923 +
1.924 +/**
1.925 +Gets a reference to the object representing the drive on which
1.926 +the directory resides.
1.927 +
1.928 +@return A reference to the directory's drive.
1.929 +*/
1.930 +inline TDrive& CDirCB::Drive() const
1.931 + {return(*iDrive);}
1.932 +
1.933 +
1.934 +
1.935 +
1.936 +/**
1.937 +Gets a reference to the object representing the mount on which
1.938 +the directory resides.
1.939 +
1.940 +@return A reference to the directory's mount.
1.941 +*/
1.942 +inline CMountCB& CDirCB::Mount() const
1.943 + {return(*iMount);}
1.944 +
1.945 +
1.946 +
1.947 +
1.948 +/**
1.949 +Tests whether the preceding entry details should be returned when
1.950 +multiple entries are being read.
1.951 +
1.952 +@return True if the preceding entry details should be returned;
1.953 + false otherwise.
1.954 +*/
1.955 +inline TBool CDirCB::Pending() const
1.956 + {return iPending;}
1.957 +
1.958 +
1.959 +
1.960 +
1.961 +/**
1.962 +Sets whether the preceding entry details should be returned when
1.963 +multiple entries are being read.
1.964 +
1.965 +@param aPending ETrue if the preceding entry details should be returned;
1.966 + EFalse otherwise.
1.967 +*/
1.968 +inline void CDirCB::SetPending(TBool aPending)
1.969 + {iPending=aPending;}
1.970 +
1.971 +
1.972 +
1.973 +//---------------------------------------------------------------------------------------------------------------------------------
1.974 +// class CFormatCB
1.975 +
1.976 +/**
1.977 +Gets the object representing the drive on which the disk to
1.978 +be formatted resides.
1.979 +
1.980 +@return The drive for the format action.
1.981 +*/
1.982 +inline TDrive& CFormatCB::Drive() const
1.983 + {return(*iDrive);}
1.984 +
1.985 +
1.986 +
1.987 +
1.988 +/**
1.989 +Gets the object representing the mount on which the disk to
1.990 +be formatted resides.
1.991 +
1.992 +@return The mount for the format action.
1.993 +*/
1.994 +inline CMountCB& CFormatCB::Mount() const
1.995 + {return(*iMount);}
1.996 +
1.997 +
1.998 +
1.999 +
1.1000 +/**
1.1001 +Gets the mode of the format operation.
1.1002 +
1.1003 +@return The value of the format mode.
1.1004 +*/
1.1005 +inline TFormatMode CFormatCB::Mode() const
1.1006 + {return(iMode);}
1.1007 +
1.1008 +
1.1009 +
1.1010 +
1.1011 +/**
1.1012 +Gets the current stage in the format operation.
1.1013 +
1.1014 +@return The stage the current format operation has reached.
1.1015 +*/
1.1016 +inline TInt& CFormatCB::CurrentStep()
1.1017 + {return(iCurrentStep);}
1.1018 +
1.1019 +
1.1020 +
1.1021 +//---------------------------------------------------------------------------------------------------------------------------------
1.1022 +// class CRawDiskCB
1.1023 +
1.1024 +/**
1.1025 +Gets a reference to an object representing the drive on which the disk resides.
1.1026 +
1.1027 +@return A reference to the drive on which the disk resides.
1.1028 +*/
1.1029 +inline TDrive& CRawDiskCB::Drive()
1.1030 + {return(iMount->Drive());}
1.1031 +
1.1032 +
1.1033 +
1.1034 +
1.1035 +/**
1.1036 +Gets an object representing the mount on which the disk resides.
1.1037 +
1.1038 +@return The mount on which the disk resides.
1.1039 +*/
1.1040 +inline CMountCB& CRawDiskCB::Mount()
1.1041 + {return(*iMount);}
1.1042 +
1.1043 +
1.1044 +
1.1045 +
1.1046 +/**
1.1047 +Tests whether the mount on which the disk resides is write protected.
1.1048 +
1.1049 +@return True if the mount is write protected, false otherwise.
1.1050 +*/
1.1051 +inline TBool CRawDiskCB::IsWriteProtected() const
1.1052 + { return(iFlags & EWriteProtected); }
1.1053 +
1.1054 +
1.1055 +
1.1056 +
1.1057 +
1.1058 +/**
1.1059 +Stores the write protected state of the disk.
1.1060 +*/
1.1061 +inline void CRawDiskCB::SetWriteProtected()
1.1062 + { iFlags |= EWriteProtected; }
1.1063 +
1.1064 +
1.1065 +
1.1066 +
1.1067 +/**
1.1068 +Tests whether the disk contents has changed (due to a write operation)
1.1069 +
1.1070 +@return True if the disk contents has changed
1.1071 +*/
1.1072 +inline TBool CRawDiskCB::IsChanged() const
1.1073 + { return(iFlags & EChanged); }
1.1074 +
1.1075 +
1.1076 +
1.1077 +
1.1078 +/**
1.1079 +Set a flag to state that the disk contents has changed (due to a write operation)
1.1080 +*/
1.1081 +inline void CRawDiskCB::SetChanged()
1.1082 + { iFlags |= EChanged; }
1.1083 +
1.1084 +
1.1085 +
1.1086 +//---------------------------------------------------------------------------------------------------------------------------------
1.1087 +// class CProxyDriveFactory
1.1088 +/**
1.1089 +Sets the Library (DLL) handle to be used by the CProxyDriveFactory
1.1090 +*/
1.1091 +inline void CProxyDriveFactory::SetLibrary(RLibrary aLib)
1.1092 + {iLibrary=aLib;}
1.1093 +/**
1.1094 +Gets the Library (DLL) handle in use by the CProxyDriveFactory
1.1095 +@return Library (DLL) handle
1.1096 +*/
1.1097 +inline RLibrary CProxyDriveFactory::Library() const
1.1098 + {return(iLibrary);}
1.1099 +
1.1100 +//---------------------------------------------------------------------------------------------------------------------------------
1.1101 +// class CProxyDrive
1.1102 +/**
1.1103 +Gets the mount control block object for a specific volume on a drive.
1.1104 +
1.1105 +@return either a currently mounted volume in the system or the volume that has been removed but still has
1.1106 +subsession objects open.
1.1107 +*/
1.1108 +inline CMountCB* CProxyDrive::Mount() const
1.1109 + {return(iMount);}
1.1110 +
1.1111 +
1.1112 +/**
1.1113 +Returns wheher the drive (and any extensions) support file caching
1.1114 +*/
1.1115 +inline TInt CProxyDrive::LocalBufferSupport()
1.1116 + {
1.1117 + TAny* dummyInterface;
1.1118 + return GetInterface(ELocalBufferSupport, dummyInterface, NULL);
1.1119 + }
1.1120 +
1.1121 +/**
1.1122 +return whether proxy drive supports file caching
1.1123 +*/
1.1124 +inline TInt CBaseExtProxyDrive::LocalBufferSupport()
1.1125 + {
1.1126 + return iProxy->LocalBufferSupport();
1.1127 + }
1.1128 +
1.1129 +//---------------------------------------------------------------------------------------------------------------------------------
1.1130 +// class CLocDrvMountCB
1.1131 +/**
1.1132 +Gets the mounted local drive object
1.1133 +
1.1134 +@return The local drive.
1.1135 +*/
1.1136 +inline CProxyDrive* CLocDrvMountCB::LocalDrive() const
1.1137 + {return(iProxyDrive);}
1.1138 +
1.1139 +inline TDismountParams::TDismountParams(TInt aDriveNumber, TDrive* aDrivePointer, TBool aForcedDismount, RMessage2* aForcedMessage)
1.1140 + {
1.1141 + iDriveNumber = aDriveNumber;
1.1142 + iDrivePointer = aDrivePointer;
1.1143 + iForcedDismount = aForcedDismount;
1.1144 + iForcedMessage = aForcedMessage;
1.1145 + }
1.1146 +
1.1147 +//---------------------------------------------------------------------------------------------------------------------------------
1.1148 +// class CFsObject
1.1149 +inline CFsObjectCon* CFsObject::Container() const
1.1150 + {return iContainer;}
1.1151 +inline TInt CFsObject::Inc()
1.1152 + {return(User::SafeInc(iAccessCount));}
1.1153 +inline TInt CFsObject::Dec()
1.1154 + {return(User::SafeDec(iAccessCount));}