userlibandfileserver/fileserver/sfat/inc/sl_std.h
changeset 15 4122176ea935
parent 0 a41df078684a
--- a/userlibandfileserver/fileserver/sfat/inc/sl_std.h	Mon Oct 19 15:55:17 2009 +0100
+++ b/userlibandfileserver/fileserver/sfat/inc/sl_std.h	Mon Dec 21 16:14:42 2009 +0000
@@ -20,6 +20,15 @@
  @internalTechnology
 */
 
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!
+//!! WARNING!! DO NOT edit this file !! '\sfat' component is obsolete and is not being used. '\sfat32'replaces it
+//!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+
 #ifndef SL_STD_H
 #define SL_STD_H
 
@@ -81,13 +90,13 @@
 
     //-- public interface to the local drive. Provides media driver's error handling (critical and non-critical user notifiers)
     //-- and thread-safety if required.
-	TInt ReadNonCritical(TInt64 aPos,TInt aLength,const TAny* aTrg,const RMessagePtr2 &aMessage,TInt anOffset) const;
-	TInt ReadNonCritical(TInt64 aPos,TInt aLength,TDes8& aTrg) const;
+    TInt ReadNonCritical(TInt64 aPos,TInt aLength,const TAny* aTrg,const RMessagePtr2 &aMessage,TInt anOffset) const;
+    TInt ReadNonCritical(TInt64 aPos,TInt aLength,TDes8& aTrg) const;
     TInt ReadCritical(TInt64 aPos,TInt aLength,TDes8& aTrg) const;
-	
+    
     TInt WriteCritical(TInt64 aPos,const TDesC8& aSrc);
     TInt WriteNonCritical(TInt64 aPos,TInt aLength,const TAny* aSrc,const RMessagePtr2 &aMessage,TInt anOffset);
-	
+    
     TInt GetLastErrorInfo(TDes8& aErrorInfo) const;
 
     //-- lock the mutex guarding CProxyDrive interface in order to be sure that no other thread can access it.
@@ -114,8 +123,8 @@
     TBool IsRecoverableRemount() const;
 
 private:
-	
-	/** 
+    
+    /** 
         An internal class that represents a thread-safe wrapper around raw interface to the CProxyDrive 
         and restricts access to it.
     */
@@ -158,16 +167,16 @@
 class CFatTable : public CBase
     {
 public:
-	static CFatTable* NewL(CFatMountCB& aOwner, const TLocalDriveCaps& aLocDrvCaps);
+    static CFatTable* NewL(CFatMountCB& aOwner, const TLocalDriveCaps& aLocDrvCaps);
 
     virtual ~CFatTable();
 
-	/** Empty and deallocate the cache*/
-	virtual void Dismount(TBool /*aDiscardDirtyData*/) {}
+    /** Empty and deallocate the cache*/
+    virtual void Dismount(TBool /*aDiscardDirtyData*/) {}
     
-	/** Flush data cahed data to the media */
-	virtual void FlushL() {};
-	
+    /** Flush data cahed data to the media */
+    virtual void FlushL() {};
+    
     /**
     Invalidate specified region of the FAT cache
     Depending of cache type this may just mark part of the cache invalid with reading on demand later
@@ -176,7 +185,7 @@
     @param aPos absolute media position where the region being invalidated starts.
     @param aLength length in bytes of region to invalidate / refresh
     */
-	virtual void InvalidateCacheL(TInt64 /*aPos*/,TUint32 /*aLength*/) {};
+    virtual void InvalidateCacheL(TInt64 /*aPos*/,TUint32 /*aLength*/) {};
 
     
     /**
@@ -184,50 +193,50 @@
     Depending of cache type this may just mark cache invalid with reading on demand or re-read whole cache from the media
     */
     virtual void InvalidateCacheL() {};
-	
+    
 
     /**
-	Gets the next cluster in a cluster chain
+    Gets the next cluster in a cluster chain
 
-	@param aCluster	Cluster number to start lookup. On return contains number of the next cluster.
-	@return EFalse if cluster is at the end of a cluster chain
+    @param aCluster Cluster number to start lookup. On return contains number of the next cluster.
+    @return EFalse if cluster is at the end of a cluster chain
     */
     virtual TBool GetNextClusterL(TInt& aCluster) const;
-	
+    
     /**
     Writes end of cluster chain
-	@param aFatIndex index in Fat table where EOF will be written to.
+    @param aFatIndex index in Fat table where EOF will be written to.
     */
-	virtual void WriteFatEntryEofL(TUint32 aFatIndex);
+    virtual void WriteFatEntryEofL(TUint32 aFatIndex);
 
     /** 
-	Read an entry from the FAT.
+    Read an entry from the FAT.
 
-	@param aFatIndex aFatIndex index in Fat table
-	@return value of the FAT entry number aFatIndex
+    @param aFatIndex aFatIndex index in Fat table
+    @return value of the FAT entry number aFatIndex
     */
-	virtual TUint32 ReadL(TUint32 aFatIndex) const = 0;
-	
+    virtual TUint32 ReadL(TUint32 aFatIndex) const = 0;
+    
     /**
-	Write FAT entry to FAT by its index.
+    Write FAT entry to FAT by its index.
 
-	@param aFatIndex index in FAT
+    @param aFatIndex index in FAT
     @param aValue value to write
     */
-	virtual void WriteL(TUint32 aFatIndex, TUint32 aValue) = 0;
-	
+    virtual void WriteL(TUint32 aFatIndex, TUint32 aValue) = 0;
+    
     /**
     return the byte position of a cluster in the fat table
 
     @param aCluster cluster to find position of
     @return byte position of the cluster
     */
-	virtual TInt64 DataPositionInBytes(TUint32 aCluster) const = 0;
+    virtual TInt64 DataPositionInBytes(TUint32 aCluster) const = 0;
 
-	virtual void FreeClusterListL(TUint32 aCluster);
-	virtual void ExtendClusterListL(TUint32 aNumber,TInt& aCluster);
-	virtual TUint32 AllocateSingleClusterL(TUint32 aNearestCluster);
-	virtual TUint32 AllocateClusterListL(TUint32 aNumber,TUint32 aNearestCluster);
+    virtual void FreeClusterListL(TUint32 aCluster);
+    virtual void ExtendClusterListL(TUint32 aNumber,TInt& aCluster);
+    virtual TUint32 AllocateSingleClusterL(TUint32 aNearestCluster);
+    virtual TUint32 AllocateClusterListL(TUint32 aNumber,TUint32 aNearestCluster);
     virtual void CountFreeClustersL();
 
     virtual void RequestRawWriteAccess(TInt64 /*aPos*/, TUint32 /*aLen*/) const {};
@@ -261,7 +270,7 @@
     
 
     void DecrementFreeClusterCount(TUint32 aCount); 
-	void IncrementFreeClusterCount(TUint32 aCount);
+    void IncrementFreeClusterCount(TUint32 aCount);
 
     inline TUint32 FreeClusters() const;
 
@@ -290,7 +299,7 @@
 private:   
 
     TUint32  iFreeClusters;     ///< Number of free cluster in the fat table
-	TUint32  iFreeClusterHint;  ///< Next free custer in the fat table, just for use in TFsInfo; This is just a hint, not required to contain exact information.
+    TUint32  iFreeClusterHint;  ///< Next free custer in the fat table, just for use in TFsInfo; This is just a hint, not required to contain exact information.
     TFatType iFatType;          ///< FAT type 12/16/32, cached from the iOwner
     TUint32  iMaxEntries;       ///< maximal number of FAT entries in the table. This value is taken from the CFatMount that calculates it
     
@@ -312,48 +321,48 @@
     static CRawDisk* NewL(CFatMountCB& aOwner, const TLocalDriveCaps& aLocDrvCaps);
 
     virtual void InitializeL();
-	
+    
     virtual TInt GetLastErrorInfo(TDes8& aErrorInfo) const;
 public:
-	
+    
     /**
-	Read data from the media via simple WT data cache if it is present. Some media types, like RAM do not have caches.
+    Read data from the media via simple WT data cache if it is present. Some media types, like RAM do not have caches.
     This method is mostly used to read UIDs of executable modules and store them in the cache.
 
-	@param aPos		Media position in bytes
+    @param aPos     Media position in bytes
     @param aLength  Length in bytes of read
     @param aDes     Data from read
     */
-	virtual void ReadCachedL(TInt64 aPos,TInt aLength,TDes8& aDes) const = 0;
-	
+    virtual void ReadCachedL(TInt64 aPos,TInt aLength,TDes8& aDes) const = 0;
+    
     /**
-	Write data to the media via simple WT data cache if it is present. Some media types, like RAM do not have caches.
-	@param aPos		Media position in bytes
+    Write data to the media via simple WT data cache if it is present. Some media types, like RAM do not have caches.
+    @param aPos     Media position in bytes
     @param aDes     Data to write
     */
-	virtual void WriteCachedL(TInt64 aPos,const TDesC8& aDes) = 0;
+    virtual void WriteCachedL(TInt64 aPos,const TDesC8& aDes) = 0;
     
     virtual void InvalidateUidCache() {}
     virtual void InvalidateUidCachePage(TUint64 /*aPos*/) {}
     
 
     /**
-	Disk read function
+    Disk read function
     
-	@param aPos		Media position in bytes
+    @param aPos     Media position in bytes
     @param aLength  Length in bytes of read
-	@param aTrg		Pointer to the data descriptor, i.e. (const TAny*)(&TDes8)
+    @param aTrg     Pointer to the data descriptor, i.e. (const TAny*)(&TDes8)
     @param aMessage Refrence to server message from request
     @param anOffset Offset into read data to write
     */
     virtual void ReadL(TInt64 aPos,TInt aLength,const TAny* aTrg,const RMessagePtr2 &aMessage,TInt anOffset) const = 0;
 
     /**
-	Disk write function
+    Disk write function
 
-	@param aPos		Media position in bytes
+    @param aPos     Media position in bytes
     @param aLength  Length in bytes of write
-	@param aTrg		Pointer to the data descriptor, i.e. (const TAny*)(&TDes8)
+    @param aTrg     Pointer to the data descriptor, i.e. (const TAny*)(&TDes8)
     @param aMessage Refrence to server message from request, contains data
     @param anOffset Offset into write data to use in write
     */
@@ -398,30 +407,30 @@
     TBool operator==(const TFatVolParam& aRhs) const;
 
     //-- simple getters
-	TUint32 ClusterSizeLog2() const     {return iClusterSizeLog2;    }        
-	TUint32 SectorSizeLog2() const      {return iSectorSizeLog2;     }        
-	TUint32 RootDirEnd() const          {return iRootDirEnd;         }        
-	TUint32 SectorsPerCluster() const   {return iSectorsPerCluster;  }        
-	TUint32 RootDirectorySector() const {return iRootDirectorySector;}        
-	TUint32 FirstFatSector() const      {return iFirstFatSector;     }        
-	TUint32 TotalSectors() const        {return iTotalSectors;       }        
-	TUint32 NumberOfFats() const        {return iNumberOfFats;       }        
-	TUint32 FatSizeInBytes() const      {return iFatSizeInBytes;     }        
-	TUint32 RootClusterNum() const      {return iRootClusterNum;     }        
+    TUint32 ClusterSizeLog2() const     {return iClusterSizeLog2;    }        
+    TUint32 SectorSizeLog2() const      {return iSectorSizeLog2;     }        
+    TUint32 RootDirEnd() const          {return iRootDirEnd;         }        
+    TUint32 SectorsPerCluster() const   {return iSectorsPerCluster;  }        
+    TUint32 RootDirectorySector() const {return iRootDirectorySector;}        
+    TUint32 FirstFatSector() const      {return iFirstFatSector;     }        
+    TUint32 TotalSectors() const        {return iTotalSectors;       }        
+    TUint32 NumberOfFats() const        {return iNumberOfFats;       }        
+    TUint32 FatSizeInBytes() const      {return iFatSizeInBytes;     }        
+    TUint32 RootClusterNum() const      {return iRootClusterNum;     }        
     TUint32 FSInfoSectorNum() const     {return iFSInfoSectorNum;    }        
     TUint32 BkFSInfoSectorNum() const   {return iBkFSInfoSectorNum;  }        
     
     protected:
      TUint32 iClusterSizeLog2;      ///< Log2 of fat file system cluster size
-	 TUint32 iSectorSizeLog2;       ///< Log2 of media sector size
-	 TUint32 iRootDirEnd;           ///< End position of the root directory for Fat12/16
-	 TUint32 iSectorsPerCluster;    ///< Sector per cluster ratio for mounted Fat file system volume 
-	 TUint32 iRootDirectorySector;  ///< Start sector of the root directory for Fat12/16
-	 TUint32 iFirstFatSector;       ///< Start sector of the first Fat table in volume
-	 TUint32 iTotalSectors;         ///< Total sectors on media partition
-	 TUint32 iNumberOfFats;         ///< Number of Fats the volume has
-	 TUint32 iFatSizeInBytes;       ///< Size of a single Fat table in volume
-	 TUint32 iRootClusterNum;       ///< Cluster number for Root directory, for Fat32
+     TUint32 iSectorSizeLog2;       ///< Log2 of media sector size
+     TUint32 iRootDirEnd;           ///< End position of the root directory for Fat12/16
+     TUint32 iSectorsPerCluster;    ///< Sector per cluster ratio for mounted Fat file system volume 
+     TUint32 iRootDirectorySector;  ///< Start sector of the root directory for Fat12/16
+     TUint32 iFirstFatSector;       ///< Start sector of the first Fat table in volume
+     TUint32 iTotalSectors;         ///< Total sectors on media partition
+     TUint32 iNumberOfFats;         ///< Number of Fats the volume has
+     TUint32 iFatSizeInBytes;       ///< Size of a single Fat table in volume
+     TUint32 iRootClusterNum;       ///< Cluster number for Root directory, for Fat32
      TUint32 iFSInfoSectorNum;      ///< FSInfo Sector number. If 0, this means that corresponding value isn't set in BPB
      TUint32 iBkFSInfoSectorNum;    ///< backup FSInfo Sector number
     };
@@ -446,7 +455,7 @@
 
 public:
     
-	//-- overrides from the abstract CMountCB
+    //-- overrides from the abstract CMountCB
     void MountL(TBool aForceMount);
     TInt ReMount();
     void Dismounted();
@@ -478,7 +487,7 @@
     void FinaliseMountL();
     void FinaliseMountL(TInt aOperation, TAny* aParam1=NULL, TAny* aParam2=NULL);
     TInt MountControl(TInt aLevel, TInt aOption, TAny* aParam);
-   	TTimeIntervalSeconds TimeOffset() const;
+    TTimeIntervalSeconds TimeOffset() const;
 
 protected:
 
@@ -546,16 +555,16 @@
     inline TInt FatSizeInBytes() const;
     inline TInt ClusterRelativePos(TInt aPos) const;
     inline TUint StartOfRootDirInBytes() const;
-	inline TUint32 UsableClusters() const;
+    inline TUint32 UsableClusters() const;
     inline TBool IsBadCluster(TInt aCluster) const;
     inline TBool IsRuggedFSys() const;
     inline void SetRuggedFSys(TBool aVal);
-	
+    
     inline TInt RootIndicator() const;
     
     inline TBool IsRootDir(const TEntryPos &aEntry) const;
     inline CAsyncNotifier* Notifier() const;
-	inline TFatDriveInterface& DriveInterface() const;
+    inline TFatDriveInterface& DriveInterface() const;
     
     void ReadUidL(TInt aCluster,TEntry& anEntry) const;
     
@@ -585,7 +594,7 @@
     void InitializeRootEntry(TFatDirEntry & anEntry) const;
 
     TInt64 MakeLinAddrL(const TEntryPos& aPos) const;
-	
+    
     inline const TFatConfig& FatConfig() const;
     TBool CheckVolumeTheSame();
     
@@ -628,48 +637,48 @@
 
 
         /** 
-       	An ad hoc internal helper object for entry creations  
+        An ad hoc internal helper object for entry creations  
         */
-	    class XFileCreationHelper
-	    {
-	    public:
-	    	XFileCreationHelper();
-	    	~XFileCreationHelper();
-	    	void Close();
-	    	void InitialiseL(const TDesC&  aTargetName);
-	        TInt GetValidatedShortName(TShortName& aShortName) const;
-	    	void CheckShortNameCandidates(const TUint8* apDosEntryName);
-	
-	        // inline functions for sets and gets
-	        //  note all the get functions have been checked against initialisation status
-	    	inline TBool 	IsInitialised() const;
-	        inline TUint16	NumOfAddingEntries() const;
-	        inline TEntryPos EntryAddingPos()const;
-	        inline TBool 	IsNewEntryPosFound() const;
-	    	inline TBool 	IsTrgNameLegalDosName() const;
-	
-	    	inline void	SetEntryAddingPos(const TEntryPos& aEntryPos);
-	    	inline void	SetIsNewEntryPosFound(TBool aFound);
-	
-	    private:
-	    	XFileCreationHelper(const XFileCreationHelper&);
-	    	XFileCreationHelper& operator=(const TFindHelper&);
-	
-	    private:
-	        TPtrC       iTargetName;		///< pointer to hold the long file name of the target file
-	        TUint16		iNumOfAddingEntries;///< calculated number of entries to add
-	        TEntryPos	iEntryAddingPos;	///< contains new entry position for adding if found any
-	        TBool		isNewEntryPosFound; ///< flags whether the position for new entries is found
-	        TBool       isInitialised	:1;	///< flags whether the object is initialised
-	        TBool       isTrgNameLegalDosName	:1;	///< flags whether the target file name is a valid Dos name
-	        /**
-	        an array that holds short name candidates, prepared on initialisation.
-	        */
-	        RArray<TShortName>  iShortNameCandidates;
-	    };
+        class XFileCreationHelper
+        {
+        public:
+            XFileCreationHelper();
+            ~XFileCreationHelper();
+            void Close();
+            void InitialiseL(const TDesC&  aTargetName);
+            TInt GetValidatedShortName(TShortName& aShortName) const;
+            void CheckShortNameCandidates(const TUint8* apDosEntryName);
+    
+            // inline functions for sets and gets
+            //  note all the get functions have been checked against initialisation status
+            inline TBool    IsInitialised() const;
+            inline TUint16  NumOfAddingEntries() const;
+            inline TEntryPos EntryAddingPos()const;
+            inline TBool    IsNewEntryPosFound() const;
+            inline TBool    IsTrgNameLegalDosName() const;
+    
+            inline void SetEntryAddingPos(const TEntryPos& aEntryPos);
+            inline void SetIsNewEntryPosFound(TBool aFound);
+    
+        private:
+            XFileCreationHelper(const XFileCreationHelper&);
+            XFileCreationHelper& operator=(const TFindHelper&);
+    
+        private:
+            TPtrC       iTargetName;        ///< pointer to hold the long file name of the target file
+            TUint16     iNumOfAddingEntries;///< calculated number of entries to add
+            TEntryPos   iEntryAddingPos;    ///< contains new entry position for adding if found any
+            TBool       isNewEntryPosFound; ///< flags whether the position for new entries is found
+            TBool       isInitialised   :1; ///< flags whether the object is initialised
+            TBool       isTrgNameLegalDosName   :1; ///< flags whether the target file name is a valid Dos name
+            /**
+            an array that holds short name candidates, prepared on initialisation.
+            */
+            RArray<TShortName>  iShortNameCandidates;
+        };
 
 
-	TBool DoRummageDirCacheL(TUint anAtt,TEntryPos& aStartEntryPos,TFatDirEntry& aStartEntry,TEntryPos& aDosEntryPos,TFatDirEntry& aDosEntry,TDes& aFileName, const TFindHelper& aAuxParam, XFileCreationHelper* aFileCreationHelper, const TLeafDirData& aLeafDirData) const;
+    TBool DoRummageDirCacheL(TUint anAtt,TEntryPos& aStartEntryPos,TFatDirEntry& aStartEntry,TEntryPos& aDosEntryPos,TFatDirEntry& aDosEntry,TDes& aFileName, const TFindHelper& aAuxParam, XFileCreationHelper* aFileCreationHelper, const TLeafDirData& aLeafDirData) const;
     TBool DoFindL(const TDesC& aName,TUint anAtt,TEntryPos& aStartEntryPos,TFatDirEntry& aStartEntry,TEntryPos& aDosEntryPos,TFatDirEntry& aDosEntry,TDes& aFileName,TInt anError, XFileCreationHelper* aFileCreationHelper, const TLeafDirData& aLeafDirData) const;
     void FindEntryStartL(const TDesC& aName,TUint anAtt,TFatDirEntry& anEntry,TEntryPos& aPos, XFileCreationHelper* aFileCreationHelper) const;
 
@@ -677,7 +686,7 @@
 
     void CheckFatForLoopsL(const TFatDirEntry& anEntry) const;
     void DoCheckFatForLoopsL(TInt aCluster,TInt& aPreviousCluster,TInt& aChangePreviousCluster,TInt& aCount) const;
-	void InitializeL(const TLocalDriveCaps& aLocDrvCaps, TBool aIgnoreFSInfo=EFalse);
+    void InitializeL(const TLocalDriveCaps& aLocDrvCaps, TBool aIgnoreFSInfo=EFalse);
     void DoReadFromClusterListL(TEntryPos& aPos,TInt aLength,const TAny* aTrg,const RMessagePtr2& aMessage,TInt anOffset) const;
     void DoWriteToClusterListL(TEntryPos& aPos,TInt aLength,const TAny* aSrc,const RMessagePtr2& aMessage,TInt anOffset, TInt aLastcluster, TInt& aBadcluster, TInt& aGoodcluster);
     TBool IsUniqueNameL(const TShortName& aName,TInt aDirCluster);
@@ -685,8 +694,8 @@
     void ReplaceClashingNameL(const TShortName& aNewName,const TEntryPos& anEntryPos);
     TBool GenerateShortNameL(TInt aDirCluster,const TDesC& aLongName,TShortName& aShortName, TBool aForceRandomize=EFalse);
     TInt FindLeafDirL(const TDesC& aName, TLeafDirData& aLeafDir) const;
-	
-	TInt GetDirEntry(TEntryPos& aPos,TFatDirEntry& aDosEntry,TFatDirEntry& aStartEntry,TDes& aLongFileName) const;
+    
+    TInt GetDirEntry(TEntryPos& aPos,TFatDirEntry& aDosEntry,TFatDirEntry& aStartEntry,TDes& aLongFileName) const;
     TBool DoGetDirEntryL(TEntryPos& aPos,TFatDirEntry& aDosEntry,TFatDirEntry& aStartEntry,TDes& aLongFileName) const;
 
     void WriteDirEntryL(TEntryPos& aPos,const TFatDirEntry& aFatDirEntry,const TDesC& aLongFileName);
@@ -703,7 +712,7 @@
     TBool IsDirectoryEmptyL(TInt aCluster);
     void ExtendClusterListZeroedL(TInt aNumber,TInt& aCluster);
     void WritePasswordData();
-	
+    
     void WriteVolumeLabelL(const TDesC8& aVolumeLabel) const;
     TInt ReadVolumeLabelFile(TDes8& aLabel);
     void WriteVolumeLabelFileL(const TDesC8& aNewName);
@@ -721,12 +730,12 @@
     void    DoReMountL();
 
 private:
-	
+    
     TBool ValidClusterNumber(TUint32 aCluster) const;
     void  CheckUnvisitedClustersL(const RBitVector& aFatBitVec) const;
-	TInt  WalkClusterListL(RBitVector& aFatBitVec, TInt aCluster);
-	void  ChkEntryL(RBitVector& aFatBitVec, const TFatDirEntry& anEntry);
-	void  ChkDirL(RBitVector& aFatBitVec, TInt aDirCluster);
+    TInt  WalkClusterListL(RBitVector& aFatBitVec, TInt aCluster);
+    void  ChkEntryL(RBitVector& aFatBitVec, const TFatDirEntry& anEntry);
+    void  ChkDirL(RBitVector& aFatBitVec, TInt aDirCluster);
 
     CFatMountCB();
 
@@ -742,11 +751,11 @@
     TFatMntState iState;        ///< this mounnt internal state
     TFatType iFatType;          ///< FAT type, FAT12,16 or 32
 
-    CLeafDirCache* iLeafDirCache;	///< A cache for most recently visited directories, only valid when limit is set bigger than 1
-    HBufC* iLastLeafDir;        	///< The last visited directory, only valid when limit of iLeafDirCache is less than 1 
-    TInt iLastLeafDirCluster;   	///< Cluster number of the last visited cluster, only valid when limit of iLeafDirCache is less than 1
+    CLeafDirCache* iLeafDirCache;   ///< A cache for most recently visited directories, only valid when limit is set bigger than 1
+    HBufC* iLastLeafDir;            ///< The last visited directory, only valid when limit of iLeafDirCache is less than 1 
+    TInt iLastLeafDirCluster;       ///< Cluster number of the last visited cluster, only valid when limit of iLeafDirCache is less than 1
 
-	TFatVolParam iVolParam;     ///< FAT volume parameters, populated form the boot sector values.
+    TFatVolParam iVolParam;     ///< FAT volume parameters, populated form the boot sector values.
     
     TInt iFirstFreeByte;        ///< First free byte in media (start of the data area on the volume)
     TUint32 iUsableClusters;    ///< Number of usable cluster on the volume 
@@ -759,27 +768,27 @@
 
     XDriveInterface iDriverInterface; ///< the object representing interface to the drive, provides read/write access and notifiers
     TInt            iChkDiscRecLevel; ///< Check disk recursion level counter. A temporary measure. 
-	TFatConfig      iFatConfig;       ///< FAT parametrers from estart.txt
+    TFatConfig      iFatConfig;       ///< FAT parametrers from estart.txt
 
-	XFileCreationHelper iFileCreationHelper;
+    XFileCreationHelper iFileCreationHelper;
 
 #ifdef  _DEBUG
     private:
     //-- debug odds and ends
     inline TBool IsWriteFail()const;
-	inline void SetWriteFail(TBool aIsWriteFail);
-	inline TInt WriteFailCount()const;
-	inline void SetWriteFailCount(TInt aFailCount);
-	inline void DecWriteFailCount();
-	inline TInt WriteFailError()const;
-	inline void SetWriteFailError(TInt aErrorValue);
+    inline void SetWriteFail(TBool aIsWriteFail);
+    inline TInt WriteFailCount()const;
+    inline void SetWriteFailCount(TInt aFailCount);
+    inline void DecWriteFailCount();
+    inline TInt WriteFailError()const;
+    inline void SetWriteFailError(TInt aErrorValue);
 
 
-	TBool   iIsWriteFail : 1; ///< Flag to indicate if write failed used for debugging
+    TBool   iIsWriteFail : 1; ///< Flag to indicate if write failed used for debugging
     TBool   iCBRecFlag   : 1; ///< in debug mode used for checking unwanted recursion
 
     TInt    iWriteFailCount;  ///< Write fail count for debug
-	TInt    iWriteFailError;  ///< Write fail error to use for debug
+    TInt    iWriteFailError;  ///< Write fail error to use for debug
 
 #endif
 
@@ -812,25 +821,25 @@
     void CheckPosL(TUint aPos);
     void SetL(const TFatDirEntry& aFatDirEntry,TShare aShare,const TEntryPos& aPos);
     void CreateSeekIndex();
-	
+    
     inline TBool IsSeekIndex() const;
 
     // from MBlockMapInterface
-	TInt BlockMap(SBlockMapInfo& aInfo, TInt64& aStartPos, TInt64 aEndPos);
-	
-	// from CFileCB
-	virtual TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput);
+    TInt BlockMap(SBlockMapInfo& aInfo, TInt64& aStartPos, TInt64 aEndPos);
+    
+    // from CFileCB
+    virtual TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput);
 
-	// from CFileCB::MExtendedFileInterface
-	virtual void ReadL(TInt64 aPos,TInt& aLength,TDes8* aDes,const RMessagePtr2& aMessage, TInt aOffset);
-	virtual void WriteL(TInt64 aPos,TInt& aLength,const TDesC8* aDes,const RMessagePtr2& aMessage, TInt aOffset);
-	virtual void SetSizeL(TInt64 aSize);
+    // from CFileCB::MExtendedFileInterface
+    virtual void ReadL(TInt64 aPos,TInt& aLength,TDes8* aDes,const RMessagePtr2& aMessage, TInt aOffset);
+    virtual void WriteL(TInt64 aPos,TInt& aLength,const TDesC8* aDes,const RMessagePtr2& aMessage, TInt aOffset);
+    virtual void SetSizeL(TInt64 aSize);
 
 private:
-	inline CFatMountCB& FatMount() const;
+    inline CFatMountCB& FatMount() const;
     inline CFatTable& FAT();
-	inline TInt ClusterSizeLog2();
-	inline TInt ClusterRelativePos(TInt aPos);
+    inline TInt ClusterSizeLog2();
+    inline TInt ClusterRelativePos(TInt aPos);
 
 
     void FlushStartClusterL();
@@ -851,7 +860,7 @@
     TInt iStartCluster;     ///< Start cluster number of file
     TEntryPos iCurrentPos;  ///< Current position in file data
     TEntryPos iFileDirPos;  ///< File directory entry position
-	TBool iFileSizeModified; 
+    TBool iFileSizeModified; 
     };
 //
 
@@ -890,7 +899,7 @@
     CFatFormatCB();
     ~CFatFormatCB();
 public:
-	
+    
     //-- overrides from CFormatCB
     void DoFormatStepL();
 
@@ -898,7 +907,7 @@
     //-- overrides from CFormatCB
     TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput);
 
-private:	
+private:    
     
     TInt DoProcessTVolFormatParam(const TVolFormatParam_FAT* apVolFormatParam);
 
@@ -910,9 +919,9 @@
     TInt InitFormatDataForFixedSizeDiskNormal(TInt aDiskSizeInSectors, const TLocalDriveCapsV6& aCaps);
     TInt InitFormatDataForFixedSizeDiskCustom(const TLDFormatInfo& aFormatInfo);
     TInt InitFormatDataForFixedSizeDiskUser(TInt aDiskSizeInSectors);
-	void AdjustClusterSize(TInt aRecommendedSectorsPerCluster);
-	TInt AdjustFirstDataSectorAlignment(TInt aBlockSize);
-	TInt FirstDataSector() const;
+    void AdjustClusterSize(TInt aRecommendedSectorsPerCluster);
+    TInt AdjustFirstDataSectorAlignment(TInt aBlockSize);
+    TInt FirstDataSector() const;
     
     TInt HandleCorrupt(TInt aError);
     TInt BadSectorToCluster();
@@ -927,7 +936,7 @@
     TFatType SuggestFatType() const;
 
 private:
-	
+    
     TBool   iVariableSize;      ///< Flag to indicat if we are dealing with a variable size volume
     TInt    iBytesPerSector;    ///< Byte per sector of media
     TInt    iSectorSizeLog2;    ///< Sector size in log2
@@ -967,17 +976,17 @@
     void DriveInfo(TDriveInfo& anInfo,TInt aDriveNumber) const;
     TInt DefaultPath(TDes& aPath) const;
     TBool IsExtensionSupported() const;
-	TBool GetUseLocalTime() const;
-	void SetUseLocalTime(TBool aFlag);
-	TInt GetInterface(TInt aInterfaceId, TAny*& aInterface,TAny* aInput);
+    TBool GetUseLocalTime() const;
+    void SetUseLocalTime(TBool aFlag);
+    TInt GetInterface(TInt aInterfaceId, TAny*& aInterface,TAny* aInput);
 protected:
     CFatFileSystem();
-	/**
-	If true, then local time will be used when writing timestamps to FS. When reading,
-	timestamps will be assumed local and converted back to UTC.
-	At present, this behaviour will also be conditional upon a particular drive being logically removable.
-	*/
-	TBool iUseLocalTimeIfRemovable;
+    /**
+    If true, then local time will be used when writing timestamps to FS. When reading,
+    timestamps will be assumed local and converted back to UTC.
+    At present, this behaviour will also be conditional upon a particular drive being logically removable.
+    */
+    TBool iUseLocalTimeIfRemovable;
     };
 
 
@@ -991,9 +1000,9 @@
 
     {
 public:
-	static void ConvertFromUnicodeL(TDes8& aForeign, const TDesC16& aUnicode, TFatUtilityFunctions::TOverflowAction aOverflowAction=TFatUtilityFunctions::EOverflowActionTruncate);
-	static void ConvertToUnicodeL(TDes16& aUnicode, const TDesC8& aForeign, TFatUtilityFunctions::TOverflowAction aOverflowAction=TFatUtilityFunctions::EOverflowActionTruncate);
-	static TBool IsLegalShortNameCharacter(TUint aCharacter,TBool aUseExtendedChars=EFalse);
+    static void ConvertFromUnicodeL(TDes8& aForeign, const TDesC16& aUnicode, TFatUtilityFunctions::TOverflowAction aOverflowAction=TFatUtilityFunctions::EOverflowActionTruncate);
+    static void ConvertToUnicodeL(TDes16& aUnicode, const TDesC8& aForeign, TFatUtilityFunctions::TOverflowAction aOverflowAction=TFatUtilityFunctions::EOverflowActionTruncate);
+    static TBool IsLegalShortNameCharacter(TUint aCharacter,TBool aUseExtendedChars=EFalse);
     };
 
 //