userlibandfileserver/fileserver/sfat32/sl_disk.h
changeset 2 4122176ea935
child 6 0173bcd7697c
equal deleted inserted replaced
0:a41df078684a 2:4122176ea935
       
     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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // f32\sfat\inc\sl_disk.h
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalTechnology
       
    21 */
       
    22 
       
    23 #if !defined(__SL_DISK_H__)
       
    24 #define __SL_DISK_H__
       
    25 
       
    26 #include "sl_std.h"
       
    27 
       
    28 //---------------------------------------------------------------------------------------------------------------------------------
       
    29 
       
    30 class MWTCacheInterface;
       
    31 
       
    32 
       
    33 class CAtaDisk : public CRawDisk
       
    34 	{
       
    35 public:
       
    36 	static CAtaDisk* NewL(CFatMountCB& aFatMount);
       
    37 	
       
    38      CAtaDisk(CFatMountCB& aFatMount);
       
    39 	~CAtaDisk();
       
    40 
       
    41     void ConstructL();  
       
    42     void InitializeL();
       
    43 
       
    44 public:
       
    45 	void ReadCachedL(TInt64 aPos,TInt aLength,TDes8& aDes) const; 
       
    46 	void WriteCachedL(TInt64 aPos,const TDesC8& aDes);
       
    47 
       
    48     void InvalidateUidCache();
       
    49     virtual void InvalidateUidCachePage(TUint64 aPos);
       
    50 
       
    51 	
       
    52     void ReadL(TInt64 aPos,TInt aLength,const TAny* aTrg,const RMessagePtr2 &aMessage,TInt anOffset) const;
       
    53 	void WriteL(TInt64 aPos,TInt aLength,const TAny* aSrc,const RMessagePtr2 &aMessage,TInt anOffset);
       
    54 	virtual TInt GetLastErrorInfo(TDes8& aErrorInfo) const;
       
    55 
       
    56     MWTCacheInterface* DirCacheInterface();
       
    57 
       
    58     
       
    59 
       
    60 
       
    61 private:
       
    62 
       
    63 	TFatDriveInterface& iDrive;     ///< Driver's interface to access the media
       
    64     MWTCacheInterface*  ipDirCache; ///< pointer to the FAT Directory cache object
       
    65     MWTCacheInterface*  iUidCache;  ///< pointer to the UID cache object
       
    66 
       
    67     };
       
    68 
       
    69 
       
    70 //---------------------------------------------------------------------------------------------------------------------------------
       
    71 
       
    72 class CRamDisk : public CRawDisk
       
    73 	{
       
    74 public:
       
    75 	
       
    76     static CRamDisk* NewL(CFatMountCB& aFatMount);
       
    77 	CRamDisk(CFatMountCB& aFatMount);
       
    78 
       
    79     void InitializeL();
       
    80 public:
       
    81 	void ReadCachedL(TInt64 aPos,TInt aLength,TDes8& aDes) const;
       
    82 	void WriteCachedL(TInt64 aPos,const TDesC8& aDes);
       
    83 	void ReadL(TInt64 aPos,TInt aLength,const TAny* aTrg,const RMessagePtr2 &aMessage,TInt anOffset) const;
       
    84 	void WriteL(TInt64 aPos,TInt aLength,const TAny* aSrc,const RMessagePtr2 &aMessage,TInt anOffset);
       
    85 
       
    86     
       
    87 
       
    88 private:
       
    89 	inline TUint8 *RamDiskBase() const;
       
    90 
       
    91 private:
       
    92 	TUint8* iRamDiskBase; ///< pointer to the beginning of the RAM disk memory area
       
    93 	};
       
    94 
       
    95 
       
    96 //---------------------------------------------------------------------------------------------------------------------------------
       
    97 
       
    98 #include "sl_disk.inl"
       
    99 
       
   100 #endif //__SL_DISK_H__
       
   101 
       
   102 
       
   103 
       
   104 
       
   105 
       
   106 
       
   107 
       
   108 
       
   109 
       
   110 
       
   111 
       
   112 
       
   113 
       
   114