sl@0: // Copyright (c) 2006-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: // f32test\ext\t_fatext.h sl@0: // sl@0: // sl@0: sl@0: #ifndef __FATTEST_EXT_H__ sl@0: #define __FATTEST_EXT_H__ sl@0: sl@0: #include "t_testext.h" sl@0: #include "fat_utils.h" sl@0: sl@0: using namespace Fat_Test_Utils; sl@0: sl@0: /** sl@0: This is the FAT test extension class. sl@0: @internalTechnology sl@0: */ sl@0: class CFatTestProxyDrive : public CTestProxyDrive sl@0: { sl@0: public: sl@0: enum TFatTestCmd sl@0: { sl@0: EGetDataPosition = ETestCmdEnd + 1, sl@0: ESectorsPerCluster, sl@0: EFatSectors, sl@0: EFirstFatSector, sl@0: EFatType sl@0: }; sl@0: sl@0: public: sl@0: static CFatTestProxyDrive* NewL(CProxyDrive* aProxyDrive, CMountCB* aMount); sl@0: private: sl@0: CFatTestProxyDrive(CProxyDrive* aProxyDrive, CMountCB* aMount); sl@0: sl@0: public: sl@0: // Derived functions sl@0: virtual TInt Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt aOffset,TInt aFlags); sl@0: virtual TInt Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt anOffset); sl@0: virtual TInt Read(TInt64 aPos,TInt aLength,TDes8& aTrg); sl@0: virtual TInt Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt aOffset,TInt aFlags); sl@0: virtual TInt Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt anOffset); sl@0: virtual TInt Write(TInt64 aPos,const TDesC8& aSrc); sl@0: virtual TInt Format(TFormatInfo& anInfo); sl@0: virtual TInt Format(TInt64 aPos,TInt aLength); sl@0: sl@0: private: sl@0: TInt ReadBootSector(); sl@0: TBool CheckMount(); sl@0: private: sl@0: virtual void DoInitL(); sl@0: virtual TBool DoCheckEvent(TInt64 aPos, TInt aLength); sl@0: virtual TInt DoControlIO(const RMessagePtr2& aMessage,TInt aCommand,TAny* aParam1,TAny* aParam2); sl@0: sl@0: private: sl@0: TFatBootSector iBootSector; sl@0: }; sl@0: sl@0: sl@0: /** sl@0: Factory class for FAT test extension. sl@0: @internalTechnology sl@0: */ sl@0: class CFatTestProxyDriveFactory : public CProxyDriveFactory sl@0: { sl@0: public: sl@0: CFatTestProxyDriveFactory(); sl@0: virtual TInt Install(); sl@0: virtual CProxyDrive* NewProxyDriveL(CProxyDrive* aProxy,CMountCB* aMount); sl@0: }; sl@0: sl@0: #endif sl@0: sl@0: sl@0: sl@0: sl@0: sl@0: sl@0: sl@0: sl@0: sl@0: sl@0: sl@0: sl@0: