1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/userlibandfileserver/fileserver/inc/f32fsys.inl Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,1345 @@
1.4 +// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// f32\inc\f32fsys.inl
1.18 +//
1.19 +// WARNING: This file contains some APIs which are internal and are subject
1.20 +// to change without noticed. Such APIs should therefore not be used
1.21 +// outside the Kernel and Hardware Services package.
1.22 +//
1.23 +
1.24 +#define __IS_DRIVETHREAD() {__ASSERT_DEBUG(IsDriveThread(),DriveFault(ETrue));}
1.25 +#define __IS_MAINTHREAD() {__ASSERT_DEBUG(IsMainThread(),DriveFault(EFalse));}
1.26 +
1.27 +
1.28 +//---------------------------------------------------------------------------------------------------------------------------------
1.29 +// Class TDrive
1.30 +
1.31 +/**
1.32 +Gets last error reason.
1.33 +
1.34 +@return TInt Returns last error reason.
1.35 +*/
1.36 +inline TInt TDrive::GetReason() const
1.37 + {
1.38 + __IS_DRIVETHREAD();
1.39 + return(iReason);
1.40 + }
1.41 +
1.42 +
1.43 +
1.44 +/**
1.45 +Sets a flag to state that the drive contents has changed.
1.46 +
1.47 +@param aValue True if contents has changed; False if unchanged.
1.48 +*/
1.49 +inline void TDrive::SetChanged(TBool aValue)
1.50 + {
1.51 + iChanged=aValue;
1.52 + }
1.53 +
1.54 +
1.55 +
1.56 +
1.57 +/**
1.58 +Determines whether the drive content has changed.
1.59 +
1.60 +@return True if contents changed , False if unchanged.
1.61 +*/
1.62 +inline TBool TDrive::IsChanged() const
1.63 + {
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 +inline TBool TDrive::IsCurrentMount(CMountCB& aMount) const
1.153 + {return(iCurrentMount == &aMount);}
1.154 +
1.155 +
1.156 +
1.157 +/**
1.158 +Gets the substed drive.
1.159 +
1.160 +@return A pointer to the drive which is substed.
1.161 +*/
1.162 +inline TDrive& TDrive::SubstedDrive()const
1.163 + {
1.164 + __IS_MAINTHREAD();
1.165 + return(*iSubstedDrive);
1.166 + }
1.167 +
1.168 +
1.169 +
1.170 +
1.171 +/**
1.172 +
1.173 +Sets the drive as substed to the path set by an earlier call to SetSubst().
1.174 +
1.175 +@param aDrive A pointer to the drive on which the volume is mounted.
1.176 +
1.177 +*/
1.178 +inline void TDrive::SetSubstedDrive(TDrive* aDrive)
1.179 + {
1.180 + __IS_MAINTHREAD();
1.181 + iSubstedDrive=aDrive;
1.182 + }
1.183 +
1.184 +
1.185 +
1.186 +
1.187 +/**
1.188 +Gets the substed path set by an earlier call to SetSubst().
1.189 +
1.190 +@return A reference to a heap descriptor containing the substed path.
1.191 +*/
1.192 +inline HBufC& TDrive::Subst() const
1.193 + {
1.194 + __IS_MAINTHREAD();
1.195 + return(*iSubst);
1.196 + }
1.197 +
1.198 +
1.199 +
1.200 +
1.201 +/**
1.202 +Assigns a path to a drive.
1.203 +
1.204 +@param aSubst Path will be assigned to a drive.
1.205 +
1.206 +*/
1.207 +inline void TDrive::SetSubst(HBufC* aSubst)
1.208 + {
1.209 + __IS_MAINTHREAD();
1.210 + iSubst=aSubst;
1.211 + }
1.212 +
1.213 +
1.214 +
1.215 +/**
1.216 +
1.217 +Gets a reference to the object representing the mount on which the file resides.
1.218 +
1.219 +@return The Drives's mount.
1.220 +
1.221 +*/
1.222 +inline CFsObjectCon& TDrive::Mount() const
1.223 + {return(*iMount);}
1.224 +/**
1.225 +
1.226 +Gets a reference to the object representing the file system
1.227 +
1.228 +@return The reference to file system.
1.229 +
1.230 +*/
1.231 +inline CFileSystem& TDrive::FSys()
1.232 + {return(*iFSys);}
1.233 +/**
1.234 +
1.235 +Gets the object representing the file system
1.236 +
1.237 +@return The file system.
1.238 +
1.239 +*/
1.240 +inline CFileSystem*& TDrive::GetFSys()
1.241 + {return(iFSys);}
1.242 +/**
1.243 +
1.244 +Gets the object representing the TDriveExtInfo.
1.245 +
1.246 +@return The Drive extension information object.
1.247 +
1.248 +@see TDriveExtInfo
1.249 +
1.250 +*/
1.251 +inline TDriveExtInfo& TDrive::ExtInfo()
1.252 + {
1.253 + __IS_DRIVETHREAD();
1.254 + return(iExtInfo);
1.255 + }
1.256 +/**
1.257 +Sets the notification flag ON. The client will receive notifications on Read or Write
1.258 +failures from the file system.
1.259 +
1.260 +*/
1.261 +inline void TDrive::SetNotifyOn()
1.262 + {
1.263 + __IS_DRIVETHREAD();
1.264 + iDriveFlags &= ~ENotifyOff;
1.265 + }
1.266 +/**
1.267 +Sets the notification flag OFF. The client will not receive notifications on Read or Write
1.268 +failures from the file system.
1.269 +
1.270 +*/
1.271 +inline void TDrive::SetNotifyOff()
1.272 + {
1.273 + __IS_DRIVETHREAD();
1.274 + iDriveFlags |= ENotifyOff;
1.275 + }
1.276 +/**
1.277 +
1.278 +Locks the drive.This function acquires iLock mutex.
1.279 +
1.280 +*/
1.281 +inline void TDrive::Lock()
1.282 + {iLock.Wait();}
1.283 +/**
1.284 +
1.285 +UnLocks the drive.This function signals the iLock mutex.
1.286 +
1.287 +*/
1.288 +
1.289 +inline void TDrive::UnLock()
1.290 + {iLock.Signal();}
1.291 +
1.292 +
1.293 +/**
1.294 +
1.295 +Gets the reserved space of a drive
1.296 +
1.297 +@return Amount of space reserved in bytes.
1.298 +
1.299 +*/
1.300 +
1.301 +inline TInt TDrive::ReservedSpace() const
1.302 + {return iReservedSpace;}
1.303 +
1.304 +/**
1.305 +
1.306 +Reserves a space of a drive.
1.307 +
1.308 +@param aReservedSpace Amount of space to reserve in bytes.
1.309 +
1.310 +*/
1.311 +inline void TDrive::SetReservedSpace(const TInt aReservedSpace)
1.312 + {iReservedSpace=aReservedSpace; }
1.313 +
1.314 +/**
1.315 +
1.316 +Sets the rugged flag in the drive object.
1.317 +
1.318 +@param Flag to set or clear the rugged flag.
1.319 +@see IsRugged()
1.320 +
1.321 +*/
1.322 +
1.323 +inline void TDrive::SetRugged(TBool aIsRugged)
1.324 + {
1.325 + if (!aIsRugged)
1.326 + iDriveFlags |= ENotRugged;
1.327 + else
1.328 + iDriveFlags &= ~ENotRugged;
1.329 + }
1.330 +
1.331 +/**
1.332 +
1.333 +Returns whether the current drive is running as rugged Fat
1.334 +or not.If IsRugged flag is set then in the event of power
1.335 +failure fat/metadata will be in a valid state if the scandrive
1.336 +utility is run immediately after.
1.337 +
1.338 +@return Is rugged fat flag.
1.339 +*/
1.340 +
1.341 +inline TBool TDrive::IsRugged() const
1.342 + {return !(iDriveFlags & ENotRugged); }
1.343 +
1.344 +
1.345 +/**
1.346 + @return ETrue if the drive is synchronous, i.e. runs in the main file server thread.
1.347 +*/
1.348 +inline TBool TDrive::IsSynchronous() const
1.349 +{
1.350 + return iDriveFlags & EDriveIsSynch;
1.351 +}
1.352 +
1.353 +/**
1.354 + Set or reset internal EDriveIsSynch flag for the TDrive.
1.355 +*/
1.356 +inline void TDrive::SetSynchronous(TBool aIsSynch)
1.357 +{
1.358 + if(aIsSynch)
1.359 + iDriveFlags |= EDriveIsSynch;
1.360 + else
1.361 + iDriveFlags &= ~EDriveIsSynch;
1.362 +
1.363 +}
1.364 +
1.365 +inline TBool TDrive::DismountDeferred() const
1.366 + { return(iDriveFlags & EDismountDeferred); }
1.367 +
1.368 +
1.369 +// Class CMountCB
1.370 +
1.371 +/**
1.372 +Gets a reference to the object representing the drive on which
1.373 +the volume is mounted.
1.374 +
1.375 +@return The drive on which the volume is mounted.
1.376 +*/
1.377 +inline TDrive& CMountCB::Drive() const
1.378 + {return(*iDrive);}
1.379 +
1.380 +
1.381 +
1.382 +
1.383 +/**
1.384 +Sets a pointer to the object representing the drive on which
1.385 +the volume is mounted.
1.386 +
1.387 +@param aDrive A pointer to the drive on which the volume is mounted.
1.388 +*/
1.389 +inline void CMountCB::SetDrive(TDrive* aDrive)
1.390 + {iDrive=aDrive;}
1.391 +
1.392 +
1.393 +
1.394 +
1.395 +/**
1.396 +Gets a reference to a heap descriptor containing the name of
1.397 +the mounted volume.
1.398 +
1.399 +@return A reference to a heap descriptor containing the volume name.
1.400 +*/
1.401 +inline HBufC& CMountCB::VolumeName() const
1.402 + {return(*iVolumeName);}
1.403 +
1.404 +
1.405 +
1.406 +
1.407 +/**
1.408 +Sets a pointer to a heap descriptor containing the name of the mounted volume.
1.409 +
1.410 +@param aName A pointer to a heap descriptor containing the name of
1.411 + the mounted volume to be set.
1.412 +*/
1.413 +inline void CMountCB::SetVolumeName(HBufC* aName)
1.414 + {iVolumeName=aName;}
1.415 +
1.416 +
1.417 +
1.418 +
1.419 +/**
1.420 +Tests whether the client is notified of any read or write failures.
1.421 +
1.422 +The notification status is a property of the current session with
1.423 +the file server, the value of which is stored in CSessionFs::iNotifyUser.
1.424 +If set to true, the client will receive notifications from the file system.
1.425 +
1.426 +Typically, this function might be used to save the current notification
1.427 +state prior to temporarily disabling notifiers. This allows the original
1.428 +notification state to be restored.
1.429 +
1.430 +Note that GetNotifyUser() is only available once the drive has been set for
1.431 +the mount control block (using SetDrive()), since the notification status
1.432 +is held by the session and accessed via the drive.
1.433 +
1.434 +@return True if the client receives notifications from the file system,
1.435 + false otherwise.
1.436 +*/
1.437 +inline TBool CMountCB::GetNotifyUser() const
1.438 + {return(Drive().GetNotifyUser());}
1.439 +
1.440 +
1.441 +
1.442 +
1.443 +/**
1.444 +*/
1.445 +inline void CMountCB::SetNotifyOn()
1.446 + {Drive().SetNotifyOn();}
1.447 +
1.448 +
1.449 +
1.450 +
1.451 +/**
1.452 +*/
1.453 +inline void CMountCB::SetNotifyOff()
1.454 + {Drive().SetNotifyOff();}
1.455 +
1.456 +
1.457 +
1.458 +
1.459 +/**
1.460 +Locks the mount by incrementing the internal lock counter.
1.461 +
1.462 +The mount becomes locked on formatting or on the opening of a resource
1.463 +(a file or a directory) or raw disk subsession.
1.464 +A format, resource or raw disk subsession can only be opened if the mount
1.465 +is not locked.
1.466 +*/
1.467 +inline void CMountCB::IncLock()
1.468 + {iLockMount++;}
1.469 +
1.470 +
1.471 +
1.472 +
1.473 +/**
1.474 +Unlocks the mount by decrementing the internal lock counter.
1.475 +
1.476 +The mount becomes locked on formatting or on the opening of a resource
1.477 +(a file or a directory) or raw disk subsession.
1.478 +A format, resource or raw disk subsession can only be opened if the mount
1.479 +is not locked.
1.480 +*/
1.481 +inline void CMountCB::DecLock()
1.482 + {iLockMount--;}
1.483 +
1.484 +
1.485 +
1.486 +
1.487 +/**
1.488 +Gets the current lock status.
1.489 +
1.490 +It delivers the current lock status by returning the internal lock counter.
1.491 +
1.492 +@return The current lock status.
1.493 +*/
1.494 +inline TInt CMountCB::LockStatus() const
1.495 + {return(iLockMount);}
1.496 +
1.497 +
1.498 +
1.499 +
1.500 +/**
1.501 +Tests whether the mount is currently locked.
1.502 +
1.503 +A mount is locked when the internal lock counter is greater than zero.
1.504 +On creation, the lock counter is set to zero.
1.505 +
1.506 +The mount becomes locked on formatting or on the opening of a resource
1.507 +(a file or a directory) or raw disk subsession.
1.508 +A format, resource or raw disk subsession can only be opened if the mount
1.509 +is not locked.
1.510 +
1.511 +@return True if the mount is locked, false, otherwise.
1.512 +*/
1.513 +inline TBool CMountCB::Locked() const
1.514 + {return iLockMount>0; }
1.515 +
1.516 +
1.517 +
1.518 +
1.519 +/**
1.520 +Tests whether the mount control block represents the current mount on
1.521 +the associated drive.
1.522 +
1.523 +A drive has only one mount which is accessible: the current mount.
1.524 +Any mount other than the current mount relates to a partition (i.e. volume)
1.525 +that was present on a removable media which has since been removed.
1.526 +The reason the mount has persisted is because resources (i.e. files/directories)
1.527 +are still open on it.
1.528 +
1.529 +This function is only available when the drive has been set for the mount
1.530 +control block (using SetDrive()), since the current mount is held by the drive.
1.531 +
1.532 +@return True if the mount is the current mount on the drive, false otherwise.
1.533 +*/
1.534 +inline TBool CMountCB::IsCurrentMount() const
1.535 + {return(this==&iDrive->CurrentMount());}
1.536 +
1.537 +
1.538 +
1.539 +
1.540 +/**
1.541 +*/
1.542 +inline TInt64 CMountCB::Size() const
1.543 + {return(iSize);}
1.544 +
1.545 +
1.546 +
1.547 +
1.548 +/**
1.549 +Set the unique mount number
1.550 +@param aMountNumber - The unique mount number
1.551 +*/
1.552 +const TInt KMountDismounted = 0x80000000;
1.553 +inline void CMountCB::SetMountNumber(TInt aMountNumber)
1.554 + { iMountNumber = (aMountNumber &~ KMountDismounted); }
1.555 +
1.556 +
1.557 +
1.558 +
1.559 +/**
1.560 +Set the mount to be dismounted
1.561 +*/
1.562 +inline void CMountCB::SetDismounted(TBool aDismounted)
1.563 + {
1.564 + if(aDismounted)
1.565 + iMountNumber |= KMountDismounted;
1.566 + else
1.567 + iMountNumber &= ~KMountDismounted;
1.568 + }
1.569 +
1.570 +
1.571 +
1.572 +
1.573 +/**
1.574 +Returns the unique mount number
1.575 +@return The unique mount number
1.576 +*/
1.577 +inline TInt CMountCB::MountNumber() const
1.578 + { return(iMountNumber &~ KMountDismounted); }
1.579 +
1.580 +
1.581 +
1.582 +
1.583 +/**
1.584 +Returns ETrue if the mount is flagged as dismounted.
1.585 +@return ETrue if the mount is flagged as dismounted
1.586 +*/
1.587 +inline TBool CMountCB::IsDismounted() const
1.588 + { return(iMountNumber & KMountDismounted); }
1.589 +
1.590 +
1.591 +
1.592 +/**
1.593 +Retrieves TBusLocalDrive object associated with the mount
1.594 +*/
1.595 +inline TInt CMountCB::LocalDrive(TBusLocalDrive*& aLocalDrive)
1.596 + {
1.597 + aLocalDrive = NULL;
1.598 + return GetInterface(EGetLocalDrive, (TAny*&) aLocalDrive, NULL);
1.599 + }
1.600 +
1.601 +/**
1.602 +Retrieves CProxyDrive object associated with the mount
1.603 +*/
1.604 +inline TInt CMountCB::ProxyDrive(CProxyDrive*& aProxyDrive)
1.605 + {
1.606 + aProxyDrive = NULL;
1.607 + return GetInterface(EGetProxyDrive, (TAny*&) aProxyDrive, NULL);
1.608 + }
1.609 +
1.610 +inline TInt CMountCB::AddToCompositeMount(TInt aMountIndex)
1.611 + {
1.612 + TAny *mountInterface = NULL;
1.613 + return(GetInterface(EAddToCompositeMount, mountInterface, (TAny*)aMountIndex));
1.614 + }
1.615 +
1.616 +/**
1.617 +Returns whether the mount (and any extensions) support file caching
1.618 +*/
1.619 +inline TInt CMountCB::LocalBufferSupport(CFileCB* aFile)
1.620 + {
1.621 + TAny* dummyInterface;
1.622 + return GetInterface(ELocalBufferSupport, dummyInterface, aFile);
1.623 + }
1.624 +
1.625 +inline TInt CMountCB::MountControl(TInt /*aLevel*/, TInt /*aOption*/, TAny* /*aParam*/)
1.626 + {
1.627 + return KErrNotSupported;
1.628 + }
1.629 +
1.630 +
1.631 +inline void CMountCB::FinaliseMountL(TInt aOperation, TAny* /*aParam1=NULL*/, TAny* /*aParam2=NULL*/)
1.632 + {
1.633 + if(aOperation == RFs::EFinal_RW)
1.634 + {//-- call the legacy method
1.635 + FinaliseMountL();
1.636 + return;
1.637 + }
1.638 +
1.639 + User::Leave(KErrNotSupported);
1.640 + }
1.641 +
1.642 +inline TInt CMountCB::CheckDisk(TInt /*aOperation*/, TAny* /*aParam1=NULL*/, TAny* /*aParam2=NULL*/)
1.643 + {
1.644 + return(KErrNotSupported);
1.645 + }
1.646 +
1.647 +inline TInt CMountCB::ScanDrive(TInt /*aOperation*/, TAny* /*aParam1=NULL*/, TAny* /*aParam2=NULL*/)
1.648 + {
1.649 + return(KErrNotSupported);
1.650 + }
1.651 +
1.652 +
1.653 +//---------------------------------------------------------------------------------------------------------------------------------
1.654 +
1.655 +/**
1.656 + Check is this file system can be mounted on the drive at all. The file system implementation may, for example,
1.657 + read and validate the boot region without real mounting overhead.
1.658 +
1.659 +
1.660 + @return KErrNotSupported this feature is not supported by the file system
1.661 + KErrNone this file system can be mounted on this drive
1.662 + KErrLocked the media is locked on a physical level.
1.663 + other error codes depending on the implementation, indicating that this filesystem can't be mouned
1.664 +*/
1.665 +inline TInt CMountCB::CheckFileSystemMountable()
1.666 + {
1.667 + return MountControl(ECheckFsMountable, 0, NULL);
1.668 + }
1.669 +
1.670 +//---------------------------------------------------------------------------------------------------------------------------------
1.671 +/**
1.672 + Query if the mount is finalised, corresponds to the EMountStateQuery control code only.
1.673 + @param aFinalised out: ETrue if the mount is finalised, EFalse otherwise.
1.674 +
1.675 + @return KErrNotSupported this feature is not supported by the file system
1.676 + KErrNone on success
1.677 +*/
1.678 +inline TInt CMountCB::IsMountFinalised(TBool &aFinalised)
1.679 + {
1.680 + return MountControl(EMountStateQuery, ESQ_IsMountFinalised, &aFinalised);
1.681 + }
1.682 +
1.683 +//---------------------------------------------------------------------------------------------------------------------------------
1.684 +/**
1.685 + Corresponds to EMountVolParamQuery. Request a certain amount of free space on the volume.
1.686 + If _current_ amount of free space is >= than required or it is not being updated in background by the mount, returns immediately;
1.687 + If mount is still counting free space and If _current_ amount of free space is < than required, the caller will be blocked
1.688 + until mount finds enough free space or reports that the _final_ amount of free space is less than required.
1.689 +
1.690 + @param aFreeSpaceBytes in: number of free bytes on the volume required, out: resulted amount of free space. It can be less than
1.691 + required if there isn't enough free space on the volume at all.
1.692 +
1.693 + @return KErrNotSupported this feature is not supported by the file system
1.694 + KErrNone on success
1.695 +*/
1.696 +inline TInt CMountCB::RequestFreeSpace(TUint64 &aFreeSpaceBytes)
1.697 + {
1.698 + return MountControl(EMountVolParamQuery, ESQ_RequestFreeSpace, &aFreeSpaceBytes);
1.699 + }
1.700 +
1.701 +//---------------------------------------------------------------------------------------------------------------------------------
1.702 +/**
1.703 + Corresponds to EMountVolParamQuery. A request to obtain the _current_ amount of free space on the volume asynchronously, without blocking.
1.704 + Some mounts implementations can count volume free space in the background.
1.705 +
1.706 + @param aFreeSpaceBytes in: none; out: _current_ amount of free space on the volume.
1.707 +
1.708 + @return KErrNotSupported this feature is not supported by the file system
1.709 + KErrNone on success
1.710 +*/
1.711 +inline TInt CMountCB::GetCurrentFreeSpaceAvailable(TInt64 &aFreeSpaceBytes)
1.712 + {
1.713 + return MountControl(EMountVolParamQuery, ESQ_GetCurrentFreeSpace, &aFreeSpaceBytes);
1.714 + }
1.715 +
1.716 +//---------------------------------------------------------------------------------------------------------------------------------
1.717 +/**
1.718 + Corresponds to EMountVolParamQuery. A request to obtain size of the mounted volume without blocking (CMountCB::VolumeL() can block).
1.719 + @param aVolSizeBytes in: none; out: mounted volume size, same as TVolumeInfo::iSize
1.720 +
1.721 + @return KErrNotSupported this feature is not supported by the file system
1.722 + KErrNone on success
1.723 +*/
1.724 +inline TInt CMountCB::MountedVolumeSize(TUint64& aVolSizeBytes)
1.725 + {
1.726 + return MountControl(EMountVolParamQuery, ESQ_MountedVolumeSize, &aVolSizeBytes);
1.727 + }
1.728 +
1.729 +
1.730 +//---------------------------------------------------------------------------------------------------------------------------------
1.731 +/**
1.732 + Get Maximum file size, which is supported by the file system that has produced this mount.
1.733 + @param aVolSizeBytes in: none; out: Theoretical max. supported by this file system file size.
1.734 +
1.735 + @return KErrNotSupported this feature is not supported by the file system
1.736 + KErrNone on success
1.737 +*/
1.738 +inline TInt CMountCB::GetMaxSupportedFileSize(TUint64 &aSize)
1.739 + {
1.740 + return MountControl(EMountFsParamQuery, ESQ_GetMaxSupportedFileSize, &aSize);
1.741 + }
1.742 +
1.743 +
1.744 +
1.745 +//###############################################################################################
1.746 +// Class CFileCB
1.747 +
1.748 +/**
1.749 +Sets the mount associated with the file.
1.750 +
1.751 +@param aMount The mount.
1.752 +*/
1.753 +inline void CFileCB::SetMount(CMountCB * aMount)
1.754 + {iMount=aMount;}
1.755 +
1.756 +/**
1.757 +Gets a reference to the object representing the drive on which
1.758 +the file resides.
1.759 +
1.760 +@return A reference to the file's drive.
1.761 +*/
1.762 +inline TDrive& CFileCB::Drive() const
1.763 + {return(*iDrive);}
1.764 +
1.765 +
1.766 +
1.767 +
1.768 +/**
1.769 +Gets a reference to the object representing the drive on which the file was created.
1.770 +
1.771 +The 'created drive' is only different from the 'drive', as returned by Drive(), if
1.772 +the 'drive' was a substitute for the 'created drive' in the file server session.
1.773 +
1.774 +@return A reference to the drive on which the file was created.
1.775 +*/
1.776 +inline TDrive& CFileCB::CreatedDrive() const
1.777 + {return(*iCreatedDrive);}
1.778 +
1.779 +
1.780 +
1.781 +
1.782 +/**
1.783 +Gets a reference to the object representing the mount on which the file resides.
1.784 +
1.785 +@return The file's mount.
1.786 +*/
1.787 +inline CMountCB& CFileCB::Mount() const
1.788 + {return(*iMount);}
1.789 +
1.790 +
1.791 +
1.792 +
1.793 +/**
1.794 +Gets a reference to a heap descriptor containing the full file name.
1.795 +
1.796 +@return A heap descriptor containing the full file name.
1.797 +*/
1.798 +inline HBufC& CFileCB::FileName() const
1.799 + {return(*iFileName);}
1.800 +
1.801 +/**
1.802 +Gets a reference to a heap descriptor containing the folded full file name.
1.803 +
1.804 +@return A heap descriptor containing the full file name.
1.805 +*/
1.806 +inline HBufC& CFileCB::FileNameF() const
1.807 + {return(*iFileNameF);}
1.808 +
1.809 +/**
1.810 +Gets the hash of the folded filename
1.811 +
1.812 +@return hash of the folded file name
1.813 +*/
1.814 +inline TUint32 CFileCB::NameHash() const
1.815 + {return(iNameHash);}
1.816 +
1.817 +
1.818 +/**
1.819 +Gets a reference to the file share locks array being used by the file.
1.820 +@return The file share lock.
1.821 +*/
1.822 +inline TFileLocksArray& CFileCB::FileLocks()
1.823 + {return(*iFileLocks);}
1.824 +
1.825 +
1.826 +
1.827 +
1.828 +/**
1.829 +Gets the file object's unique ID, as returned by CObject::UniqueID().
1.830 +
1.831 +@return The object's unique ID.
1.832 +
1.833 +@see CObject
1.834 +*/
1.835 +inline TInt CFileCB::UniqueID() const
1.836 + {return(CFsObject::UniqueID());}
1.837 +
1.838 +
1.839 +
1.840 +
1.841 +/**
1.842 +Gets the iShare value, which defines the level of access allowed to the file.
1.843 +
1.844 +@return The value of iShare
1.845 +
1.846 +@see CFileCB::iShare
1.847 +*/
1.848 +inline TShare CFileCB::Share() const
1.849 + {return(iShare);}
1.850 +
1.851 +
1.852 +
1.853 +
1.854 +/**
1.855 +Sets the iShare value, which defines the level of access allowed to the file.
1.856 +
1.857 +@param aShare The new value.
1.858 +
1.859 +@see CFileCB::iShare
1.860 +*/
1.861 +inline void CFileCB::SetShare(TShare aShare)
1.862 + {iShare=aShare;}
1.863 +
1.864 +
1.865 +
1.866 +
1.867 +/**
1.868 +Gets the size of the file.
1.869 +
1.870 +@return The size of the file.
1.871 +*/
1.872 +inline TInt CFileCB::Size() const
1.873 + {return(iSize);}
1.874 +
1.875 +
1.876 +
1.877 +
1.878 +/**
1.879 +Sets the size of the file.
1.880 +
1.881 +@param aSize The size of the file.
1.882 +*/
1.883 +inline void CFileCB::SetSize(TInt aSize)
1.884 + {iSize=aSize;}
1.885 +
1.886 +
1.887 +
1.888 +
1.889 +/**
1.890 +Gets the file's attributes.
1.891 +
1.892 +@return An integer containing the file attribute bit mask.
1.893 +*/
1.894 +inline TInt CFileCB::Att() const
1.895 + {return(iAtt);}
1.896 +
1.897 +
1.898 +
1.899 +
1.900 +/**
1.901 +Sets the file's attributes.
1.902 +
1.903 +@param aAtt The file attribute bit mask.
1.904 +*/
1.905 +inline void CFileCB::SetAtt(TInt aAtt)
1.906 + {iAtt=aAtt;}
1.907 +
1.908 +
1.909 +
1.910 +
1.911 +/**
1.912 +Gets the universal time when the file was last modified.
1.913 +
1.914 +@return The universal time when the file was last modiified.
1.915 +*/
1.916 +inline TTime CFileCB::Modified() const
1.917 + {return(iModified);}
1.918 +
1.919 +
1.920 +
1.921 +
1.922 +/**
1.923 +Sets the universal time when the file was last modified.
1.924 +
1.925 +@param aModified The universal time when the file was last modified.
1.926 +*/
1.927 +inline void CFileCB::SetModified(TTime aModified)
1.928 + {iModified=aModified;}
1.929 +
1.930 +
1.931 +
1.932 +
1.933 +/**
1.934 +Tests whether the file is corrupt.
1.935 +
1.936 +@return ETrue if the file is corrupt; EFalse otherwise.
1.937 +*/
1.938 +inline TBool CFileCB::FileCorrupt() const
1.939 + {return iFileCorrupt;}
1.940 +
1.941 +
1.942 +
1.943 +
1.944 +/**
1.945 +Sets whether the file is corrupt.
1.946 +
1.947 +@param aFileCorrupt ETrue, if the file is corrupt; EFalse, otherwise.
1.948 +*/
1.949 +inline void CFileCB::SetFileCorrupt(TBool aFileCorrupt)
1.950 + {iFileCorrupt=aFileCorrupt;}
1.951 +
1.952 +
1.953 +
1.954 +
1.955 +/**
1.956 +Gets the iBadPower value.
1.957 +
1.958 +@return The value of iBadPower
1.959 +
1.960 +@see CFileCB::iBadPower
1.961 +*/
1.962 +inline TBool CFileCB::BadPower() const
1.963 + {return (iBadPower);}
1.964 +
1.965 +
1.966 +
1.967 +
1.968 +/**
1.969 +Sets the iBadPower value.
1.970 +
1.971 +@param aBadPower ETrue, if an operation on the file has failed due
1.972 + to bad power;
1.973 + EFalse if power has been found to be good.
1.974 +
1.975 +@see CFileCB::iBadPower
1.976 +*/
1.977 +inline void CFileCB::SetBadPower(TBool aBadPower)
1.978 + {iBadPower=aBadPower;}
1.979 +
1.980 +
1.981 +/**
1.982 +Retrieves the BlockMap of a file.
1.983 +
1.984 +@param aInfo
1.985 +
1.986 +@param aStartPos
1.987 +
1.988 +@param aEndPos
1.989 +
1.990 +@return
1.991 +*/
1.992 +inline TInt CFileCB::BlockMap(SBlockMapInfo& aInfo, TInt64& aStartPos, TInt64 aEndPos)
1.993 + {
1.994 + TAny* pM;
1.995 + TInt r = GetInterface(EBlockMapInterface, pM, (TAny*) this);
1.996 + if (KErrNone!=r)
1.997 + return r;
1.998 + return reinterpret_cast<CFileCB::MBlockMapInterface*>(pM)->BlockMap(aInfo, aStartPos, aEndPos);
1.999 + }
1.1000 +
1.1001 +
1.1002 +/**
1.1003 +Retrieves TBusLocalDrive object associated with an open file.
1.1004 +*/
1.1005 +inline TInt CFileCB::LocalDrive(TBusLocalDrive*& aLocalDrive)
1.1006 + {
1.1007 + aLocalDrive = NULL;
1.1008 + return GetInterface(EGetLocalDrive, (TAny*&) aLocalDrive, NULL);
1.1009 + }
1.1010 +
1.1011 +//---------------------------------------------------------------------------------------------------------------------------------
1.1012 +// Class RLocalMessage
1.1013 +inline RLocalMessage::RLocalMessage()
1.1014 + {InitHandle();}
1.1015 +
1.1016 +inline void RLocalMessage::InitHandle()
1.1017 + {iHandle = KLocalMessageHandle; iFunction=-1;}
1.1018 +
1.1019 +inline void RLocalMessage::SetFunction(TInt aFunction)
1.1020 + {iFunction = aFunction;}
1.1021 +
1.1022 +inline void RLocalMessage::SetArgs(TIpcArgs& aArgs)
1.1023 + {
1.1024 + iArgs[0] = aArgs.iArgs[0];
1.1025 + iArgs[1] = aArgs.iArgs[1];
1.1026 + iArgs[2] = aArgs.iArgs[2];
1.1027 + iArgs[3] = aArgs.iArgs[3];
1.1028 +
1.1029 + }
1.1030 +
1.1031 +inline TInt RLocalMessage::Arg(TInt aIndex) const
1.1032 + {return iArgs[aIndex];}
1.1033 +
1.1034 +//---------------------------------------------------------------------------------------------------------------------------------
1.1035 +// Class CFileShare
1.1036 +/**
1.1037 +Gets a reference to the object representing an open file that is being shared.
1.1038 +
1.1039 +@return A reference to the shared file.
1.1040 +*/
1.1041 +inline CFileCB& CFileShare::File()
1.1042 + {return(*iFile);}
1.1043 +
1.1044 +
1.1045 +// Returns ETrue if the file share mode is EFileBifFile
1.1046 +// indicating large file access for the file share
1.1047 +inline TBool CFileShare::IsFileModeBig()
1.1048 + {
1.1049 + return (iMode & EFileBigFile) ? (TBool)ETrue:(TBool)EFalse;
1.1050 + }
1.1051 +
1.1052 +
1.1053 +//---------------------------------------------------------------------------------------------------------------------------------
1.1054 +// Class CDirCB
1.1055 +
1.1056 +/**
1.1057 +Gets a reference to the object representing the drive on which
1.1058 +the directory resides.
1.1059 +
1.1060 +@return A reference to the directory's drive.
1.1061 +*/
1.1062 +inline TDrive& CDirCB::Drive() const
1.1063 + {return(*iDrive);}
1.1064 +
1.1065 +
1.1066 +
1.1067 +
1.1068 +/**
1.1069 +Gets a reference to the object representing the mount on which
1.1070 +the directory resides.
1.1071 +
1.1072 +@return A reference to the directory's mount.
1.1073 +*/
1.1074 +inline CMountCB& CDirCB::Mount() const
1.1075 + {return(*iMount);}
1.1076 +
1.1077 +
1.1078 +
1.1079 +
1.1080 +/**
1.1081 +Tests whether the preceding entry details should be returned when
1.1082 +multiple entries are being read.
1.1083 +
1.1084 +@return True if the preceding entry details should be returned;
1.1085 + false otherwise.
1.1086 +*/
1.1087 +inline TBool CDirCB::Pending() const
1.1088 + {return iPending;}
1.1089 +
1.1090 +
1.1091 +
1.1092 +
1.1093 +/**
1.1094 +Sets whether the preceding entry details should be returned when
1.1095 +multiple entries are being read.
1.1096 +
1.1097 +@param aPending ETrue if the preceding entry details should be returned;
1.1098 + EFalse otherwise.
1.1099 +*/
1.1100 +inline void CDirCB::SetPending(TBool aPending)
1.1101 + {iPending=aPending;}
1.1102 +
1.1103 +
1.1104 +
1.1105 +//---------------------------------------------------------------------------------------------------------------------------------
1.1106 +// class CFormatCB
1.1107 +
1.1108 +/**
1.1109 +Gets the object representing the drive on which the disk to
1.1110 +be formatted resides.
1.1111 +
1.1112 +@return The drive for the format action.
1.1113 +*/
1.1114 +inline TDrive& CFormatCB::Drive() const
1.1115 + {return(*iDrive);}
1.1116 +
1.1117 +
1.1118 +
1.1119 +
1.1120 +/**
1.1121 +Gets the object representing the mount on which the disk to
1.1122 +be formatted resides.
1.1123 +
1.1124 +@return The mount for the format action.
1.1125 +*/
1.1126 +inline CMountCB& CFormatCB::Mount() const
1.1127 + {return(*iMount);}
1.1128 +
1.1129 +
1.1130 +
1.1131 +
1.1132 +/**
1.1133 +Gets the mode of the format operation.
1.1134 +
1.1135 +@return The value of the format mode.
1.1136 +*/
1.1137 +inline TFormatMode CFormatCB::Mode() const
1.1138 + {return(iMode);}
1.1139 +
1.1140 +
1.1141 +
1.1142 +
1.1143 +/**
1.1144 +Gets the current stage in the format operation.
1.1145 +
1.1146 +@return The stage the current format operation has reached.
1.1147 +*/
1.1148 +inline TInt& CFormatCB::CurrentStep()
1.1149 + {return(iCurrentStep);}
1.1150 +
1.1151 +
1.1152 +
1.1153 +//---------------------------------------------------------------------------------------------------------------------------------
1.1154 +// class CRawDiskCB
1.1155 +
1.1156 +/**
1.1157 +Gets a reference to an object representing the drive on which the disk resides.
1.1158 +
1.1159 +@return A reference to the drive on which the disk resides.
1.1160 +*/
1.1161 +inline TDrive& CRawDiskCB::Drive()
1.1162 + {return(iMount->Drive());}
1.1163 +
1.1164 +
1.1165 +
1.1166 +
1.1167 +/**
1.1168 +Gets an object representing the mount on which the disk resides.
1.1169 +
1.1170 +@return The mount on which the disk resides.
1.1171 +*/
1.1172 +inline CMountCB& CRawDiskCB::Mount()
1.1173 + {return(*iMount);}
1.1174 +
1.1175 +
1.1176 +
1.1177 +
1.1178 +/**
1.1179 +Tests whether the mount on which the disk resides is write protected.
1.1180 +
1.1181 +@return True if the mount is write protected, false otherwise.
1.1182 +*/
1.1183 +inline TBool CRawDiskCB::IsWriteProtected() const
1.1184 + { return(iFlags & EWriteProtected); }
1.1185 +
1.1186 +
1.1187 +
1.1188 +
1.1189 +
1.1190 +/**
1.1191 +Stores the write protected state of the disk.
1.1192 +*/
1.1193 +inline void CRawDiskCB::SetWriteProtected()
1.1194 + { iFlags |= EWriteProtected; }
1.1195 +
1.1196 +
1.1197 +
1.1198 +
1.1199 +/**
1.1200 +Tests whether the disk contents has changed (due to a write operation)
1.1201 +
1.1202 +@return True if the disk contents has changed
1.1203 +*/
1.1204 +inline TBool CRawDiskCB::IsChanged() const
1.1205 + { return(iFlags & EChanged); }
1.1206 +
1.1207 +
1.1208 +
1.1209 +
1.1210 +/**
1.1211 +Set a flag to state that the disk contents has changed (due to a write operation)
1.1212 +*/
1.1213 +inline void CRawDiskCB::SetChanged()
1.1214 + { iFlags |= EChanged; }
1.1215 +
1.1216 +
1.1217 +
1.1218 +//---------------------------------------------------------------------------------------------------------------------------------
1.1219 +// class CProxyDriveFactory
1.1220 +/**
1.1221 +Sets the Library (DLL) handle to be used by the CProxyDriveFactory
1.1222 +*/
1.1223 +inline void CProxyDriveFactory::SetLibrary(RLibrary aLib)
1.1224 + {iLibrary=aLib;}
1.1225 +/**
1.1226 +Gets the Library (DLL) handle in use by the CProxyDriveFactory
1.1227 +@return Library (DLL) handle
1.1228 +*/
1.1229 +inline RLibrary CProxyDriveFactory::Library() const
1.1230 + {return(iLibrary);}
1.1231 +
1.1232 +
1.1233 +inline void CExtProxyDriveFactory::SetLibrary(RLibrary aLib)
1.1234 + {iLibrary=aLib;}
1.1235 +
1.1236 +inline RLibrary CExtProxyDriveFactory::Library() const
1.1237 + {return(iLibrary);}
1.1238 +
1.1239 +
1.1240 +//---------------------------------------------------------------------------------------------------------------------------------
1.1241 +// class CProxyDrive
1.1242 +/**
1.1243 +Gets the mount control block object for a specific volume on a drive.
1.1244 +
1.1245 +@return either a currently mounted volume in the system or the volume that has been removed but still has
1.1246 +subsession objects open.
1.1247 +*/
1.1248 +inline CMountCB* CProxyDrive::Mount() const
1.1249 + {return(iMount);}
1.1250 +
1.1251 +inline void CProxyDrive::SetMount(CMountCB *aMount)
1.1252 + {
1.1253 + iMount = aMount;
1.1254 + }
1.1255 +
1.1256 +/**
1.1257 +Returns wheher the drive (and any extensions) support file caching
1.1258 +*/
1.1259 +inline TInt CProxyDrive::LocalBufferSupport()
1.1260 + {
1.1261 + TAny* dummyInterface;
1.1262 + return GetInterface(ELocalBufferSupport, dummyInterface, NULL);
1.1263 + }
1.1264 +
1.1265 +/**
1.1266 +return whether proxy drive supports file caching
1.1267 +*/
1.1268 +inline TInt CBaseExtProxyDrive::LocalBufferSupport()
1.1269 + {
1.1270 + return iProxy->LocalBufferSupport();
1.1271 + }
1.1272 +
1.1273 +//---------------------------------------------------------------------------------------------------------------------------------
1.1274 +// Surrogate Pair hepler apis
1.1275 +/**
1.1276 +Determines if aChar is the outsite BMP.
1.1277 +
1.1278 +@param aChar character to checked if that is outside BMP.
1.1279 +@return ETrue if outside BMP, EFalse otherwise.
1.1280 +*/
1.1281 +inline TBool IsSupplementary(TUint aChar)
1.1282 + {
1.1283 + return (aChar > 0xFFFF);
1.1284 + }
1.1285 +
1.1286 +/**
1.1287 +Determines if aInt16 is a high surrogate.
1.1288 +
1.1289 +@param aInt16 character to checked if that is high surrogate.
1.1290 +@return ETrue if high surrogate, EFalse otherwise.
1.1291 +*/
1.1292 +inline TBool IsHighSurrogate(TText16 aInt16)
1.1293 + {
1.1294 + return (aInt16 & 0xFC00) == 0xD800;
1.1295 + }
1.1296 +
1.1297 +/**
1.1298 +Determines if aInt16 is a low surrogate.
1.1299 +
1.1300 +@param aInt16 character to checked if that is low surrogate.
1.1301 +@return ETrue if low surrogate, EFalse otherwise.
1.1302 +*/
1.1303 +inline TBool IsLowSurrogate(TText16 aInt16)
1.1304 + {
1.1305 + return (aInt16 & 0xFC00) == 0xDC00;
1.1306 + }
1.1307 +
1.1308 +/**
1.1309 +Joins high surrogate character aHighSurrogate and low surrogate character aLowSurrogate.
1.1310 +
1.1311 +@param aHighSurrogate a high surrogate character to be joined.
1.1312 +@param aLowSurrogate a low surrogate character to be joined.
1.1313 +@return joined character that is outside BMP.
1.1314 +*/
1.1315 +inline TUint JoinSurrogate(TText16 aHighSurrogate, TText16 aLowSurrogate)
1.1316 + {
1.1317 + return ((aHighSurrogate - 0xD7F7) << 10) + aLowSurrogate;
1.1318 + }
1.1319 +
1.1320 +//---------------------------------------------------------------------------------------------------------------------------------
1.1321 +// class CExtProxyDrive
1.1322 +inline TInt CExtProxyDrive::DriveNumber()
1.1323 + {return iDriveNumber;};
1.1324 +inline void CExtProxyDrive::SetDriveNumber(TInt aDrive)
1.1325 + {iDriveNumber = aDrive;};
1.1326 +inline CExtProxyDriveFactory* CExtProxyDrive::FactoryP()
1.1327 + {return iFactory;};
1.1328 +
1.1329 +//---------------------------------------------------------------------------------------------------------------------------------
1.1330 +// class CLocDrvMountCB
1.1331 +/**
1.1332 +Gets the mounted local drive object
1.1333 +
1.1334 +@return The local drive.
1.1335 +*/
1.1336 +inline CProxyDrive* CLocDrvMountCB::LocalDrive() const
1.1337 + {return(iProxyDrive);}
1.1338 +
1.1339 +//---------------------------------------------------------------------------------------------------------------------------------
1.1340 +// class CFsObject
1.1341 +inline CFsObjectCon* CFsObject::Container() const
1.1342 + { return iContainer; }
1.1343 +inline TInt CFsObject::Inc()
1.1344 + { return __e32_atomic_tas_ord32(&iAccessCount, 1, 1, 0); }
1.1345 +inline TInt CFsObject::Dec()
1.1346 + { return __e32_atomic_tas_ord32(&iAccessCount, 1, -1, 0); }
1.1347 +
1.1348 +