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