|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: CCmdParser is used to parse the command line parameters. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CMDPARSER_H_ |
|
19 #define CMDPARSER_H_ |
|
20 |
|
21 #include <e32hashtab.h> |
|
22 #include <e32std.h> |
|
23 #include <e32base.h> |
|
24 #include <e32cmn.h> |
|
25 |
|
26 class CCmdParser : public CBase |
|
27 { |
|
28 public: |
|
29 static CCmdParser* NewL(); |
|
30 ~CCmdParser(); |
|
31 |
|
32 public: |
|
33 TBool Parse(TPtr& commandLine); |
|
34 TBool CaseContains(TInt index, TDesC& caseName); |
|
35 inline TInt CaseCount(){return iTestCaseIndexList.Count() + iTestCaseList.Count();} |
|
36 inline TName TestModule() {return iTestModule;} |
|
37 inline TFileName ConfigFile() {return iConfigFile;} |
|
38 inline TFileName EngineIniFile() {return iEngineIniFile;} |
|
39 inline TFileName ModuleIniFile() {return iModuleIniFile;} |
|
40 inline TBool IsVersion(){return iIsVersion;} |
|
41 inline TBool IsHelp() {return iIsHelp;} |
|
42 inline RArray<TName> TestCaseList() {return iTestCaseList;} |
|
43 inline RArray<TInt> TestCaseIndexList() {return iTestCaseIndexList;} |
|
44 inline TDes& EngineConfigList() {return iEngineConfigList;} |
|
45 inline TDes& LogConfigList() {return iLogConfigList;} |
|
46 inline TBool IsPrompt() {return iIsPrompt;} |
|
47 |
|
48 private: |
|
49 CCmdParser(); |
|
50 TBool IsNumber(const TDesC & aDes); |
|
51 |
|
52 private: |
|
53 TName iTestModule; |
|
54 TFileName iConfigFile; |
|
55 TFileName iEngineIniFile; |
|
56 TFileName iModuleIniFile; |
|
57 TBuf<256> iEngineConfigList; |
|
58 TBuf<256> iLogConfigList; |
|
59 RArray<TName> iTestCaseList; |
|
60 |
|
61 RArray<TInt> iTestCaseIndexList; |
|
62 |
|
63 TName iTestCase; |
|
64 TInt iTestCaseIndex; |
|
65 TBool iIsVersion; |
|
66 TBool iIsHelp; |
|
67 TBool iIsPrompt; |
|
68 |
|
69 }; |
|
70 |
|
71 |
|
72 #endif /* CMDPARSER_H_ */ |