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