933 HBufC* iMatch; ///< Current name being searched in directory (Dos Name) |
933 HBufC* iMatch; ///< Current name being searched in directory (Dos Name) |
934 HBufC* iLongNameBuf; ///< Long name storage |
934 HBufC* iLongNameBuf; ///< Long name storage |
935 TBool iMatchUid; ///< Flag to indicate if UID matches |
935 TBool iMatchUid; ///< Flag to indicate if UID matches |
936 }; |
936 }; |
937 |
937 |
938 /** |
938 //--------------------------------------------------------------------------------------------------------------------------------- |
939 Fat file system Format subsession implmentation, provides all that is required of a plug in |
939 /** |
940 file system format as well as Fat specific functionality |
940 FAT Format Control Block class, responsible for FAT volumes formatting |
941 */ |
941 */ |
942 class CFatFormatCB : public CFormatCB |
942 class CFatFormatCB : public CFormatCB |
943 { |
943 { |
944 public: |
944 public: |
945 CFatFormatCB(); |
945 CFatFormatCB(); |
961 void CreateFSInfoSectorL(); |
961 void CreateFSInfoSectorL(); |
962 void CreateReservedBootSectorL(); |
962 void CreateReservedBootSectorL(); |
963 void InitializeFormatDataL(); |
963 void InitializeFormatDataL(); |
964 void DoZeroFillMediaL(TInt64 aStartPos, TInt64 aEndPos); |
964 void DoZeroFillMediaL(TInt64 aStartPos, TInt64 aEndPos); |
965 |
965 |
966 TInt InitFormatDataForVariableSizeDisk(TUint aDiskSizeInSectors); |
966 TInt ProcessVolParam_User(const TLocalDriveCapsV6& aCaps); |
967 TInt InitFormatDataForFixedSizeDiskNormal(TUint aDiskSizeInSectors, const TLocalDriveCapsV6& aCaps); |
967 TInt ProcessVolParam_Custom(const TLocalDriveCapsV6& aCaps); |
968 TInt InitFormatDataForFixedSizeDiskCustom(const TLDFormatInfo& aFormatInfo); |
968 TInt ProcessVolParam_Default(const TLocalDriveCapsV6& aCaps); |
969 TInt InitFormatDataForFixedSizeDiskUser(TUint aDiskSizeInSectors); |
969 TInt ProcessVolParam_RamDisk(); |
|
970 |
970 void AdjustClusterSize(TUint aRecommendedSectorsPerCluster); |
971 void AdjustClusterSize(TUint aRecommendedSectorsPerCluster); |
971 TInt AdjustFirstDataSectorAlignment(TUint aBlockSize); |
972 TInt AdjustFirstDataSectorAlignment(TUint aBlockSize); |
972 TInt FirstDataSector() const; |
973 TInt FirstDataSector() const; |
973 |
974 |
974 TInt HandleCorrupt(TInt aError); |
975 TInt HandleCorrupt(TInt aError); |
979 |
980 |
980 TUint MaxFat12Sectors() const; |
981 TUint MaxFat12Sectors() const; |
981 TUint MaxFat16Sectors() const; |
982 TUint MaxFat16Sectors() const; |
982 TUint MaxFat32Sectors() const; |
983 TUint MaxFat32Sectors() const; |
983 |
984 |
984 inline TBool Is16BitFat() const; |
|
985 inline TBool Is32BitFat() const; |
|
986 inline CFatMountCB& FatMount(); |
985 inline CFatMountCB& FatMount(); |
987 inline CProxyDrive* LocalDrive(); |
986 inline CProxyDrive* LocalDrive(); |
988 TFatType SuggestFatType() const; |
987 TFatType SuggestFatType() const; |
989 |
988 |
|
989 |
|
990 inline TBool FatTypeValid() const; |
|
991 inline TFatType FatType() const; |
|
992 inline void SetFatType(TFatType aType); |
|
993 |
|
994 inline TBool Is16BitFat() const; |
|
995 inline TBool Is32BitFat() const; |
|
996 |
|
997 |
990 private: |
998 private: |
991 |
999 |
992 TBool iVariableSize; ///< Flag to indicat if we are dealing with a variable size volume |
1000 TBool iVariableSize; ///< Flag to indicate if we are dealing with a variable size volume (RAM drive) |
993 |
1001 |
994 TUint16 iBytesPerSector; ///< Byte per sector of media |
1002 TUint16 iBytesPerSector; ///< Byte per sector of media |
995 TInt iSectorSizeLog2; ///< Sector size in log2 |
1003 TInt iSectorSizeLog2; ///< Sector size in log2 |
996 TUint8 iNumberOfFats; ///< Number of Fats the volume will contain |
1004 TUint8 iNumberOfFats; ///< Number of Fats the volume will contain |
997 TUint iReservedSectors; ///< Number of reserved sectors in the volume |
1005 TUint iReservedSectors; ///< Number of reserved sectors in the volume |
998 TUint16 iRootDirEntries; ///< Nummer of root directory entries the root dir will have, specific to Fat12/16 volumes |
1006 TUint16 iRootDirEntries; ///< Nummer of root directory entries the root dir will have, specific to Fat12/16 volumes |
999 TUint iSectorsPerCluster; ///< Sector per cluster ration the volume will be formatted with |
1007 TUint iSectorsPerCluster; ///< Sector per cluster ration the volume will be formatted with |
1000 TUint iSectorsPerFat; ///< Number of sectors the Fat uses |
1008 TUint iSectorsPerFat; ///< Number of sectors the Fat uses |
1001 TUint32 iMaxDiskSectors; ///< number of sectors the volume has |
1009 TUint32 iMaxDiskSectors; ///< number of sectors the volume has |
1002 TFormatInfo iFormatInfo; ///< format information for a custom format |
1010 TFormatInfo iFormatInfo; ///< format information for a custom format |
1003 TBuf8<16> iFileSystemName;///< Buffer to contain the volume name |
1011 TFatType iFatType; ///< FAT type |
|
1012 |
1004 TInt iHiddenSectors; ///< Number of hidden sectors in the volume |
1013 TInt iHiddenSectors; ///< Number of hidden sectors in the volume |
1005 TUint16 iNumberOfHeads; ///< Number of heads the media device has, not used so far as only used on solid state media. |
1014 TUint16 iNumberOfHeads; ///< Number of heads the media device has, not used so far as only used on solid state media. |
1006 TUint16 iSectorsPerTrack; ///< Number of sectors the media device has, not used so far as only used on solid state media. |
1015 TUint16 iSectorsPerTrack; ///< Number of sectors the media device has, not used so far as only used on solid state media. |
1007 TUint32 iRootClusterNum; ///< cluster number used for root directory, Fat32 specific |
1016 TUint32 iRootClusterNum; ///< cluster number used for root directory, Fat32 specific |
1008 TUint32 iCountOfClusters; ///< Count of clusters on the media |
1017 TUint32 iCountOfClusters; ///< Count of clusters on the media |
|
1018 |
1009 RArray<TInt> iBadClusters; ///< Array of bad cluster numbers |
1019 RArray<TInt> iBadClusters; ///< Array of bad cluster numbers |
1010 RArray<TInt> iBadSectors; ///< Array of bad sector numbers |
1020 RArray<TInt> iBadSectors; ///< Array of bad sector numbers |
1011 TBool iDiskCorrupt; ///< Disk is corrupt when format or not |
1021 TBool iDiskCorrupt; ///< Disk is corrupt when format or not |
1012 TInt iOldFirstFreeSector; |
1022 TInt iOldFirstFreeSector; |
1013 TInt iOldSectorsPerCluster; |
1023 TInt iOldSectorsPerCluster; |