messagingfw/msgtest/integration/email/inc/testframeparse.h
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     1 // Copyright (c) 1999-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 //
       
    15 
       
    16 #ifndef __TESTFRAMEPARSE_H
       
    17 #define __TESTFRAMEPARSE_H
       
    18 
       
    19 #include "testframeutils.h"
       
    20 
       
    21 #include <badesca.h>
       
    22 
       
    23 //
       
    24 //
       
    25 // CTestBaseCommandParser
       
    26 //
       
    27 
       
    28 class MBaseTestState;
       
    29 
       
    30 class CBaseCommandParser : public CBase
       
    31 	{
       
    32 public:
       
    33 	virtual ~CBaseCommandParser();
       
    34 
       
    35 	void ParseL(const TDesC& aCommand, TTestDebugInfo aDebugInfo);
       
    36 	TBool CanParse(const TDesC& aCommand) const;
       
    37 	TDesC& ErrorL();
       
    38 
       
    39 protected:
       
    40 	virtual void ProcessL() = 0;
       
    41 	virtual void ConstructL();
       
    42 	CBaseCommandParser();
       
    43 	void AddCommandL(const TDesC& aCommand);
       
    44 	void CheckNumberOfArgumentsL(TInt aNumberOfArguments);
       
    45 	void SetErrorL(const TDesC& aError);
       
    46 
       
    47 protected:
       
    48 	HBufC* iCurrentCommand;
       
    49 	CDesCArrayFlat* iArgumentList;
       
    50 	TTestDebugInfo iDebugInfo;
       
    51 	HBufC* iLastError;
       
    52 
       
    53 private:
       
    54 	CDesCArrayFlat* iSupportedCommands;
       
    55 	};
       
    56 
       
    57 
       
    58 
       
    59 //
       
    60 //
       
    61 // CTestBaseSectionParser
       
    62 //
       
    63 
       
    64 class CBaseSectionParser : public CBase
       
    65 	{
       
    66 public:
       
    67 	void ParseL();
       
    68 	virtual ~CBaseSectionParser();
       
    69 
       
    70 protected:
       
    71 	virtual void ConstructL(const TDesC& aSectionName);
       
    72 	virtual void LogComment(const TDesC& aComment) = 0;
       
    73 	CBaseSectionParser(CTestScript& aScript);
       
    74 	void AddCommandParserL(CBaseCommandParser* aParser);
       
    75 
       
    76 protected:
       
    77 	CTestScript& iScript;
       
    78 	CTestSection* iSection;
       
    79 	CArrayPtrFlat<CBaseCommandParser>* iCommandParsers;
       
    80 
       
    81 private:
       
    82 	void SetSectionL(const TDesC& aSectionName);
       
    83 	};
       
    84 
       
    85 
       
    86 
       
    87 #endif