|
1 // Copyright (c) 2003-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 class CBaseCommandParser : public CBase |
|
24 { |
|
25 public: |
|
26 virtual ~CBaseCommandParser(); |
|
27 void ParseL(const TDesC& aCommand, TTestDebugInfo aDebugInfo); |
|
28 TBool CanParse(const TDesC& aCommand) const; |
|
29 TDesC& ErrorL(); |
|
30 |
|
31 protected: |
|
32 virtual void ProcessL() = 0; |
|
33 virtual void ConstructL(); |
|
34 inline CBaseCommandParser() {} |
|
35 void AddCommandL(const TDesC& aCommand); |
|
36 void CheckNumberOfArgumentsL(TInt aNumberOfArguments); |
|
37 void SetErrorL(const TDesC& aError); |
|
38 |
|
39 protected: |
|
40 HBufC* iCurrentCommand; |
|
41 CDesCArrayFlat* iArgumentList; |
|
42 TTestDebugInfo iDebugInfo; |
|
43 HBufC* iLastError; |
|
44 |
|
45 private: |
|
46 CDesCArrayFlat* iSupportedCommands; |
|
47 }; |
|
48 |
|
49 class CBaseSectionParser : public CBase |
|
50 { |
|
51 public: |
|
52 void ParseL(); |
|
53 virtual ~CBaseSectionParser(); |
|
54 |
|
55 protected: |
|
56 virtual void ConstructL(const TDesC& aSectionName); |
|
57 virtual void LogComment(const TDesC& aComment) = 0; |
|
58 inline CBaseSectionParser(CTestScript& aScript) : iScript(aScript) {} |
|
59 void AddCommandParserL(CBaseCommandParser* aParser); |
|
60 |
|
61 protected: |
|
62 CTestScript& iScript; |
|
63 CTestSection* iSection; |
|
64 CArrayPtrFlat<CBaseCommandParser>* iCommandParsers; |
|
65 |
|
66 private: |
|
67 void SetSectionL(const TDesC& aSectionName); |
|
68 }; |
|
69 |
|
70 #endif |