Update contrib.
1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // f32\sfat\inc\fat_table.h
15 // FAT12/16 File Allocation Table classes definitions
24 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
25 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
27 //!! WARNING!! DO NOT edit this file !! '\sfat' component is obsolete and is not being used. '\sfat32'replaces it
29 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
30 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
38 //---------------------------------------------------------------------------------------------------------------------------------------
41 Fat table used for all media except RAM, manages the Fat table for all cluster requests.
43 class CAtaFatTable : public CFatTable
46 static CAtaFatTable* NewL(CFatMountCB& aOwner);
48 //-- overrides from the base class
50 void Dismount(TBool aDiscardDirtyData);
52 void InvalidateCacheL(TInt64 aPos, TUint32 aLength);
53 void InvalidateCacheL();
55 TUint32 ReadL(TUint32 aFatIndex) const;
56 void WriteL(TUint32 aFatIndex, TUint32 aValue);
58 TInt64 DataPositionInBytes(TUint32 aCluster) const;
61 CAtaFatTable(CFatMountCB& aOwner);
66 CFatCacheBase* iCache; ///< FAT cache, fixed or LRU depending on the FAT type
69 //---------------------------------------------------------------------------------------------------------------------------------------
72 Fat table used for RAM media, manages the Fat table for all cluster requests.
73 RAM media only supports Fat12/16.
75 class CRamFatTable : public CFatTable
78 static CRamFatTable* NewL(CFatMountCB& aOwner);
81 TUint32 ReadL(TUint32 aFatIndex) const;
82 void WriteL(TUint32 aFatIndex, TUint32 aValue);
83 TInt64 DataPositionInBytes(TUint32 aCluster) const;
84 void FreeClusterListL(TUint32 aCluster);
85 TUint32 AllocateSingleClusterL(TUint32 aNearestCluster);
86 void ExtendClusterListL(TUint32 aNumber,TInt& aCluster);
89 CRamFatTable(CFatMountCB& aOwner);
93 inline TUint8 *RamDiskBase() const;
94 inline TInt AllocateClusterNumber();
95 inline void WriteFatTable(TInt aFatIndex,TInt aValue);
96 inline void WriteFatTable(TInt aFatIndex,TInt aFatValue,TInt anIndirectionTableValue);
97 inline void ReadIndirectionTable(TUint32& aCluster) const;
98 inline void WriteIndirectionTable(TInt aFatIndex,TInt aValue);
99 inline TUint8* MemCopy(TAny* aTrg,const TAny* aSrc,TInt aLength);
100 inline TUint8* MemCopyFillZ(TAny* aTrg, TAny* aSrc, TInt aLength);
101 inline void ZeroFillCluster(TInt aCluster);
103 void UpdateIndirectionTable(TUint32 aStartCluster,TUint32 anEndCluster,TInt aNum);
107 TInt iFatTablePos; ///< Current position in the fat table
108 TInt iIndirectionTablePos; ///< Current position in indirection table, second fat used for this
109 TUint8* iRamDiskBase; ///< Pointer to the Ram disk base
114 //---------------------------------------------------------------------------------------------------------------------------------