persistentstorage/dbms/SPConv/cn_proc.h
changeset 0 08ec8eefde2f
equal deleted inserted replaced
-1:000000000000 0:08ec8eefde2f
       
     1 // Copyright (c) 2004-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 "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 // CCmdProcessor class
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef __CN_PROC_H__
       
    19 #define __CN_PROC_H__
       
    20 
       
    21 #include <e32base.h>
       
    22 
       
    23 //Forward declarations
       
    24 struct TCmdLinePrm;
       
    25 class RFs;
       
    26 
       
    27 /**
       
    28 CCmdProcessor class describes an interface to an object which primary purpose is to
       
    29 execute requested action, determined by the application's command line arguments.
       
    30 CCmdProcessor interface implementations have to override pure virtual RunL() method, which
       
    31 will be called in order command line action to be executed.
       
    32 @internalComponent
       
    33 */
       
    34 class CCmdProcessor : public CBase
       
    35 	{
       
    36 public:
       
    37 	virtual void RunL() = 0;
       
    38 
       
    39 protected:
       
    40 	inline CCmdProcessor(RFs& aFs, const TCmdLinePrm& aCmdLinePrm) :
       
    41 		iFs(aFs),
       
    42 		iCmdLinePrm(aCmdLinePrm)
       
    43 		{
       
    44 		}
       
    45 
       
    46 protected:
       
    47 	RFs&				iFs;
       
    48 	const TCmdLinePrm&	iCmdLinePrm;
       
    49 
       
    50 	};
       
    51 
       
    52 /**
       
    53 TCmdProcessorFactory class serves itself as a factory for objects which implement
       
    54 CCmdProcessor interface.
       
    55 Depending on the requested action (TCmdLinePrm::TAction enum) TCmdProcessorFactory instance
       
    56 will create an object (which class implements CCmdProcessor interface), capable to perform the
       
    57 requested operation.
       
    58 @see CCmdProcessor
       
    59 @see TCmdLinePrm
       
    60 @internalComponent
       
    61 */
       
    62 class TCmdProcessorFactory
       
    63 	{
       
    64 public:
       
    65 	static CCmdProcessor* NewLC(RFs& aFs, const TCmdLinePrm& aCmdLinePrm);
       
    66 
       
    67 	};
       
    68 
       
    69 #endif//__CN_PROC_H__