userlibandfileserver/fileserver/sfat32/inc/sl_std.h
branchRCL_3
changeset 43 c1f20ce4abcf
parent 42 a179b74831c9
child 44 3e88ff8f41d5
equal deleted inserted replaced
42:a179b74831c9 43:c1f20ce4abcf
    56 
    56 
    57 class CFatMountCB;
    57 class CFatMountCB;
    58 class CFatFileSystem;
    58 class CFatFileSystem;
    59 
    59 
    60 /**
    60 /**
    61 Represents the position of a directory entery in terms of a cluster and off set into it
    61 Represents the position of a directory entry in terms of a cluster and offset into it
    62 */
    62 */
    63 class TEntryPos
    63 class TEntryPos
    64 	{
    64 	{
    65 public:
    65 public:
    66 	TEntryPos() : iCluster(EOF_32Bit), iPos(0) {}
    66 	TEntryPos() : iCluster(EOF_32Bit), iPos(0) {}
   190 
   190 
   191     //-----------------------------------------------------------------
   191     //-----------------------------------------------------------------
   192     //-- pure virtual interface
   192     //-- pure virtual interface
   193     virtual TUint32 ReadL(TUint32 aFatIndex) const = 0;
   193     virtual TUint32 ReadL(TUint32 aFatIndex) const = 0;
   194 	virtual void WriteL(TUint32 aFatIndex, TUint32 aValue) = 0;
   194 	virtual void WriteL(TUint32 aFatIndex, TUint32 aValue) = 0;
   195 	virtual TInt64 DataPositionInBytesL(TUint32 aCluster) const = 0;
   195 	virtual TInt64 DataPositionInBytes(TUint32 aCluster) const = 0;
   196     virtual void MountL(const TMountParams& aMountParam) = 0;
   196     virtual void MountL(const TMountParams& aMountParam) = 0;
   197     //-----------------------------------------------------------------
   197     //-----------------------------------------------------------------
   198     //-- just virtual interface
   198     //-- just virtual interface
   199     
   199     
   200     virtual void Dismount(TBool /*aDiscardDirtyData*/) {}
   200     virtual void Dismount(TBool /*aDiscardDirtyData*/) {}
   264     
   264     
   265 
   265 
   266     inline TBool ClusterNumberValid(TUint32 aClusterNo) const;
   266     inline TBool ClusterNumberValid(TUint32 aClusterNo) const;
   267 
   267 
   268     typedef RArray<TUint> RClusterArray;
   268     typedef RArray<TUint> RClusterArray;
   269     void DoFreedClustersNotifyL(RClusterArray &aFreedClusters);
   269     void DoFreedClustersNotify(RClusterArray &aFreedClusters);
   270 
   270 
   271 
   271 
   272 protected:
   272 protected:
   273 	
   273 	
   274     CFatMountCB* iOwner;            ///< Owning file system mount
   274     CFatMountCB* iOwner;            ///< Owning file system mount
   426 class TLeafDirData;
   426 class TLeafDirData;
   427 class CLeafDirCache;
   427 class CLeafDirCache;
   428 
   428 
   429 
   429 
   430 /**
   430 /**
   431 Fat file system mount implmentation, provides all that is required of a plug in
   431 Fat file system mount implementation, provides all that is required of a plug in
   432 file system mount as well as Fat mount specific functionality 
   432 file system mount as well as Fat mount specific functionality 
   433 */
   433 */
   434 class CFatMountCB : public CLocDrvMountCB, 
   434 class CFatMountCB : public CLocDrvMountCB, 
   435 					public MFileSystemSubType,
   435 					public MFileSystemSubType,
   436 					public MFileSystemClusterSize,
   436 					public MFileSystemClusterSize,
   748     void    DoUpdateFSInfoSectorsL(TBool aInvalidateFSInfo);
   748     void    DoUpdateFSInfoSectorsL(TBool aInvalidateFSInfo);
   749     void    UnFinaliseMountL();
   749     void    UnFinaliseMountL();
   750     void    DoReMountL();
   750     void    DoReMountL();
   751     void    SetFatType(TFatType aFatType);
   751     void    SetFatType(TFatType aFatType);
   752 
   752 
       
   753     TUint64 VolumeSizeInBytes() const;
   753 
   754 
   754 private:
   755 private:
   755 	
   756 	
   756 
   757 
   757 	CFatMountCB();
   758 	CFatMountCB();
   765 
   766 
   766     TBool iReadOnly         : 1;///< if true, the drive is in read-only mode 
   767     TBool iReadOnly         : 1;///< if true, the drive is in read-only mode 
   767     TBool iRamDrive         : 1;///< true if this is a RAM drive    
   768     TBool iRamDrive         : 1;///< true if this is a RAM drive    
   768     TBool iMainBootSecValid : 1;///< true if the main boot sector is valid, if false, a backup boot sector may be in use. 
   769     TBool iMainBootSecValid : 1;///< true if the main boot sector is valid, if false, a backup boot sector may be in use. 
   769 
   770 
   770     TFatMntState iState;        ///< this mounnt internal state
   771     TFatMntState iState;            ///< this mounnt internal state
   771 
   772 
   772     TFatType iFatType;          ///< FAT type, FAT12,16 or 32
   773     TFatType iFatType;              ///< FAT type, FAT12,16 or 32
   773     TUint32  iFatEocCode;       ///< End Of Cluster Chain code, 0xff8 for FAT12, 0xfff8 for FAT16, and 0xffffff8 for FAT32 
   774     TUint32  iFatEocCode;           ///< End Of Cluster Chain code, 0xff8 for FAT12, 0xfff8 for FAT16, and 0xffffff8 for FAT32 
   774 
   775 
   775     CLeafDirCache* iLeafDirCache;	///< A cache for most recently visited directories, only valid when limit is set bigger than 1
   776     CLeafDirCache* iLeafDirCache;	///< A cache for most recently visited directories, only valid when limit is set bigger than 1
   776 
   777 
   777 	TFatVolParam iVolParam;         ///< FAT volume parameters, populated form the boot sector values.
   778 	TFatVolParam iVolParam;         ///< FAT volume parameters, populated form the boot sector values.
   778     
   779     
   780 	TUint32 iUsableClusters;        ///< Number of usable cluster on the volume 
   781 	TUint32 iUsableClusters;        ///< Number of usable cluster on the volume 
   781 	
   782 	
   782     CFatTable* iFatTable;           ///< Pointer to the volume Fat 
   783     CFatTable* iFatTable;           ///< Pointer to the volume Fat 
   783 	CRawDisk*  iRawDisk;            ///< Pointer to the raw data interface class
   784 	CRawDisk*  iRawDisk;            ///< Pointer to the raw data interface class
   784 	
   785 	
   785     CAsyncNotifier* iNotifier;  ///< Async notifier for notifying user of Fat error conditions 
   786     CAsyncNotifier* iNotifier;      ///< Async notifier for notifying user of Fat error conditions 
   786 
   787 
   787     XDriveInterface iDriverInterface; ///< the object representing interface to the drive, provides read/write access and notifiers
   788     XDriveInterface iDriverInterface; ///< the object representing interface to the drive, provides read/write access and notifiers
   788 	TFatConfig      iFatConfig;       ///< FAT parametrers from estart.txt
   789 	TFatConfig      iFatConfig;       ///< FAT parametrers from estart.txt
   789 
   790 
   790 	XFileCreationHelper iFileCreationHelper;
   791 	XFileCreationHelper iFileCreationHelper;
   897 	TInt iSeekIndexSize;    ///< size of seek index
   898 	TInt iSeekIndexSize;    ///< size of seek index
   898 	
   899 	
   899     TUint     iStartCluster;     ///< Start cluster number of file
   900     TUint     iStartCluster;     ///< Start cluster number of file
   900 	TEntryPos iCurrentPos;  ///< Current position in file data
   901 	TEntryPos iCurrentPos;  ///< Current position in file data
   901 	
   902 	
   902     TEntryPos iFileDosEntryPos;  ///< File DOS dir. entry position
   903     TEntryPos iFileDosEntryPos;	///< File DOS dir. entry position
   903 	
   904 	
   904     TBool iFileSizeModified :1;  ///< flag, indicating that file size was modified and needs to be flushed onto the media (see FlushL())
   905     TBool iFileSizeModified :1;	///< flag, indicating that file size was modified and needs to be flushed onto the media (see FlushL())
   905     TBool iFileTimeModified :1;  ///< flag, indicating that file modification time was modified and needs to be flushed onto the media (see FlushL())
   906     TBool iFileTimeModified :1;	///< flag, indicating that file modification time was modified and needs to be flushed onto the media (see FlushL())
   906 
   907 
   907 	};
   908 	};
   908 
   909 
   909 
   910 
   910 
   911