userlibandfileserver/fileserver/sfat/sl_disk.h
changeset 9 96e5fb8b040d
equal deleted inserted replaced
-1:000000000000 9:96e5fb8b040d
       
     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 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
       
    24 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
       
    25 //!!
       
    26 //!! WARNING!! DO NOT edit this file !! '\sfat' component is obsolete and is not being used. '\sfat32'replaces it
       
    27 //!!
       
    28 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
       
    29 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
       
    30 
       
    31 
       
    32 #if !defined(__SL_DISK_H__)
       
    33 #define __SL_DISK_H__
       
    34 
       
    35 #include "sl_std.h"
       
    36 
       
    37 //---------------------------------------------------------------------------------------------------------------------------------
       
    38 
       
    39 class MWTCacheInterface;
       
    40 
       
    41 
       
    42 class CAtaDisk : public CRawDisk
       
    43     {
       
    44 public:
       
    45     static CAtaDisk* NewL(CFatMountCB& aFatMount);
       
    46     
       
    47      CAtaDisk(CFatMountCB& aFatMount);
       
    48     ~CAtaDisk();
       
    49 
       
    50     void ConstructL();  
       
    51     void InitializeL();
       
    52 
       
    53 public:
       
    54     void ReadCachedL(TInt64 aPos,TInt aLength,TDes8& aDes) const; 
       
    55     void WriteCachedL(TInt64 aPos,const TDesC8& aDes);
       
    56 
       
    57     void InvalidateUidCache();
       
    58     virtual void InvalidateUidCachePage(TUint64 aPos);
       
    59 
       
    60     
       
    61     void ReadL(TInt64 aPos,TInt aLength,const TAny* aTrg,const RMessagePtr2 &aMessage,TInt anOffset) const;
       
    62     void WriteL(TInt64 aPos,TInt aLength,const TAny* aSrc,const RMessagePtr2 &aMessage,TInt anOffset);
       
    63     virtual TInt GetLastErrorInfo(TDes8& aErrorInfo) const;
       
    64 
       
    65     MWTCacheInterface* DirCacheInterface();
       
    66 
       
    67     
       
    68 
       
    69 
       
    70 private:
       
    71 
       
    72     TFatDriveInterface& iDrive;     ///< Driver's interface to access the media
       
    73     MWTCacheInterface*  ipDirCache; ///< pointer to the FAT Directory cache object
       
    74     MWTCacheInterface*  iUidCache;  ///< pointer to the UID cache object
       
    75 
       
    76     };
       
    77 
       
    78 
       
    79 //---------------------------------------------------------------------------------------------------------------------------------
       
    80 
       
    81 class CRamDisk : public CRawDisk
       
    82     {
       
    83 public:
       
    84     
       
    85     static CRamDisk* NewL(CFatMountCB& aFatMount);
       
    86     CRamDisk(CFatMountCB& aFatMount);
       
    87 
       
    88     void InitializeL();
       
    89 public:
       
    90     void ReadCachedL(TInt64 aPos,TInt aLength,TDes8& aDes) const;
       
    91     void WriteCachedL(TInt64 aPos,const TDesC8& aDes);
       
    92     void ReadL(TInt64 aPos,TInt aLength,const TAny* aTrg,const RMessagePtr2 &aMessage,TInt anOffset) const;
       
    93     void WriteL(TInt64 aPos,TInt aLength,const TAny* aSrc,const RMessagePtr2 &aMessage,TInt anOffset);
       
    94 
       
    95     
       
    96 
       
    97 private:
       
    98     inline TUint8 *RamDiskBase() const;
       
    99 
       
   100 private:
       
   101     TUint8* iRamDiskBase; ///< pointer to the beginning of the RAM disk memory area
       
   102     };
       
   103 
       
   104 
       
   105 //---------------------------------------------------------------------------------------------------------------------------------
       
   106 
       
   107 #include "sl_disk.inl"
       
   108 
       
   109 #endif //__SL_DISK_H__
       
   110 
       
   111 
       
   112 
       
   113 
       
   114 
       
   115 
       
   116 
       
   117 
       
   118 
       
   119 
       
   120 
       
   121 
       
   122 
       
   123