--- a/userlibandfileserver/fileserver/sfat/inc/sl_scandrv.h Mon Oct 19 15:55:17 2009 +0100
+++ b/userlibandfileserver/fileserver/sfat/inc/sl_scandrv.h Mon Dec 21 16:14:42 2009 +0000
@@ -20,13 +20,22 @@
@internalTechnology
*/
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!
+//!! WARNING!! DO NOT edit this file !! '\sfat' component is obsolete and is not being used. '\sfat32'replaces it
+//!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+
#ifndef SL_SCANDRV_H
#define SL_SCANDRV_H
//---------------------------------------------------------------------------------------------------------------------------------
-const TInt KMaxMatchingEntries = 2; ///< Maximum number of matching directory entries scan drive can fix. Any more indicates a fault in the file system
-const TInt KMaxArrayDepth = 6; ///< Maximum array depth for cluster storage when KMaxScanDepth is reached
+const TInt KMaxMatchingEntries = 2; ///< Maximum number of matching directory entries scan drive can fix. Any more indicates a fault in the file system
+const TInt KMaxArrayDepth = 6; ///< Maximum array depth for cluster storage when KMaxScanDepth is reached
//---------------------------------------------------------------------------------------------------------------------------------
@@ -34,10 +43,10 @@
Data structure used to store the location of a partial VFat entry
*/
struct TPartVFatEntry
- {
- TEntryPos iEntryPos; ///< The position of the partial VFat entry
- TFatDirEntry iEntry; ///< The Dos entry The VFat entries belong with
- };
+ {
+ TEntryPos iEntryPos; ///< The position of the partial VFat entry
+ TFatDirEntry iEntry; ///< The Dos entry The VFat entries belong with
+ };
//---------------------------------------------------------------------------------------------------------------------------------
@@ -46,39 +55,39 @@
start cluster numbers.
*/
struct TMatchingStartCluster
- {
- TEntryPos iEntries[KMaxMatchingEntries]; ///< The positions of the matching entries
- TInt iCount; ///< Count of matching entries
- TInt iStartCluster; ///< The matching cluster number found in more than one entry
- };
+ {
+ TEntryPos iEntries[KMaxMatchingEntries]; ///< The positions of the matching entries
+ TInt iCount; ///< Count of matching entries
+ TInt iStartCluster; ///< The matching cluster number found in more than one entry
+ };
//---------------------------------------------------------------------------------------------------------------------------------
class CCheckFatTable : public CBase
- {
+ {
public:
- static CCheckFatTable* NewL(CFatMountCB* aOwner);
- CCheckFatTable(CFatMountCB* aOwner);
- ~CCheckFatTable();
- void InitializeL();
- TBool FlushL();
- TBool GetNextClusterL(TInt& aCluster) const;
- void WriteFatEntryEofFL(TInt aCluster);
- TInt ReadL(TInt aFatIndex) const;
- void WriteL(TInt aFatIndex,TInt aValue);
+ static CCheckFatTable* NewL(CFatMountCB* aOwner);
+ CCheckFatTable(CFatMountCB* aOwner);
+ ~CCheckFatTable();
+ void InitializeL();
+ TBool FlushL();
+ TBool GetNextClusterL(TInt& aCluster) const;
+ void WriteFatEntryEofFL(TInt aCluster);
+ TInt ReadL(TInt aFatIndex) const;
+ void WriteL(TInt aFatIndex,TInt aValue);
private:
- void WriteMediaDescriptor();
- TInt PosInBytes(TInt aFatIndex) const;
- TInt PosInIndex(TInt aBytePos) const;
- inline TBool IsEof16Bit(TInt aCluster) const;
- inline TBool IsEof12Bit(TInt aCluster) const;
+ void WriteMediaDescriptor();
+ TInt PosInBytes(TInt aFatIndex) const;
+ TInt PosInIndex(TInt aBytePos) const;
+ inline TBool IsEof16Bit(TInt aCluster) const;
+ inline TBool IsEof12Bit(TInt aCluster) const;
inline TInt MaxFatIndex() const;
protected:
TInt iMaxFatIndex;
- TUint8* iCheckFat;
- CFatMountCB* iOwner;
- };
+ TUint8* iCheckFat;
+ CFatMountCB* iOwner;
+ };
//---------------------------------------------------------------------------------------------------------------------------------
@@ -88,62 +97,62 @@
of fat volume.
*/
class CScanDrive : public CBase
- {
+ {
public:
- enum TDirError{EScanMatchingEntry=1,EScanPartEntry};
+ enum TDirError{EScanMatchingEntry=1,EScanPartEntry};
public:
- CScanDrive();
- ~CScanDrive();
- static CScanDrive* NewL(CFatMountCB* aMount);
- void ConstructL(CFatMountCB* aMount);
- TInt StartL();
+ CScanDrive();
+ ~CScanDrive();
+ static CScanDrive* NewL(CFatMountCB* aMount);
+ void ConstructL(CFatMountCB* aMount);
+ TInt StartL();
TBool ProblemsDiscovered() const;
private:
#if defined(DEBUG_SCANDRIVE)
- void PrintErrors();
- void CompareFatsL() const;
+ void PrintErrors();
+ void CompareFatsL() const;
#endif
- void FixupDirErrorL();
- void FindSameStartClusterL();
- TInt FindStartClusterL(TInt aDirCluster);
- void CheckDirStructureL();
- void CheckDirL(TInt aCluster);
- void ProcessEntryL(const TFatDirEntry& aEntry);
- TInt CheckEntryClusterL(const TFatDirEntry& aEntry, const TEntryPos& aEntryPos);
- void WriteClusterChainL(TInt aCluster,TInt aSizeInBytes);
- TBool MoveToVFatEndL(TEntryPos& aPos,TFatDirEntry& aEntry,TInt& aDirLength);
- TBool IsValidVFatEntry(const TFatDirEntry& aEntry,TInt prevNum)const;
- TBool IsDosEntry(const TFatDirEntry& aEntry)const;
- void AddPartialVFatL(const TEntryPos& aStartPos, const TFatDirEntry& aEntry);
- TBool AddMatchingEntryL(const TEntryPos& aEntryPos);
- TInt GetReservedidL(const TEntryPos aVFatPos);
- void WriteNewFatsL();
- void FixPartEntryL();
- void FixMatchingEntryL();
- void MovePastEntriesL(TEntryPos& aEntryPos,TFatDirEntry& aEntry,TInt aToMove,TInt& aDirEntries);
- void AddToClusterListL(TInt aCluster);
- inline TBool AlreadyExistsL(TInt aCluster)const;
- inline TBool IsEndOfRootDir(const TEntryPos& aPos)const;
- inline TBool IsEofF(TInt aVal)const;
- inline TBool IsDirError()const;
+ void FixupDirErrorL();
+ void FindSameStartClusterL();
+ TInt FindStartClusterL(TInt aDirCluster);
+ void CheckDirStructureL();
+ void CheckDirL(TInt aCluster);
+ void ProcessEntryL(const TFatDirEntry& aEntry);
+ TInt CheckEntryClusterL(const TFatDirEntry& aEntry, const TEntryPos& aEntryPos);
+ void WriteClusterChainL(TInt aCluster,TInt aSizeInBytes);
+ TBool MoveToVFatEndL(TEntryPos& aPos,TFatDirEntry& aEntry,TInt& aDirLength);
+ TBool IsValidVFatEntry(const TFatDirEntry& aEntry,TInt prevNum)const;
+ TBool IsDosEntry(const TFatDirEntry& aEntry)const;
+ void AddPartialVFatL(const TEntryPos& aStartPos, const TFatDirEntry& aEntry);
+ TBool AddMatchingEntryL(const TEntryPos& aEntryPos);
+ TInt GetReservedidL(const TEntryPos aVFatPos);
+ void WriteNewFatsL();
+ void FixPartEntryL();
+ void FixMatchingEntryL();
+ void MovePastEntriesL(TEntryPos& aEntryPos,TFatDirEntry& aEntry,TInt aToMove,TInt& aDirEntries);
+ void AddToClusterListL(TInt aCluster);
+ inline TBool AlreadyExistsL(TInt aCluster)const;
+ inline TBool IsEndOfRootDir(const TEntryPos& aPos)const;
+ inline TBool IsEofF(TInt aVal)const;
+ inline TBool IsDirError()const;
void IndicateErrorsFound();
private:
- CFatMountCB* iMount;
- CCheckFatTable* iNewFat;
- TPartVFatEntry iPartEntry;
- TMatchingStartCluster iMatching;
- TDirError iDirError;
- TInt iDirsChecked;
- TInt iRecursiveDepth;
- RArray<TInt>* iClusterListArray[KMaxArrayDepth];
- TInt iListArrayIndex;
+ CFatMountCB* iMount;
+ CCheckFatTable* iNewFat;
+ TPartVFatEntry iPartEntry;
+ TMatchingStartCluster iMatching;
+ TDirError iDirError;
+ TInt iDirsChecked;
+ TInt iRecursiveDepth;
+ RArray<TInt>* iClusterListArray[KMaxArrayDepth];
+ TInt iListArrayIndex;
TBool iFoundProblems; ///< if ETrue after finish, it means that there where some problems FS structure and they were probably fixed;
- };
+ };