kerneltest/f32test/fileutils/inc/fat_utils.h
branchRCL_3
changeset 21 e7d2d738d3c2
parent 0 a41df078684a
equal deleted inserted replaced
20:597aaf25e343 21:e7d2d738d3c2
    75 
    75 
    76 TInt FormatFatDrive(RFs &aFs, TInt aDrive, TBool aQuickFormat, const TFatFormatParam* apFmtParams=NULL, TBool aForceErase = EFalse); 
    76 TInt FormatFatDrive(RFs &aFs, TInt aDrive, TBool aQuickFormat, const TFatFormatParam* apFmtParams=NULL, TBool aForceErase = EFalse); 
    77 
    77 
    78 
    78 
    79 //-----------------------------------------------------------------------------
    79 //-----------------------------------------------------------------------------
    80 const TInt KFatFirstSearchCluser    =2;     ///< FAT usable clusters start from 2; FAT[0] and FAT[1] are reserved
    80 const TUint KFatFirstSearchCluser   =2;     ///< FAT usable clusters start from 2; FAT[0] and FAT[1] are reserved
    81 const TInt KFatDirNameSize			=11;    ///< Dos directory/File name length
    81 const TInt KFatDirNameSize			=11;    ///< Dos directory/File name length
    82 const TInt KFatDirReserved1Size		=8;     ///< Size of reserved area one in a directory enrty
    82 const TUint KFatDirReserved1Size	=8;     ///< Size of reserved area one in a directory enrty
    83 const TInt KVolumeLabelSize			=11;    ///< Volume lable size
    83 const TInt KVolumeLabelSize			=11;    ///< Volume lable size
    84 const TInt KFileSysTypeSize			=8;     ///< File system type parameter size
    84 const TInt KFileSysTypeSize			=8;     ///< File system type parameter size
    85 const TInt KVendorIdSize			=8;     ///< Vendor ID parameter size
    85 const TInt KVendorIdSize			=8;     ///< Vendor ID parameter size
    86 const TInt KVFatEntryAttribute		=0x0F;  ///< VFat entry attribute setting
    86 const TUint KVFatEntryAttribute		=0x0F;  ///< VFat entry attribute setting
    87 const TInt KBootSectorSignature		=0xAA55;///< File system Boot sector signiture
    87 const TUint KBootSectorSignature	=0xAA55;///< File system Boot sector signiture
    88 const TUint8 KDotEntryByte			=0x2e;  ///< Dot value for self and parent pointer directory entries
    88 const TUint8 KDotEntryByte			=0x2e;  ///< Dot value for self and parent pointer directory entries
    89 const TUint8 KBlankSpace			=0x20;  ///< Blank space in a directory entry
    89 const TUint8 KBlankSpace			=0x20;  ///< Blank space in a directory entry
    90 const TInt KSizeOfFatDirEntry		=32;    ///< Size in bytes of a Fat directry entry 
    90 const TUint  KSizeOfFatDirEntry		=32;    ///< Size in bytes of a Fat directry entry 
    91 const TInt KSizeOfFatDirEntryLog2	=5;     ///< Log2 of size in bytes of a Fat directry entry 
    91 const TUint  KSizeOfFatDirEntryLog2	=5;     ///< Log2 of size in bytes of a Fat directry entry 
    92 const TInt KFat16VolumeLabelPos 	=43;    ///< Position of volume lable in BPB for Fat12/16
    92 const TUint  KFat16VolumeLabelPos 	=43;    ///< Position of volume lable in BPB for Fat12/16
    93 const TInt KFat32VolumeLabelPos		=71;    ///< Position of volume lable in BPB for Fat32
    93 const TUint  KFat32VolumeLabelPos	=71;    ///< Position of volume lable in BPB for Fat32
    94 const TInt KReservedIdOldEntry		=1;	    ///< used for TFatDirEntry::SetReserved2(..)
    94 const TUint  KReservedIdOldEntry	=1;	    ///< used for TFatDirEntry::SetReserved2(..)
    95 const TInt KReservedIdNewEntry		=0;
    95 const TUint  KReservedIdNewEntry	=0;
    96 const TInt KSizeOfFatBootSector     =90;    ///< Size in bytes of Boot sector parameter block (BPB) 
    96 const TInt KSizeOfFatBootSector     =90;    ///< Size in bytes of Boot sector parameter block (BPB) 
    97 
    97 
    98 const TUint32 KBootSectorNum        =0;     ///< Main Boot Sector number (always 0)
    98 const TUint32 KBootSectorNum        =0;     ///< Main Boot Sector number (always 0)
    99 const TUint32 KFSInfoSectorNum      =1;     ///< Main FSInfo sector number. This is a default value. The actual value shall be taken from the BPB
    99 const TUint32 KFSInfoSectorNum      =1;     ///< Main FSInfo sector number. This is a default value. The actual value shall be taken from the BPB
   100 
   100 
   323 public:
   323 public:
   324     TFatDirEntry();
   324     TFatDirEntry();
   325     void InitZ();
   325     void InitZ();
   326 
   326 
   327     const TPtrC8 Name() const;
   327     const TPtrC8 Name() const;
   328     TInt Attributes() const;
   328     TUint Attributes() const;
   329     TTime Time() const;
   329     TTime Time() const;
   330     TInt StartCluster() const;
   330     TUint32 StartCluster() const;
   331     TUint32 Size() const;
   331     TUint32 Size() const;
   332     TBool IsErased() const;
   332     TBool IsErased() const;
   333     TBool IsCurrentDirectory() const;
   333     TBool IsCurrentDirectory() const;
   334     TBool IsParentDirectory() const;
   334     TBool IsParentDirectory() const;
   335     TBool IsEndOfDirectory() const;
   335     TBool IsEndOfDirectory() const;
   336     TBool IsGarbage() const;
   336     TBool IsGarbage() const;
   337     void SetName(const TDesC8& aDes);
   337     void SetName(const TDesC8& aDes);
   338     void SetAttributes(TInt anAtt);
   338     void SetAttributes(TUint anAtt);
   339     void SetTime(TTime aTime);
   339     void SetTime(TTime aTime);
   340     void SetCreateTime(TTime aTime);
   340     void SetCreateTime(TTime aTime);
   341     void SetStartCluster(TInt aStartCluster);
   341     void SetStartCluster(TUint32 aStartCluster);
   342     void SetSize(TUint32 aFilesize);
   342     void SetSize(TUint32 aFilesize);
   343     void SetErased();
   343     void SetErased();
   344     void SetCurrentDirectory();
   344     void SetCurrentDirectory();
   345     void SetParentDirectory();
   345     void SetParentDirectory();
   346     void SetEndOfDirectory();
   346     void SetEndOfDirectory();