userlibandfileserver/fileserver/sfat/inc/sl_std.inl
changeset 15 4122176ea935
parent 0 a41df078684a
--- a/userlibandfileserver/fileserver/sfat/inc/sl_std.inl	Mon Oct 19 15:55:17 2009 +0100
+++ b/userlibandfileserver/fileserver/sfat/inc/sl_std.inl	Mon Dec 21 16:14:42 2009 +0000
@@ -15,6 +15,14 @@
 // 
 //
 
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!
+//!! WARNING!! DO NOT edit this file !! '\sfat' component is obsolete and is not being used. '\sfat32'replaces it
+//!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
 #ifndef SL_STD_INL
 #define SL_STD_INL
 
@@ -22,8 +30,8 @@
 
 TBool IsPowerOf2(TUint32 aVal)
     {
-	if (aVal==0)
-		return EFalse;
+    if (aVal==0)
+        return EFalse;
 
     return !(aVal & (aVal-1));
     }
@@ -68,7 +76,7 @@
 
 
 inline TInt CFatMountCB::StartCluster(const TFatDirEntry & anEntry) const
-	{return anEntry.StartCluster();}
+    {return anEntry.StartCluster();}
 
 
 
@@ -80,18 +88,18 @@
 @return Whether Root dir position or not
 */
 TBool CFatMountCB::IsRootDir(const TEntryPos &aEntry) const
-	{return((aEntry.iCluster==0) ? (TBool)ETrue : (TBool)EFalse);}
+    {return((aEntry.iCluster==0) ? (TBool)ETrue : (TBool)EFalse);}
 
 /**
 Indicates the root directory cluster, For Fat12/16 root is always indicated by cluster number zero
 @return The root cluster indicator
 */
 TInt CFatMountCB::RootIndicator() const
-	{return 0;}
+    {return 0;}
 
    
 TBool CFatMountCB::Is16BitFat() const
-	{return(iFatType == EFat16);}
+    {return(iFatType == EFat16);}
 
 /** @return Log2 of cluster size on volume */
 TInt CFatMountCB::ClusterSizeLog2() const
@@ -107,11 +115,11 @@
 
 /** @return the base position of a cluster */
 TInt CFatMountCB::ClusterBasePosition() const
-	{return(iFirstFreeByte);}
+    {return(iFirstFreeByte);}
 
 /** @return the offset into a cluster of a byte address */
 TInt CFatMountCB::ClusterRelativePos(TInt aPos) const
-	{return(aPos&((1<<ClusterSizeLog2())-1));}
+    {return(aPos&((1<<ClusterSizeLog2())-1));}
 
 /**
 Calculates the maximum number of clusters
@@ -134,7 +142,7 @@
 
 /** @return the byte offset of the Fat */
 TInt CFatMountCB::StartOfFatInBytes() const
-	{return(FirstFatSector()<<SectorSizeLog2());}
+    {return(FirstFatSector()<<SectorSizeLog2());}
 
 /** @return Number of Fats used by the volume */
 TInt CFatMountCB::NumberOfFats() const
@@ -143,42 +151,42 @@
 
 /** @return refrence to the fat table owned by the mount */
 CFatTable& CFatMountCB::FAT() const
-	{return(*iFatTable);}
+    {return(*iFatTable);}
 /**
 Returns a refrence to the file system object owned by the coresponding TDrive for a drive used for creating subsession objects
 @return refrence to file system object
 */
 CFatFileSystem& CFatMountCB::FatFileSystem() const
-	{return((CFatFileSystem&)Drive().FSys());}
+    {return((CFatFileSystem&)Drive().FSys());}
 
 
 /** @return  refrence to a raw disk object owned by the mount */
 CRawDisk& CFatMountCB::RawDisk() const
-	{return(*iRawDisk);}
+    {return(*iRawDisk);}
 
 /**
 @return ETrue if aCluster value is bad cluster marker defined in FAT specification
 */
 TBool CFatMountCB::IsBadCluster(TInt aCluster) const
-	{return Is16BitFat() ? aCluster==0xFFF7 : aCluster==0xFF7;}
+    {return Is16BitFat() ? aCluster==0xFFF7 : aCluster==0xFF7;}
 
 /**
 Returns whether the current mount is running as rugged Fat or not, this is held in the file system object
 @return Is rugged fat flag
 */
 TBool CFatMountCB::IsRuggedFSys() const
-	{return Drive().IsRugged();}
+    {return Drive().IsRugged();}
 
 /**
 Sets the rugged flag in the file system object
 @param Flag to set or clear the rugged flag
 */
 void CFatMountCB::SetRuggedFSys(TBool aVal)
-	{Drive().SetRugged(aVal);}
+    {Drive().SetRugged(aVal);}
 
 /** @return the usable clusters count for a volume */
 TUint32 CFatMountCB::UsableClusters() const
-	{return(iUsableClusters);}
+    {return(iUsableClusters);}
 
 
 TUint CFatMountCB::StartOfRootDirInBytes() const
@@ -192,7 +200,7 @@
 }
 
 CAsyncNotifier* CFatMountCB::Notifier() const
-	{return iNotifier;}	
+    {return iNotifier;} 
 
 
 /**
@@ -209,9 +217,9 @@
     @return ETrue if the volume is in Read-Only state
 */
 TBool CFatMountCB::ReadOnly(void) const
-	{
+    {
     return iReadOnly;
-	}
+    }
 
 /** @return state of the CFatMountCB*/
 CFatMountCB::TFatMntState CFatMountCB::State() const 
@@ -245,61 +253,61 @@
 Check if the XFileCreationHelper object is initialised.
 */
 TBool CFatMountCB::XFileCreationHelper::IsInitialised() const 
-	{
-	return isInitialised;
-	}
+    {
+    return isInitialised;
+    }
 
 /** 
 Get number of new entries for file creation.
 */
-TUint16	CFatMountCB::XFileCreationHelper::NumOfAddingEntries() const
-	{
-	ASSERT(isInitialised); 
-	return iNumOfAddingEntries;
-	}
+TUint16 CFatMountCB::XFileCreationHelper::NumOfAddingEntries() const
+    {
+    ASSERT(isInitialised); 
+    return iNumOfAddingEntries;
+    }
 
 /** 
 Get position of new entries for file creation.
 */
 TEntryPos CFatMountCB::XFileCreationHelper::EntryAddingPos() const 
-	{
-	ASSERT(isInitialised); 
-	return iEntryAddingPos;
-	}
+    {
+    ASSERT(isInitialised); 
+    return iEntryAddingPos;
+    }
 
 /** 
 Check if position of new entries has been found.
 */
 TBool CFatMountCB::XFileCreationHelper::IsNewEntryPosFound() const 
-	{
-	ASSERT(isInitialised); 
-	return isNewEntryPosFound;
-	}
+    {
+    ASSERT(isInitialised); 
+    return isNewEntryPosFound;
+    }
 
 /** 
 Check if file name of the new file is a legal dos name.
 */
 TBool CFatMountCB::XFileCreationHelper::IsTrgNameLegalDosName() const
-	{
-	ASSERT(isInitialised); 
-	return isTrgNameLegalDosName;
-	}
+    {
+    ASSERT(isInitialised); 
+    return isTrgNameLegalDosName;
+    }
 
 /** 
 Set entry position for new entries to be added.
 */
 void CFatMountCB::XFileCreationHelper::SetEntryAddingPos(const TEntryPos& aEntryPos) 
-	{
-	iEntryAddingPos = aEntryPos;
-	}
+    {
+    iEntryAddingPos = aEntryPos;
+    }
 
 /** 
 Set condition if position of new entries has been found.
 */
 void CFatMountCB::XFileCreationHelper::SetIsNewEntryPosFound(TBool aFound) 
-	{
-	isNewEntryPosFound = aFound;
-	}
+    {
+    isNewEntryPosFound = aFound;
+    }
 
 
 
@@ -310,39 +318,39 @@
 @return ETrue if write fails on or not
 */
 TBool CFatMountCB::IsWriteFail()const
-	{return(iIsWriteFail);}
+    {return(iIsWriteFail);}
 /**
 Switches write fails on or off, for test
 @param aIsWriteFail set true or false to set write fails on or off
 */
 void CFatMountCB::SetWriteFail(TBool aIsWriteFail)
-	{iIsWriteFail=aIsWriteFail;}
+    {iIsWriteFail=aIsWriteFail;}
 
 /** @return number of write fails to occur, for test */
 TInt CFatMountCB::WriteFailCount()const
-	{return(iWriteFailCount);}
+    {return(iWriteFailCount);}
 
 /**
 Set the number of Write fails 
 @param aFailCount number of write fails, for test
 */
 void CFatMountCB::SetWriteFailCount(TInt aFailCount)
-	{iWriteFailCount=aFailCount;}
+    {iWriteFailCount=aFailCount;}
 
 /** Decrement the number of write fails, for test */
 void CFatMountCB::DecWriteFailCount()
-	{--iWriteFailCount;}
+    {--iWriteFailCount;}
 
 /** @return Error for a write failure, for test */
 TInt CFatMountCB::WriteFailError()const
-	{return iWriteFailError;}
+    {return iWriteFailError;}
 
 /**
 Set the write fail error code, for test
 @param aErrorValue The Error for a write fails
 */
 void CFatMountCB::SetWriteFailError(TInt aErrorValue)
-	{iWriteFailError=aErrorValue;}
+    {iWriteFailError=aErrorValue;}
 
 #endif
 
@@ -354,14 +362,14 @@
     {return(iFileSystemName==KFileSystemName16);}
 
 CFatMountCB& CFatFormatCB::FatMount()
-	{return *(CFatMountCB*)&Mount();}
+    {return *(CFatMountCB*)&Mount();}
 
 /**
 Returns the local drive used by the file systems from the owning mount
 @return Pointer to the local drive 
 */
 CProxyDrive* CFatFormatCB::LocalDrive()
-	{return(FatMount().LocalDrive());}
+    {return(FatMount().LocalDrive());}
 
 
 //---------------------------------------------------------------------------------------------------------------------------------
@@ -373,7 +381,7 @@
 @return pointer to the owning mount object
 */
 CFatMountCB& CFatFileCB::FatMount() const
-	{return((CFatMountCB&)Mount());}
+    {return((CFatMountCB&)Mount());}
 
 /**
 Returns the fat table used by the file system for this mount
@@ -381,7 +389,7 @@
 @return Refrence to the Fat table owned by the mount
 */
 CFatTable& CFatFileCB::FAT()
-	{return(FatMount().FAT());}
+    {return(FatMount().FAT());}
 
 /**
 Position with in a cluster for a given address
@@ -389,14 +397,14 @@
 @param aPos Byte position 
 */
 TInt CFatFileCB::ClusterRelativePos(TInt aPos)
-	{return(FatMount().ClusterRelativePos(aPos));}
+    {return(FatMount().ClusterRelativePos(aPos));}
 /**
 Returns Log2 of cluster size from mount
 
 @return cluster size
 */
 TInt CFatFileCB::ClusterSizeLog2()
-	{return(FatMount().ClusterSizeLog2());}
+    {return(FatMount().ClusterSizeLog2());}
 
 /*
  Note: this replaces SeekIndex() which was only used in sl_mnt
@@ -415,7 +423,7 @@
 @return pointer to the owning mount object
 */
 CFatMountCB& CFatDirCB::FatMount()
-	{return((CFatMountCB&)Mount());}
+    {return((CFatMountCB&)Mount());}
 
 
 
@@ -429,13 +437,13 @@
 
 
 TBool CFatTable::IsEof16Bit(TInt aCluster) const
-	{return(aCluster>=0xFFF8 && aCluster<=0xFFFF);}
+    {return(aCluster>=0xFFF8 && aCluster<=0xFFFF);}
 
 TBool CFatTable::IsEof12Bit(TInt aCluster) const
-	{return(aCluster>=0xFF8 && aCluster<=0xFFF);}
+    {return(aCluster>=0xFF8 && aCluster<=0xFFF);}
 
 TInt CFatTable::SectorSizeLog2() const
-	{return(iOwner->SectorSizeLog2());}
+    {return(iOwner->SectorSizeLog2());}
 
 //---------------------------------------------------------------------------------------------------------------------------------
 
@@ -465,7 +473,7 @@
 
 // class TFatDriveInterface
 TBool TFatDriveInterface::NotifyUser() const
-	{return(iMount->GetNotifyUser());}
+    {return(iMount->GetNotifyUser());}
 
 
 
@@ -484,7 +492,7 @@
     return NULL;
     }
 
-//---------------------------------------------------------------------------------------------------------------------------------	
+//--------------------------------------------------------------------------------------------------------------------------------- 
 //-- class RBitVector
 
 /** @return size of the vector (number of bits) */
@@ -574,13 +582,13 @@
 /**
     Calculate offset of the page starting position in the cluster 
     @param aPos  the current entry position in bytes in the cluster
-    @param aPageSzLog2	page size in log2
-    @return		the starting position of the page that contains aPos
+    @param aPageSzLog2  page size in log2
+    @return     the starting position of the page that contains aPos
 */
 inline TUint32 CalculatePageOffsetInCluster(TUint32 aPos, TUint aPageSzLog2)
-	{
-	return (aPos >> aPageSzLog2) << aPageSzLog2;
-	}
+    {
+    return (aPos >> aPageSzLog2) << aPageSzLog2;
+    }
 
 #endif //SL_STD_INL