userlibandfileserver/fileserver/sfat/sl_disk.h
author John Imhofe
Mon, 19 Oct 2009 15:55:17 +0100
changeset 0 a41df078684a
child 15 4122176ea935
permissions -rw-r--r--
Convert Kernelhwsrv package from SFL to EPL kernel\eka\compsupp is subject to the ARM EABI LICENSE userlibandfileserver\fatfilenameconversionplugins\unicodeTables is subject to the Unicode license kernel\eka\kernel\zlib is subject to the zlib license

// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of the License "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
// f32\sfat\inc\sl_disk.h
// 
//

/**
 @file
 @internalTechnology
*/

#if !defined(__SL_DISK_H__)
#define __SL_DISK_H__

#include "sl_std.h"

//---------------------------------------------------------------------------------------------------------------------------------

class MWTCacheInterface;


class CAtaDisk : public CRawDisk
	{
public:
	static CAtaDisk* NewL(CFatMountCB& aFatMount);
	
     CAtaDisk(CFatMountCB& aFatMount);
	~CAtaDisk();

    void ConstructL();  
    void InitializeL();

public:
	void ReadCachedL(TInt64 aPos,TInt aLength,TDes8& aDes) const; 
	void WriteCachedL(TInt64 aPos,const TDesC8& aDes);

    void InvalidateUidCache();
    virtual void InvalidateUidCachePage(TUint64 aPos);

	
    void ReadL(TInt64 aPos,TInt aLength,const TAny* aTrg,const RMessagePtr2 &aMessage,TInt anOffset) const;
	void WriteL(TInt64 aPos,TInt aLength,const TAny* aSrc,const RMessagePtr2 &aMessage,TInt anOffset);
	virtual TInt GetLastErrorInfo(TDes8& aErrorInfo) const;

    MWTCacheInterface* DirCacheInterface();

    


private:

	TFatDriveInterface& iDrive;     ///< Driver's interface to access the media
    MWTCacheInterface*  ipDirCache; ///< pointer to the FAT Directory cache object
    MWTCacheInterface*  iUidCache;  ///< pointer to the UID cache object

    };


//---------------------------------------------------------------------------------------------------------------------------------

class CRamDisk : public CRawDisk
	{
public:
	
    static CRamDisk* NewL(CFatMountCB& aFatMount);
	CRamDisk(CFatMountCB& aFatMount);

    void InitializeL();
public:
	void ReadCachedL(TInt64 aPos,TInt aLength,TDes8& aDes) const;
	void WriteCachedL(TInt64 aPos,const TDesC8& aDes);
	void ReadL(TInt64 aPos,TInt aLength,const TAny* aTrg,const RMessagePtr2 &aMessage,TInt anOffset) const;
	void WriteL(TInt64 aPos,TInt aLength,const TAny* aSrc,const RMessagePtr2 &aMessage,TInt anOffset);

    

private:
	inline TUint8 *RamDiskBase() const;

private:
	TUint8* iRamDiskBase; ///< pointer to the beginning of the RAM disk memory area
	};


//---------------------------------------------------------------------------------------------------------------------------------

#include "sl_disk.inl"

#endif //__SL_DISK_H__