os/kernelhwsrv/kerneltest/f32test/plugins/version_2/inc/premodifier_plugin.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/f32test/plugins/version_2/inc/premodifier_plugin.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,96 @@
     1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// modifier_plugin.h
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#if !defined(__PREMODIFIER_PLUGIN_H__)
    1.22 +#define __PREMODIFIER_PLUGIN_H__
    1.23 +
    1.24 +#include <f32plugin.h>
    1.25 +
    1.26 +#define _LOG(a) {if(iLogging) RDebug::Print(a);}
    1.27 +#define _LOG2(a,b) {if(iLogging) RDebug::Print(a,b);}
    1.28 +#define _LOG3(a,b,c) {if(iLogging) RDebug::Print(a,b,c);}
    1.29 +#define _LOG4(a,b,c,d) {if(iLogging) RDebug::Print(a,b,c,d);}
    1.30 +#define _LOG5(a,b,c,d,e) {if(iLogging) RDebug::Print(a,b,c,d,e);}
    1.31 +
    1.32 +const TInt KPreModifierPos = 0x40000000;
    1.33 +
    1.34 +_LIT(KPreModifierPluginFileName,"premodifier_plugin");
    1.35 +_LIT(KPreModifierPluginName,"PreModifierPlugin");
    1.36 +
    1.37 +class CPreModifierPlugin : public CFsPlugin
    1.38 +{
    1.39 +
    1.40 +public:
    1.41 +	static CPreModifierPlugin* NewL();
    1.42 +	~CPreModifierPlugin();
    1.43 +
    1.44 +	virtual void InitialiseL();
    1.45 +	virtual TInt DoRequestL(TFsPluginRequest& aRequest);
    1.46 +	
    1.47 +	void FsPluginDoRequestL(CFsPluginConnRequest& aRequest);
    1.48 +	TInt FsPluginDoControlL(CFsPluginConnRequest& aRequest);
    1.49 +protected:
    1.50 +	CFsPluginConn* NewPluginConnL();
    1.51 +
    1.52 +private:
    1.53 +	CPreModifierPlugin();
    1.54 +	void ConstructL();
    1.55 +
    1.56 +	// RFile intercepts
    1.57 +	void FsFileReadL(TFsPluginRequest& aRequest);
    1.58 +	void FsFileWriteL(TFsPluginRequest& aRequest);
    1.59 +	void FsFileRenameL(TFsPluginRequest& aRequest);
    1.60 +	void FsFileCreateL(TFsPluginRequest& aRequest);
    1.61 +	void FsFileSizeL(TFsPluginRequest& aRequest);
    1.62 +	void FsFileSetSizeL(TFsPluginRequest& aRequest);
    1.63 +	void FsFileLockL(TFsPluginRequest& aRequest);
    1.64 +	void FsFileUnLockL(TFsPluginRequest& aRequest);
    1.65 +	void FsFileSeekL(TFsPluginRequest& aRequest);
    1.66 +	void FsFileOpenL(TFsPluginRequest& aRequest);
    1.67 +	void FsFileReplaceL(TFsPluginRequest& aRequest);
    1.68 +	void FsReadFileSectionL(TFsPluginRequest& aRequest);
    1.69 +	void FsDirReadPackedL(TFsPluginRequest& aRequest);
    1.70 +	void FsDirReadOneL(TFsPluginRequest& aRequest);
    1.71 +	void FsDirOpenL(TFsPluginRequest& aRequest);
    1.72 +	void FsFileSubCloseL(TFsPluginRequest& aRequest);
    1.73 +	void FsFileTempL(TFsPluginRequest& aRequest);
    1.74 +	void FsDeleteL(TFsPluginRequest& aRequest);
    1.75 +	void FsReplaceL(TFsPluginRequest& aRequest);
    1.76 +	void FsRenameL(TFsPluginRequest& aRequest);
    1.77 +	void FsEntryL(TFsPluginRequest& aRequest);
    1.78 +	void FsSetEntryL(TFsPluginRequest& aRequest);
    1.79 +
    1.80 +	void EnableInterceptsL();
    1.81 +	void DisableInterceptsL();
    1.82 +
    1.83 +
    1.84 +private:
    1.85 +	TBool iInterceptsEnabled;
    1.86 +	TBool iLogging;
    1.87 +	TChar iDriveToTest;
    1.88 +	TInt iLastError;
    1.89 +	TInt iLineNumber;
    1.90 +};
    1.91 +
    1.92 +class CPreModifierPluginConn : public CFsPluginConn
    1.93 +	{
    1.94 +	virtual TInt DoControl(CFsPluginConnRequest& aRequest);
    1.95 +	virtual void DoRequest(CFsPluginConnRequest& aRequest);
    1.96 +	virtual void DoCancel(TInt aReqMask);
    1.97 +	};
    1.98 +
    1.99 +#endif