epoc32/include/f32fsys.inl
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 f32fsys.inl
     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 "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // f32\inc\f32fsys.inl
       
    15 // 
       
    16 //
       
    17 
       
    18 #define __IS_DRIVETHREAD() {__ASSERT_DEBUG(IsDriveThread(),DriveFault(ETrue));}
       
    19 #define __IS_MAINTHREAD() {__ASSERT_DEBUG(IsMainThread(),DriveFault(EFalse));}
       
    20 
       
    21 
       
    22 //---------------------------------------------------------------------------------------------------------------------------------
       
    23 // Class TDrive
       
    24 
       
    25 /**
       
    26 Gets last error reason.
       
    27 
       
    28 @return	TInt	Returns last error reason.
       
    29 */
       
    30 inline TInt TDrive::GetReason() const
       
    31 	{
       
    32 	__IS_DRIVETHREAD(); 
       
    33 	return(iReason);
       
    34 	}
       
    35 
       
    36 
       
    37 
       
    38 /**
       
    39 Sets a flag to state that the drive contents has changed.
       
    40 
       
    41 @param	aValue	True if contents has changed; False if unchanged.
       
    42 */
       
    43 inline void TDrive::SetChanged(TBool aValue)
       
    44 	{
       
    45 //	__IS_DRIVETHREAD();//scan drive running in new thread 
       
    46 	iChanged=aValue;
       
    47 	}
       
    48 
       
    49 
       
    50 
       
    51 
       
    52 /**
       
    53 Determines whether the drive content has changed.
       
    54 
       
    55 @return	True if contents changed , False if unchanged.
       
    56 */
       
    57 inline TBool TDrive::IsChanged() const
       
    58 	{
       
    59 //	__IS_DRIVETHREAD();
       
    60 	return(iChanged);
       
    61 	}
       
    62 
       
    63 
       
    64 
       
    65 
       
    66 /**
       
    67 Returns the drive number.
       
    68 
       
    69 @return The drive number. 
       
    70 
       
    71 @see TDriveNumber
       
    72 */
       
    73 inline TInt TDrive::DriveNumber() const
       
    74 	{return(iDriveNumber);}
       
    75 
       
    76 
       
    77 
       
    78 
       
    79 /**
       
    80 Determines whether the drive is mounted.
       
    81 
       
    82 @return True if drive is mounted, False if drive is not mounted.
       
    83 */
       
    84 inline TBool TDrive::IsMounted() const
       
    85 	{
       
    86 	__IS_DRIVETHREAD();
       
    87 	return(iCurrentMount!=NULL);
       
    88 	}
       
    89 
       
    90 
       
    91 
       
    92 
       
    93 /**
       
    94 Determines whether attribute is set to local.
       
    95 
       
    96 @return True if attribute is set to KDriveAttLocal, False for all other attributes.
       
    97 */
       
    98 inline TBool TDrive::IsLocal()  const
       
    99 	{return(iAtt & KDriveAttLocal);}
       
   100 
       
   101 
       
   102 
       
   103 
       
   104 /**
       
   105 Determines whether the drive is ROM drive.
       
   106 
       
   107 @return True if drive attribute is set as ROM drive  , False if not set as ROM drive.
       
   108 */
       
   109 inline TBool TDrive::IsRom()  const
       
   110 	{return( iAtt & KDriveAttRom);}
       
   111 
       
   112 
       
   113 
       
   114 
       
   115 /**
       
   116 Determines whether the drive is removable.
       
   117 
       
   118 @return True if drive attribute is set to removable , False for all other attributes.
       
   119 */
       
   120 inline TBool TDrive::IsRemovable() const
       
   121 	{return( iAtt & KDriveAttRemovable);}
       
   122 
       
   123 
       
   124 
       
   125 
       
   126 /**
       
   127 Determines whether the drive is substed.
       
   128 
       
   129 @return True if drive attribute is set to substed (KDriveAttSubsted), False for all other attributes.
       
   130 */
       
   131 inline TBool TDrive::IsSubsted() const
       
   132 	{return( iAtt & KDriveAttSubsted);}//	KDriveAttSubsted = 0x08
       
   133 
       
   134 
       
   135 
       
   136 
       
   137 /**
       
   138 Gets a reference to the object representing the current mount.
       
   139 
       
   140 @return The file's mount.
       
   141 */
       
   142 inline CMountCB& TDrive::CurrentMount() const
       
   143 	{
       
   144 	__IS_DRIVETHREAD();
       
   145 	return(*iCurrentMount);
       
   146 	}
       
   147 
       
   148 
       
   149 
       
   150 
       
   151 /**
       
   152 Gets the substed drive.
       
   153 
       
   154 @return		A pointer to the drive which is substed.
       
   155 */
       
   156 inline TDrive& TDrive::SubstedDrive()const
       
   157 	{
       
   158 	__IS_MAINTHREAD();
       
   159 	return(*iSubstedDrive);
       
   160 	}
       
   161 
       
   162 
       
   163 
       
   164 
       
   165 /**
       
   166 
       
   167 Sets the drive as substed to the path set by an earlier call to SetSubst().
       
   168 
       
   169 @param	aDrive	A pointer to the drive on which the volume is mounted.
       
   170 
       
   171 */
       
   172 inline void TDrive::SetSubstedDrive(TDrive* aDrive)
       
   173 	{
       
   174 	__IS_MAINTHREAD();
       
   175 	iSubstedDrive=aDrive;
       
   176 	}
       
   177 
       
   178 
       
   179 
       
   180 
       
   181 /**
       
   182 Gets the substed path set by an earlier call to SetSubst().
       
   183 
       
   184 @return	A reference to a heap descriptor containing the substed path.
       
   185 */
       
   186 inline HBufC& TDrive::Subst() const
       
   187 	{
       
   188 	__IS_MAINTHREAD();
       
   189 	return(*iSubst);
       
   190 	}
       
   191 
       
   192 
       
   193 
       
   194 
       
   195 /**
       
   196 Assigns a path to a drive.
       
   197 
       
   198 @param	aSubst	Path will be assigned to a drive.
       
   199 
       
   200 */
       
   201 inline void TDrive::SetSubst(HBufC* aSubst)
       
   202 	{
       
   203 	__IS_MAINTHREAD();
       
   204 	iSubst=aSubst;
       
   205 	}
       
   206 
       
   207 
       
   208 
       
   209 /**
       
   210 
       
   211 Gets a reference to the object representing the mount on which the file resides.
       
   212 
       
   213 @return The Drives's mount.
       
   214 
       
   215 */
       
   216 inline CFsObjectCon& TDrive::Mount() const
       
   217 	{return(*iMount);}
       
   218 /**
       
   219 
       
   220 Gets a reference to the object representing the file system
       
   221 
       
   222 @return The reference to file system.
       
   223 
       
   224 */
       
   225 inline CFileSystem& TDrive::FSys()
       
   226 	{return(*iFSys);}
       
   227 /**
       
   228 
       
   229 Gets the object representing the file system
       
   230 
       
   231 @return The file system.
       
   232 
       
   233 */
       
   234 inline CFileSystem*& TDrive::GetFSys()
       
   235 	{return(iFSys);}
       
   236 /**
       
   237 
       
   238 Gets the object representing the TDriveExtInfo.
       
   239 
       
   240 @return The Drive extension information object.
       
   241 
       
   242 @see	TDriveExtInfo
       
   243 
       
   244 */
       
   245 inline TDriveExtInfo& TDrive::ExtInfo()
       
   246 	{
       
   247 	__IS_DRIVETHREAD();
       
   248 	return(iExtInfo);
       
   249 	}
       
   250 /**
       
   251 Sets the notification flag ON. The client will receive notifications on Read or Write 
       
   252 failures from the file system.
       
   253 
       
   254 */
       
   255 inline void TDrive::SetNotifyOn()
       
   256 	{
       
   257 	__IS_DRIVETHREAD();
       
   258 	iDriveFlags &= ~ENotifyOff;
       
   259 	}
       
   260 /**
       
   261 Sets the notification flag OFF. The client will not receive notifications on Read or Write 
       
   262 failures from the file system.
       
   263 
       
   264 */
       
   265 inline void TDrive::SetNotifyOff()
       
   266 	{
       
   267 	__IS_DRIVETHREAD();
       
   268 	iDriveFlags |= ENotifyOff;
       
   269 	}
       
   270 /**
       
   271 
       
   272 Locks the drive.This function acquires iLock mutex.
       
   273 
       
   274 */
       
   275 inline void TDrive::Lock()
       
   276 	{iLock.Wait();}
       
   277 /**
       
   278 
       
   279 UnLocks the drive.This function signals the iLock mutex.
       
   280 
       
   281 */
       
   282 
       
   283 inline void TDrive::UnLock()
       
   284 	{iLock.Signal();}
       
   285 
       
   286 
       
   287 /**
       
   288 
       
   289 Gets the reserved space of a drive
       
   290 
       
   291 @return	Amount of space reserved in bytes.
       
   292 
       
   293 */
       
   294 
       
   295 inline TInt TDrive::ReservedSpace() const
       
   296 	{return iReservedSpace;}
       
   297 
       
   298 /**
       
   299 
       
   300 Reserves a space of a drive.
       
   301 
       
   302 @param	aReservedSpace	Amount of space to reserve in bytes.
       
   303 
       
   304 */
       
   305 inline void TDrive::SetReservedSpace(const TInt aReservedSpace)
       
   306 	{iReservedSpace=aReservedSpace; }
       
   307 
       
   308 /**
       
   309 
       
   310 Sets the rugged flag in the drive object.
       
   311 
       
   312 @param Flag to set or clear the rugged flag.
       
   313 @see	IsRugged()
       
   314 
       
   315 */
       
   316 
       
   317 inline void TDrive::SetRugged(TBool aIsRugged)
       
   318 	{
       
   319 	if (!aIsRugged)
       
   320 		iDriveFlags |= ENotRugged;
       
   321 	else
       
   322 		iDriveFlags &= ~ENotRugged;
       
   323 	}
       
   324 
       
   325 /**
       
   326 
       
   327 Returns whether the current drive is running as rugged Fat
       
   328 or not.If IsRugged flag is set then in the event of power 
       
   329 failure fat/metadata will be in a valid state if the scandrive 
       
   330 utility is run immediately after.
       
   331 
       
   332 @return Is rugged fat flag.
       
   333 */
       
   334 
       
   335 inline TBool TDrive::IsRugged() const
       
   336 	{return !(iDriveFlags & ENotRugged); }
       
   337 
       
   338 
       
   339 /**
       
   340     @return ETrue if the drive is synchronous, i.e. runs in the main file server thread.
       
   341 */
       
   342 inline TBool TDrive::IsSynchronous() const
       
   343 {
       
   344     return iDriveFlags & EDriveIsSynch;
       
   345 }
       
   346 
       
   347 /**
       
   348     Set or reset internal EDriveIsSynch flag for the TDrive.
       
   349 */
       
   350 inline void TDrive::SetSynchronous(TBool aIsSynch)
       
   351 {
       
   352     if(aIsSynch)
       
   353         iDriveFlags |= EDriveIsSynch;
       
   354     else
       
   355         iDriveFlags &= ~EDriveIsSynch;
       
   356     
       
   357 }
       
   358 
       
   359 
       
   360 // Class CMountCB
       
   361 
       
   362 /**
       
   363 Gets a reference to the object representing the drive on which
       
   364 the volume is mounted.
       
   365 
       
   366 @return The drive on which the volume is mounted.
       
   367 */
       
   368 inline TDrive& CMountCB::Drive() const
       
   369 	{return(*iDrive);}
       
   370 
       
   371 
       
   372 
       
   373 
       
   374 /**
       
   375 Sets a pointer to the object representing the drive on which
       
   376 the volume is mounted.
       
   377 
       
   378 @param aDrive A pointer to the drive on which the volume is mounted.
       
   379 */
       
   380 inline void CMountCB::SetDrive(TDrive* aDrive)
       
   381 	{iDrive=aDrive;}
       
   382 
       
   383 
       
   384 
       
   385 
       
   386 /**
       
   387 Gets a reference to a heap descriptor containing the name of
       
   388 the mounted volume.
       
   389 
       
   390 @return A reference to a heap descriptor containing the volume name.
       
   391 */
       
   392 inline HBufC& CMountCB::VolumeName() const
       
   393 	{return(*iVolumeName);}
       
   394 
       
   395 
       
   396 
       
   397 
       
   398 /**
       
   399 Sets a pointer to a heap descriptor containing the name of the mounted volume.
       
   400 
       
   401 @param aName A pointer to a heap descriptor containing the name of
       
   402              the mounted volume to be set.
       
   403 */
       
   404 inline void CMountCB::SetVolumeName(HBufC* aName)
       
   405 	{iVolumeName=aName;}
       
   406 
       
   407 
       
   408 
       
   409 
       
   410 /**
       
   411 Tests whether the client is notified of any read or write failures.
       
   412 
       
   413 The notification status is a property of the current session with
       
   414 the file server, the value of which is stored in CSessionFs::iNotifyUser.
       
   415 If set to true, the client will receive notifications from the file system.
       
   416 
       
   417 Typically, this function might be used to save the current notification
       
   418 state prior to temporarily disabling notifiers. This allows the original
       
   419 notification state to be restored. 
       
   420 
       
   421 Note that GetNotifyUser() is only available once the drive has been set for
       
   422 the mount control block (using SetDrive()), since the notification status
       
   423 is held by the session and accessed via the drive.
       
   424 
       
   425 @return True if the client receives notifications from the file system,
       
   426         false otherwise.
       
   427 */
       
   428 inline TBool CMountCB::GetNotifyUser() const
       
   429 	{return(Drive().GetNotifyUser());}
       
   430 
       
   431 
       
   432 
       
   433 
       
   434 /**
       
   435 */
       
   436 inline void CMountCB::SetNotifyOn()
       
   437 	{Drive().SetNotifyOn();}
       
   438 
       
   439 
       
   440 
       
   441 
       
   442 /**
       
   443 */
       
   444 inline void CMountCB::SetNotifyOff()
       
   445 	{Drive().SetNotifyOff();}
       
   446 
       
   447 
       
   448 
       
   449 
       
   450 /**
       
   451 Locks the mount by incrementing the internal lock counter.
       
   452 
       
   453 The mount becomes locked on formatting or on the opening of a resource
       
   454 (a file or a directory) or raw disk subsession.
       
   455 A format, resource or raw disk subsession can only be opened if the mount
       
   456 is not locked.
       
   457 */
       
   458 inline void CMountCB::IncLock()
       
   459 	{iLockMount++;}
       
   460 
       
   461 
       
   462 
       
   463 
       
   464 /**
       
   465 Unlocks the mount by decrementing the internal lock counter.
       
   466 
       
   467 The mount becomes locked on formatting or on the opening of a resource
       
   468 (a file or a directory) or raw disk subsession.
       
   469 A format, resource or raw disk subsession can only be opened if the mount
       
   470 is not locked.
       
   471 */
       
   472 inline void CMountCB::DecLock()
       
   473 	{iLockMount--;}
       
   474 
       
   475 
       
   476 
       
   477 
       
   478 /**
       
   479 Gets the current lock status.
       
   480 
       
   481 It delivers the current lock status by returning the internal lock counter.
       
   482 
       
   483 @return The current lock status.
       
   484 */
       
   485 inline TInt CMountCB::LockStatus() const
       
   486 	{return(iLockMount);}
       
   487 
       
   488 
       
   489 
       
   490 
       
   491 /**
       
   492 Tests whether the mount is currently locked. 
       
   493 
       
   494 A mount is locked when the internal lock counter is greater than zero.
       
   495 On creation, the lock counter is set to zero.
       
   496 
       
   497 The mount becomes locked on formatting or on the opening of a resource
       
   498 (a file or a directory) or raw disk subsession.
       
   499 A format, resource or raw disk subsession can only be opened if the mount
       
   500 is not locked.
       
   501 
       
   502 @return True if the mount is locked, false, otherwise.
       
   503 */
       
   504 inline TBool CMountCB::Locked() const
       
   505 	{return iLockMount>0; }
       
   506 
       
   507 
       
   508 
       
   509 
       
   510 /**
       
   511 Tests whether the mount control block represents the current mount on
       
   512 the associated drive.
       
   513 
       
   514 A drive has only one mount which is accessible: the current mount.
       
   515 Any mount other than the current mount relates to a partition (i.e. volume)
       
   516 that was present on a removable media which has since been removed.
       
   517 The reason the mount has persisted is because resources (i.e. files/directories)
       
   518 are still open on it.
       
   519 
       
   520 This function is only available when the drive has been set for the mount
       
   521 control block (using SetDrive()), since the current mount is held by the drive.
       
   522 
       
   523 @return True if the mount is the current mount on the drive, false otherwise.
       
   524 */
       
   525 inline TBool CMountCB::IsCurrentMount() const
       
   526 	{return(this==&iDrive->CurrentMount());}
       
   527 
       
   528 
       
   529 
       
   530 
       
   531 /**
       
   532 */
       
   533 inline TInt64 CMountCB::Size() const
       
   534 	{return(iSize);}
       
   535 
       
   536 
       
   537 
       
   538 
       
   539 /**
       
   540 Set the unique mount number
       
   541 @param aMountNumber - The unique mount number
       
   542 */
       
   543 const TInt KMountDismounted = 0x80000000;
       
   544 inline void CMountCB::SetMountNumber(TInt aMountNumber)
       
   545 	{ iMountNumber = (aMountNumber &~ KMountDismounted); }
       
   546 
       
   547 
       
   548 
       
   549 
       
   550 /**
       
   551 Set the mount to be dismounted
       
   552 */
       
   553 inline void CMountCB::SetDismounted(TBool aDismounted)
       
   554 	{
       
   555 	if(aDismounted)
       
   556 		iMountNumber |= KMountDismounted;
       
   557 	else
       
   558 		iMountNumber &= ~KMountDismounted;
       
   559 	}
       
   560 
       
   561 
       
   562 
       
   563 
       
   564 /**
       
   565 Returns the unique mount number
       
   566 @return The unique mount number
       
   567 */
       
   568 inline TInt CMountCB::MountNumber() const
       
   569 	{ return(iMountNumber &~ KMountDismounted); }
       
   570 
       
   571 
       
   572 
       
   573 
       
   574 /**
       
   575 Returns ETrue if the mount is flagged as dismounted.
       
   576 @return ETrue if the mount is flagged as dismounted
       
   577 */
       
   578 inline TBool CMountCB::IsDismounted() const
       
   579 	{ return(iMountNumber & KMountDismounted); }
       
   580 
       
   581 
       
   582 
       
   583 /**
       
   584 Retrieves TBusLocalDrive object associated with the mount
       
   585 */
       
   586 inline TInt CMountCB::LocalDrive(TBusLocalDrive*& aLocalDrive)
       
   587 	{
       
   588 	aLocalDrive = NULL;
       
   589 	return GetInterface(EGetLocalDrive, (TAny*&) aLocalDrive, NULL);
       
   590 	}
       
   591 
       
   592 inline TInt CMountCB::AddToCompositeMount(TInt aMountIndex)
       
   593 	{ 
       
   594 		TAny *mountInterface = NULL; 
       
   595 		return(GetInterface(EAddToCompositeMount, mountInterface, (TAny*)aMountIndex)); 
       
   596 	}
       
   597 
       
   598 /**
       
   599 Returns whether the mount (and any extensions) support file caching
       
   600 */
       
   601 inline TInt CMountCB::LocalBufferSupport(CFileCB* aFile)
       
   602 	{
       
   603 	TAny* dummyInterface;
       
   604 	return GetInterface(ELocalBufferSupport, dummyInterface, aFile);
       
   605 	}
       
   606 
       
   607 inline TInt CMountCB::MountControl(TInt /*aLevel*/, TInt /*aOption*/, TAny* /*aParam*/)
       
   608     {
       
   609     return KErrNotSupported;
       
   610     }
       
   611 
       
   612 
       
   613 inline void CMountCB::FinaliseMountL(TInt aOperation, TAny* /*aParam1=NULL*/, TAny* /*aParam2=NULL*/) 
       
   614     {
       
   615     if(aOperation == RFs::EFinal_RW)
       
   616         {//-- call the legacy method
       
   617         FinaliseMountL();
       
   618         return;
       
   619         }
       
   620     
       
   621     User::Leave(KErrNotSupported);
       
   622     }
       
   623 
       
   624 inline TInt CMountCB::CheckDisk(TInt /*aOperation*/, TAny* /*aParam1=NULL*/, TAny* /*aParam2=NULL*/) 
       
   625     {
       
   626     return(KErrNotSupported);
       
   627     }	
       
   628 
       
   629 inline TInt CMountCB::ScanDrive(TInt /*aOperation*/, TAny* /*aParam1=NULL*/, TAny* /*aParam2=NULL*/) 
       
   630     {
       
   631     return(KErrNotSupported);
       
   632     }	
       
   633 
       
   634 //---------------------------------------------------------------------------------------------------------------------------------
       
   635 // Class CFileCB
       
   636 
       
   637 /**
       
   638 Sets the mount associated with the file.
       
   639 
       
   640 @param aMount The mount.
       
   641 */
       
   642 inline void CFileCB::SetMount(CMountCB * aMount)
       
   643 	{iMount=aMount;}
       
   644 
       
   645 /**
       
   646 Gets a reference to the object representing the drive on which
       
   647 the file resides.
       
   648 
       
   649 @return A reference to the file's drive.
       
   650 */
       
   651 inline TDrive& CFileCB::Drive() const
       
   652 	{return(*iDrive);}
       
   653 
       
   654 
       
   655 
       
   656 
       
   657 /**
       
   658 Gets a reference to the object representing the drive on which the file was created.
       
   659 
       
   660 The 'created drive' is only different from the 'drive', as returned by Drive(), if 
       
   661 the 'drive' was a substitute for the 'created drive' in the file server session.
       
   662 
       
   663 @return A reference to the drive on which the file was created.
       
   664 */
       
   665 inline TDrive& CFileCB::CreatedDrive() const
       
   666 	{return(*iCreatedDrive);}
       
   667 
       
   668 
       
   669 
       
   670 
       
   671 /**
       
   672 Gets a reference to the object representing the mount on which the file resides.
       
   673 
       
   674 @return The file's mount.
       
   675 */
       
   676 inline CMountCB& CFileCB::Mount() const
       
   677 	{return(*iMount);}
       
   678 
       
   679 
       
   680 
       
   681 
       
   682 /**
       
   683 Gets a reference to a heap descriptor containing the full file name.
       
   684 
       
   685 @return A heap descriptor containing the full file name.
       
   686 */
       
   687 inline HBufC& CFileCB::FileName() const
       
   688 	{return(*iFileName);}
       
   689 
       
   690 /**
       
   691 Gets a reference to a heap descriptor containing the folded full file name.
       
   692 
       
   693 @return A heap descriptor containing the full file name.
       
   694 */
       
   695 inline HBufC& CFileCB::FileNameF() const
       
   696 	{return(*iFileNameF);}
       
   697 
       
   698 /**
       
   699 Gets the hash of the folded filename
       
   700 
       
   701 @return hash of the folded file name
       
   702 */
       
   703 inline TUint32 CFileCB::NameHash() const
       
   704 	{return(iNameHash);}
       
   705 
       
   706 
       
   707 /**
       
   708 Gets a reference to the file share lock being used by the file.
       
   709 
       
   710 @return The file share lock.
       
   711 */
       
   712 inline RArray<SFileShareLock>& CFileCB::Lock()
       
   713 	{return(*iLock);}
       
   714 
       
   715 
       
   716 
       
   717 
       
   718 /**
       
   719 Gets the file object's unique ID, as returned by CObject::UniqueID().
       
   720 
       
   721 @return The object's unique ID.
       
   722 
       
   723 @see CObject
       
   724 */
       
   725 inline TInt CFileCB::UniqueID() const
       
   726 	{return(CFsObject::UniqueID());}
       
   727 
       
   728 
       
   729 
       
   730 
       
   731 /**
       
   732 Gets the iShare value, which defines the level of access allowed to the file.
       
   733 
       
   734 @return The value of iShare
       
   735 
       
   736 @see CFileCB::iShare
       
   737 */
       
   738 inline TShare CFileCB::Share() const
       
   739 	{return(iShare);}
       
   740 
       
   741 
       
   742 
       
   743 
       
   744 /**
       
   745 Sets the iShare value, which defines the level of access allowed to the file.
       
   746 
       
   747 @param aShare The new value.
       
   748 
       
   749 @see CFileCB::iShare
       
   750 */
       
   751 inline void CFileCB::SetShare(TShare aShare)
       
   752 	{iShare=aShare;}
       
   753 
       
   754 
       
   755 
       
   756 
       
   757 /**
       
   758 Gets the size of the file.
       
   759 
       
   760 @return The size of the file.
       
   761 */
       
   762 inline TInt CFileCB::Size() const
       
   763 	{return(iSize);}
       
   764 
       
   765 
       
   766 
       
   767 
       
   768 /**
       
   769 Sets the size of the file.
       
   770 
       
   771 @param aSize The size of the file.
       
   772 */
       
   773 inline void CFileCB::SetSize(TInt aSize)
       
   774 	{iSize=aSize;}
       
   775 
       
   776 
       
   777 
       
   778 
       
   779 /**
       
   780 Gets the file's attributes.
       
   781 
       
   782 @return An integer containing the file attribute bit mask.
       
   783 */
       
   784 inline TInt CFileCB::Att() const
       
   785 	{return(iAtt);}
       
   786 
       
   787 
       
   788 
       
   789 
       
   790 /**
       
   791 Sets the file's attributes.
       
   792 
       
   793 @param aAtt The file attribute bit mask.
       
   794 */
       
   795 inline void CFileCB::SetAtt(TInt aAtt)
       
   796 	{iAtt=aAtt;}	
       
   797 
       
   798 
       
   799 
       
   800 
       
   801 /**
       
   802 Gets the universal time when the file was last modified.
       
   803 
       
   804 @return The universal time when the file was last modiified.
       
   805 */
       
   806 inline TTime CFileCB::Modified() const 
       
   807 	{return(iModified);}
       
   808 
       
   809 
       
   810 
       
   811 
       
   812 /**
       
   813 Sets the universal time when the file was last modified.
       
   814 
       
   815 @param aModified The universal time when the file was last modified.
       
   816 */
       
   817 inline void CFileCB::SetModified(TTime aModified)
       
   818 	{iModified=aModified;}
       
   819 
       
   820 
       
   821 
       
   822 
       
   823 /**
       
   824 Tests whether the file is corrupt.
       
   825 
       
   826 @return ETrue if the file is corrupt; EFalse otherwise.
       
   827 */
       
   828 inline TBool CFileCB::FileCorrupt() const
       
   829 	{return iFileCorrupt;}
       
   830 
       
   831 
       
   832 
       
   833 
       
   834 /**
       
   835 Sets whether the file is corrupt.
       
   836 
       
   837 @param aFileCorrupt ETrue, if the file is corrupt; EFalse, otherwise.
       
   838 */
       
   839 inline void CFileCB::SetFileCorrupt(TBool aFileCorrupt)
       
   840 	{iFileCorrupt=aFileCorrupt;}
       
   841 
       
   842 
       
   843 
       
   844 
       
   845 /**
       
   846 Gets the iBadPower value.
       
   847 
       
   848 @return The value of iBadPower
       
   849 
       
   850 @see CFileCB::iBadPower
       
   851 */
       
   852 inline TBool CFileCB::BadPower() const
       
   853 	{return (iBadPower);}
       
   854 
       
   855 
       
   856 
       
   857 
       
   858 /**
       
   859 Sets the iBadPower value.
       
   860 
       
   861 @param aBadPower ETrue, if an operation on the file has failed due
       
   862                  to bad power;
       
   863 				 EFalse if power has been found to be good.
       
   864 
       
   865 @see CFileCB::iBadPower
       
   866 */
       
   867 inline void CFileCB::SetBadPower(TBool aBadPower)
       
   868 	{iBadPower=aBadPower;}
       
   869 
       
   870 
       
   871 /**
       
   872 Retrieves the BlockMap of a file.
       
   873 
       
   874 @param aInfo
       
   875 
       
   876 @param aStartPos
       
   877 
       
   878 @param aEndPos
       
   879 
       
   880 @return 
       
   881 */
       
   882 inline TInt CFileCB::BlockMap(SBlockMapInfo& aInfo, TInt64& aStartPos, TInt64 aEndPos)
       
   883 	{
       
   884 	TAny* pM;
       
   885 	TInt r = GetInterface(EBlockMapInterface, pM, (TAny*) this);
       
   886 	if (KErrNone!=r)
       
   887 		return r;
       
   888 	return reinterpret_cast<CFileCB::MBlockMapInterface*>(pM)->BlockMap(aInfo, aStartPos, aEndPos);
       
   889 	}
       
   890 
       
   891 
       
   892 /**
       
   893 Retrieves TBusLocalDrive object associated with an open file.
       
   894 */
       
   895 inline TInt CFileCB::LocalDrive(TBusLocalDrive*& aLocalDrive)
       
   896 	{
       
   897 	aLocalDrive = NULL;
       
   898 	return GetInterface(EGetLocalDrive, (TAny*&) aLocalDrive, NULL);
       
   899 	}
       
   900 
       
   901 //---------------------------------------------------------------------------------------------------------------------------------
       
   902 // Class RLocalMessage
       
   903 inline RLocalMessage::RLocalMessage()
       
   904 	{iHandle = KLocalMessageHandle; iFunction=-1;}
       
   905 
       
   906 //---------------------------------------------------------------------------------------------------------------------------------
       
   907 // Class CFileShare
       
   908 /**
       
   909 Gets a reference to the object representing an open file that is being shared.
       
   910 
       
   911 @return A reference to the shared file.
       
   912 */
       
   913 inline CFileCB& CFileShare::File()
       
   914 	{return(*iFile);}
       
   915 
       
   916 
       
   917 //---------------------------------------------------------------------------------------------------------------------------------
       
   918 // Class CDirCB
       
   919 
       
   920 /**
       
   921 Gets a reference to the object representing the drive on which
       
   922 the directory resides.
       
   923 
       
   924 @return A reference to the directory's drive.
       
   925 */
       
   926 inline TDrive& CDirCB::Drive() const
       
   927 	{return(*iDrive);}
       
   928 
       
   929 
       
   930 
       
   931 
       
   932 /**
       
   933 Gets a reference to the object representing the mount on which
       
   934 the directory resides.
       
   935 
       
   936 @return A reference to the directory's mount.
       
   937 */
       
   938 inline CMountCB& CDirCB::Mount() const
       
   939 	{return(*iMount);}
       
   940 
       
   941 
       
   942 
       
   943 
       
   944 /**
       
   945 Tests whether the preceding entry details should be returned when
       
   946 multiple entries are being read.
       
   947 
       
   948 @return True if the preceding entry details should be returned;
       
   949         false otherwise.
       
   950 */
       
   951 inline TBool CDirCB::Pending() const
       
   952 	{return iPending;}
       
   953 
       
   954 
       
   955 
       
   956 
       
   957 /**
       
   958 Sets whether the preceding entry details should be returned when
       
   959 multiple entries are being read.
       
   960 
       
   961 @param aPending ETrue if the preceding entry details should be returned;
       
   962                 EFalse otherwise.
       
   963 */
       
   964 inline void CDirCB::SetPending(TBool aPending)
       
   965 	{iPending=aPending;}
       
   966 
       
   967 
       
   968 
       
   969 //---------------------------------------------------------------------------------------------------------------------------------
       
   970 // class CFormatCB
       
   971 
       
   972 /**
       
   973 Gets the object representing the drive on which the disk to
       
   974 be formatted resides.
       
   975 
       
   976 @return The drive for the format action.
       
   977 */
       
   978 inline TDrive& CFormatCB::Drive()  const
       
   979 	{return(*iDrive);}
       
   980 
       
   981 
       
   982 
       
   983 
       
   984 /**
       
   985 Gets the object representing the mount on which the disk to
       
   986 be formatted resides.
       
   987 
       
   988 @return The mount for the format action.
       
   989 */
       
   990 inline CMountCB& CFormatCB::Mount()  const
       
   991 	{return(*iMount);}
       
   992 
       
   993 
       
   994 
       
   995 
       
   996 /**
       
   997 Gets the mode of the format operation.
       
   998 
       
   999 @return The value of the format mode.
       
  1000 */
       
  1001 inline TFormatMode CFormatCB::Mode()  const
       
  1002 	{return(iMode);}
       
  1003 
       
  1004 
       
  1005 
       
  1006 
       
  1007 /**
       
  1008 Gets the current stage in the format operation.
       
  1009 
       
  1010 @return The stage the current format operation has reached.
       
  1011 */
       
  1012 inline TInt& CFormatCB::CurrentStep() 
       
  1013 	{return(iCurrentStep);}
       
  1014 
       
  1015 
       
  1016 
       
  1017 //---------------------------------------------------------------------------------------------------------------------------------
       
  1018 // class CRawDiskCB
       
  1019 
       
  1020 /**
       
  1021 Gets a reference to an object representing the drive on which the disk resides.
       
  1022 
       
  1023 @return  A reference to the drive on which the disk resides.
       
  1024 */
       
  1025 inline TDrive& CRawDiskCB::Drive()
       
  1026 	{return(iMount->Drive());}
       
  1027 
       
  1028 
       
  1029 
       
  1030 
       
  1031 /**
       
  1032 Gets an object representing the mount on which the disk resides.
       
  1033 
       
  1034 @return The mount on which the disk resides.
       
  1035 */
       
  1036 inline CMountCB& CRawDiskCB::Mount()
       
  1037 	{return(*iMount);}
       
  1038 
       
  1039 
       
  1040 
       
  1041 
       
  1042 /**
       
  1043 Tests whether the mount on which the disk resides is write protected.
       
  1044 
       
  1045 @return True if the mount is write protected, false otherwise.
       
  1046 */
       
  1047 inline TBool CRawDiskCB::IsWriteProtected() const
       
  1048 	{ return(iFlags & EWriteProtected); }
       
  1049 
       
  1050 
       
  1051 
       
  1052 
       
  1053 
       
  1054 /**
       
  1055 Stores the write protected state of the disk.
       
  1056 */
       
  1057 inline void CRawDiskCB::SetWriteProtected()
       
  1058 	{ iFlags |= EWriteProtected; }
       
  1059 
       
  1060 
       
  1061 
       
  1062 
       
  1063 /**
       
  1064 Tests whether the disk contents has changed (due to a write operation)
       
  1065 
       
  1066 @return True if the disk contents has changed
       
  1067 */
       
  1068 inline TBool CRawDiskCB::IsChanged() const
       
  1069 	{ return(iFlags & EChanged); }
       
  1070 
       
  1071 
       
  1072 
       
  1073 
       
  1074 /**
       
  1075 Set a flag to state that the disk contents has changed (due to a write operation)
       
  1076 */
       
  1077 inline void CRawDiskCB::SetChanged()
       
  1078 	{ iFlags |= EChanged; }
       
  1079 
       
  1080 
       
  1081 
       
  1082 //---------------------------------------------------------------------------------------------------------------------------------
       
  1083 // class CProxyDriveFactory
       
  1084 /**
       
  1085 Sets the Library (DLL) handle to be used by the CProxyDriveFactory
       
  1086 */
       
  1087 inline void CProxyDriveFactory::SetLibrary(RLibrary aLib)
       
  1088 	{iLibrary=aLib;}
       
  1089 /**
       
  1090 Gets the Library (DLL) handle in use by the CProxyDriveFactory
       
  1091 @return Library (DLL) handle 
       
  1092 */
       
  1093 inline RLibrary CProxyDriveFactory::Library() const
       
  1094 	{return(iLibrary);}
       
  1095 
       
  1096 //---------------------------------------------------------------------------------------------------------------------------------
       
  1097 // class CProxyDrive
       
  1098 /**
       
  1099 Gets the mount control block object for a specific volume on a drive.
       
  1100 	
       
  1101 @return either a currently mounted volume in the system or the volume that has been removed but still has
       
  1102 subsession objects open.
       
  1103 */
       
  1104 inline CMountCB* CProxyDrive::Mount() const
       
  1105 	{return(iMount);}
       
  1106 
       
  1107 
       
  1108 /**
       
  1109 Returns wheher the drive (and any extensions) support file caching
       
  1110 */
       
  1111 inline TInt CProxyDrive::LocalBufferSupport()
       
  1112 	{
       
  1113 	TAny* dummyInterface;
       
  1114 	return GetInterface(ELocalBufferSupport, dummyInterface, NULL);
       
  1115 	}
       
  1116 
       
  1117 /**
       
  1118 return whether proxy drive supports file caching
       
  1119 */
       
  1120 inline TInt CBaseExtProxyDrive::LocalBufferSupport()
       
  1121 	{
       
  1122 	return iProxy->LocalBufferSupport();
       
  1123 	}
       
  1124 
       
  1125 //---------------------------------------------------------------------------------------------------------------------------------
       
  1126 // class CLocDrvMountCB
       
  1127 /**
       
  1128 Gets the mounted local drive object
       
  1129 
       
  1130 @return The local drive.
       
  1131 */
       
  1132 inline CProxyDrive* CLocDrvMountCB::LocalDrive() const
       
  1133 	{return(iProxyDrive);}	
       
  1134 
       
  1135 inline TDismountParams::TDismountParams(TInt aDriveNumber, TDrive* aDrivePointer, TBool aForcedDismount, RMessage2* aForcedMessage)
       
  1136 	{
       
  1137 	iDriveNumber	= aDriveNumber;
       
  1138 	iDrivePointer	= aDrivePointer;
       
  1139 	iForcedDismount	= aForcedDismount;
       
  1140 	iForcedMessage	= aForcedMessage;
       
  1141 	}
       
  1142 
       
  1143 //---------------------------------------------------------------------------------------------------------------------------------	
       
  1144 // class CFsObject
       
  1145 inline CFsObjectCon* CFsObject::Container() const
       
  1146 	{return iContainer;}
       
  1147 inline TInt CFsObject::Inc()
       
  1148 	{return(User::SafeInc(iAccessCount));}
       
  1149 inline TInt CFsObject::Dec()
       
  1150 	{return(User::SafeDec(iAccessCount));}