|
1 /* |
|
2 * Copyright (c) 2005-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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 /** |
|
21 @file TEFScriptUtils.h |
|
22 */ |
|
23 |
|
24 #if !(defined __TEF_SCRIPT_UTILS_H__) |
|
25 #define __TEF_SCRIPT_UTILS_H__ |
|
26 |
|
27 #include <e32base.h> |
|
28 #include <f32file.h> |
|
29 #include <test/tefexportconst.h> |
|
30 |
|
31 struct TCommandForCounting |
|
32 /** |
|
33 @internalComponent |
|
34 @test |
|
35 */ |
|
36 { |
|
37 TBuf<KMaxTestExecuteNameLength> iCommandName; |
|
38 TInt iCommandCount; |
|
39 }; |
|
40 |
|
41 class CScriptPreProcess : public CBase |
|
42 /** |
|
43 @internalComponent |
|
44 @test |
|
45 */ |
|
46 { |
|
47 public: |
|
48 CScriptPreProcess(const TDesC& aScriptFilePath, TPtrC aCommandList[KTEFCommandCountsStructSize]); |
|
49 ~CScriptPreProcess(); |
|
50 TInt CountNoOfOccurences(); |
|
51 inline TInt GetStructSize(){return iStructSize;}; |
|
52 void RetrieveValues(TInt& aIndex, TDes& aCommandName, TInt& aCommandCount); |
|
53 |
|
54 //private: |
|
55 void CreateScriptDataFromScriptFileL(); |
|
56 TBool GetNextScriptLine(); |
|
57 void UpdateCommandCounts(); |
|
58 |
|
59 private: |
|
60 TBuf<KMaxTestExecuteCommandLength> iScriptFilePath; |
|
61 TInt iStructSize; |
|
62 // Update the array size from TEFExportConst.h whenever the number of commands to count varies |
|
63 TCommandForCounting iCommandsAndCounts[KTEFCommandCountsStructSize]; |
|
64 HBufC16* iScriptData; |
|
65 TLex iScriptLex; |
|
66 TPtrC iCurrentScriptLine; |
|
67 }; |
|
68 |
|
69 #endif |