userlibandfileserver/fileserver/sfat32/inc/sl_scandrv.h
changeset 109 b3a1d9898418
parent 90 947f0dc9f7a8
child 257 3e88ff8f41d5
equal deleted inserted replaced
102:ef2a444a7410 109:b3a1d9898418
   132 	TBool AddMatchingEntryL(const TEntryPos& aEntryPos);
   132 	TBool AddMatchingEntryL(const TEntryPos& aEntryPos);
   133 	TInt GetReservedidL(const TEntryPos aVFatPos);
   133 	TInt GetReservedidL(const TEntryPos aVFatPos);
   134 	
   134 	
   135 	void FixPartEntryL();
   135 	void FixPartEntryL();
   136 	void FixMatchingEntryL();
   136 	void FixMatchingEntryL();
       
   137 	void FixHangingClusterChainL(TUint32 aFatEocIndex);
   137 	void MovePastEntriesL(TEntryPos& aEntryPos,TFatDirEntry& aEntry,TInt aToMove,TInt& aDirEntries);
   138 	void MovePastEntriesL(TEntryPos& aEntryPos,TFatDirEntry& aEntry,TInt aToMove,TInt& aDirEntries);
   138 	void AddToClusterListL(TInt aCluster);
   139 	void AddToClusterListL(TInt aCluster);
   139 	inline TBool AlreadyExistsL(TInt aCluster)const;
   140 	inline TBool AlreadyExistsL(TInt aCluster)const;
   140 	inline TBool IsEndOfRootDir(const TEntryPos& aPos)const;
   141 	inline TBool IsEndOfRootDir(const TEntryPos& aPos)const;
   141 	inline TBool IsEofF(TInt aVal)const;
   142 	inline TBool IsEofF(TInt aVal)const;
   148     inline TBool CheckDiskMode() const;
   149     inline TBool CheckDiskMode() const;
   149 
   150 
   150 protected:
   151 protected:
   151 	
   152 	
   152     /**
   153     /**
   153     Internal ScanDrive mode specific errors. In Rugged FAT mode (current implementatio) any type of error of this kind can occur only once and it will be fixed.
   154     Internal ScanDrive mode specific errors.
   154     Othersise the FS is considered to be corrupted
   155     In Rugged FAT mode (current implementation) any type of error of this kind can occur only once and it will be fixed.
       
   156     Otherwise the FS is considered to be corrupted.
   155     */
   157     */
   156     enum TDirError 
   158     enum TDirError 
   157         {
   159         {
   158         ENoDirError= 0,         ///< no errors found
   160         ENoDirError= 0,         ///< No errors found
   159         EScanMatchingEntry=1,   ///< Two entries pointing to the same cluster chain; Rugged FAT rename/replace artefact
   161         EScanMatchingEntry=1,   ///< Two entries pointing to the same cluster chain; Rugged FAT rename/replace artefact
   160         EScanPartEntry,         ///< Deleted DOS entry and orphaned VFAT ones from the same entryset; Rugged FAT 'file/dir delete' artefact
   162         EScanPartEntry,         ///< Deleted DOS entry and orphaned VFAT ones from the same entryset; Rugged FAT 'file/dir delete' artefact
   161         };
   163         };
   162 
   164 
   163 
   165 
   164 private:
   166 private:
   165 	CFatMountCB*            iMount;             ///< The owning Fat mount
   167 	CFatMountCB*            iMount;             ///< The owning FAT mount
   166 	
   168 	
   167     TPartVFatEntry          iPartEntry;         ///< Storage for a partial VFat entry set error, see EScanPartEntry
   169     TPartVFatEntry          iPartEntry;         ///< Storage for a partial VFAT entry set error, see EScanPartEntry
   168 	TMatchingStartCluster   iMatching;          ///< Storage for Matching start cluster error, see EScanMatchingEntry
   170 	TMatchingStartCluster   iMatching;          ///< Storage for Matching start cluster error, see EScanMatchingEntry
   169 	
   171 	
   170     TDirError               iDirError;          ///< Indicates the error tpye found also used to indicate if an error has occured
   172     TDirError               iDirError;          ///< Indicates the error type found also used to indicate if an error has occured
       
   173 	TUint32                 iHangingClusters;	///< Number of hanging clusters found (and marked as EOF by ScanDrive), at which cluster chain
       
   174 												///< truncation should take place; Rugged FAT 'file shrinking/expanding' artefact
   171     TInt                    iDirsChecked;       ///< Count of the number of directories checked
   175     TInt                    iDirsChecked;       ///< Count of the number of directories checked
   172 	TInt                    iRecursiveDepth;    ///< Depth of recursion the scan has reached
   176 	TInt                    iRecursiveDepth;    ///< Depth of recursion the scan has reached
   173 	RArray<TInt>*           iClusterListArray[KMaxArrayDepth]; ///< Size in bytes of the bit packed Fat	Cluster list array used when maximum depth has been reached so that directory may be re-visited. Avoid stack overflow
   177 	RArray<TInt>*           iClusterListArray[KMaxArrayDepth]; ///< Size in bytes of the bit packed FAT	cluster list array used when maximum depth
   174 	
   178 															   ///< has been reached so that directory may be re-visited. Avoid stack overflow.
   175     TUint                   iListArrayIndex;    ///< Current position into cluster list array
   179     TUint                   iListArrayIndex;    ///< Current position into cluster list array
   176 	TUint32                 iTruncationCluster; ///< Cluster at which cluster chain truncation should take place, used for truncation errors
       
   177 	TUint32                 iMaxClusters;       ///< Max. amount of clusters on the volume
   180 	TUint32                 iMaxClusters;       ///< Max. amount of clusters on the volume
   178 
   181 
   179     RBitVector              iMediaFatBits;      ///< Storage for bit packed Fat read from media 
   182     RBitVector              iMediaFatBits;      ///< Storage for bit packed FAT read from media 
   180     RBitVector              iScanFatBits;       ///< Storage for bit packed Fat built up by the scan
   183     RBitVector              iScanFatBits;       ///< Storage for bit packed FAT built up by the scan
   181 
   184 
   182     TGenericError           iGenericError;      ///< FS error that is discovered by scanning in any mode  
   185     TGenericError           iGenericError;      ///< FS error that is discovered by scanning in any mode  
   183     TScanDriveMode          iScanDriveMode;     ///< mode of operation
   186     TScanDriveMode          iScanDriveMode;     ///< Mode of operation
   184 	};
   187 	};
   185 
   188 
   186 
   189 
   187 
   190 
   188 #endif //SL_SCANDRV_H
   191 #endif //SL_SCANDRV_H