sl@0: // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // f32\sfat32\fat_config.h sl@0: // FAT fsy configurator sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @internalTechnology sl@0: */ sl@0: sl@0: #ifndef FAT_CONFIGURATOR_H sl@0: #define FAT_CONFIGURATOR_H sl@0: sl@0: #include sl@0: //----------------------------------------------------------------------------- sl@0: sl@0: /** sl@0: This class provides access to the FAT settings in estart.txt file and the interface to sl@0: get these setting to the client (CFatMountCB). sl@0: */ sl@0: class TFatConfig sl@0: { sl@0: public: sl@0: sl@0: TFatConfig(); sl@0: void ReadConfig(TInt aDrvNumber, TBool aForceRead = EFalse); sl@0: sl@0: //-- parameters getters sl@0: inline TBool ScanDrvSkipFinalisedVolume() const; sl@0: inline TBool FAT32_AsynchMount() const; sl@0: inline TBool FAT32_UseFSInfoOnMount() const; sl@0: inline TBool FAT32_UseBitSupercache() const; sl@0: sl@0: sl@0: inline TUint32 DirCacheSize() const; sl@0: inline TUint32 DirCacheMaxPageSizeLog2() const; sl@0: sl@0: inline void Fat16FixedCacheParams(TUint32& aRdGrLog2, TUint32& aWrGrLog2) const; sl@0: inline void Fat32LruCacheParams(TUint32& aRdGrLog2, TUint32& aWrGrLog2, TUint32& aCacheSize) const; sl@0: inline TBool FAT16_UseCleanShutDownBit() const; sl@0: sl@0: inline TUint32 LeafDirCacheSize() const; sl@0: inline TUint32 DynamicDirCacheSizeMin() const; sl@0: inline TUint32 DynamicDirCacheSizeMax() const; sl@0: inline TUint32 DynamicDirCacheMaxPageSizeLog2() const; sl@0: sl@0: protected: sl@0: sl@0: TFatConfig(const TFatConfig&); sl@0: TFatConfig& operator=(const TFatConfig&); sl@0: sl@0: TUint32 ReadUint(const TDesC8& aSection, const TDesC8& aKeyName, TUint32 aDefaultValue) const; sl@0: sl@0: private: sl@0: sl@0: void DumpParameters() const; sl@0: void DoDumpUintParam(const TDesC8& aKeyName, TUint32 aParam) const; sl@0: sl@0: void ProcessDirCacheParams(const TDesC8& aSection); sl@0: void ProcessFatCacheParams(const TDesC8& aSection); sl@0: void ProcessDynamicDirCacheParams(const TDesC8& aSection); sl@0: sl@0: private: sl@0: sl@0: TUint32 iInitialised : 1; //-- ETrue if the object is initialised, i.e. ReadConfig() called sl@0: sl@0: //-- cached FAT parameters, see appropriate methods description sl@0: sl@0: //-- boolean values sl@0: TUint32 iScanDrvSkipFinalisedVolume :1; ///< if 1 ScanDrive will skip properly finalised volumes sl@0: TUint32 iFAT32_AsynchMount :1; ///< if 1 FAT3 Asynchronous mounting is enabled sl@0: TUint32 iFAT32_UseFSInfoOnMount :1; ///< 1 enables using FSInfo sector on FAT32 volumes sl@0: TUint32 iFAT32_UseBitSupercache :1; ///< 1 enables using FAT32 bit supercache for fast free cluster lookup sl@0: TUint32 iFAT16_UseCleanShutDownBit :1; ///< if 1 "clean shutdown mask" bit in FAT16[1] will be used during volume finalisations. sl@0: sl@0: //--- sl@0: sl@0: TUint16 iDirCacheSizeKB; ///< directory cache size, Kbytes sl@0: TUint16 iDirCacheMaxPageSizeLog2; ///< Log2(Max. dir. cache page size) sl@0: sl@0: TUint16 iFat16FixedCacheReadGrLog2; ///< Log2(FAT16 fixed cache read granularity) sl@0: TUint16 iFat16FixedCacheWriteGrLog2; ///< Log2(FAT16 fixed cache write granularity) sl@0: sl@0: TUint16 iFat32LRUCacheSizeKB; ///< FAT32 LRU cache size, Kbytes sl@0: TUint16 iFat32LRUCacheReadGrLog2; ///< Log2(FAT32 LRU cache read granularity) sl@0: TUint16 iFat32LRUCacheWriteGrLog2; ///< Log2(FAT32 LRU cache write granularity) sl@0: sl@0: TUint32 iLeafDirCacheSize; ///< leaf directory cache size, maximum number of most recently visited leaf dirs to be cached sl@0: TUint32 iDynamicDirCacheSizeMinKB; ///< minimum directory cache size, Kbytes sl@0: TUint32 iDynamicDirCacheSizeMaxKB; ///< maximum directory cache size, Kbytes sl@0: TUint32 iDynamicDirCacheMaxPageSizeLog2;///< Log2(maximum dynamic dir cache page size) sl@0: sl@0: }; sl@0: sl@0: #include"fat_config.inl" sl@0: sl@0: #endif //FAT_CONFIGURATOR_H sl@0: sl@0: sl@0: sl@0: sl@0: sl@0: