epoc32/include/test/tefscriptutils.h
branchSymbian3
changeset 4 837f303aceeb
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
       
     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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 /**
       
    20  @file TEFScriptUtils.h
       
    21 */
       
    22 
       
    23 #if !(defined __TEF_SCRIPT_UTILS_H__)
       
    24 #define __TEF_SCRIPT_UTILS_H__
       
    25 
       
    26 #include <e32base.h>
       
    27 #include <f32file.h>
       
    28 #include <test/tefexportconst.h>
       
    29 
       
    30 struct TCommandForCounting
       
    31 /**
       
    32 @internalComponent
       
    33 @test
       
    34 */
       
    35 	{
       
    36 	TBuf<KMaxTestExecuteNameLength> iCommandName;
       
    37 	TInt iCommandCount;
       
    38 	};
       
    39 
       
    40 class CScriptPreProcess : public CBase
       
    41 /**
       
    42 @internalComponent
       
    43 @test
       
    44 */
       
    45 	{
       
    46 	public:
       
    47 	CScriptPreProcess(const TDesC& aScriptFilePath, TPtrC aCommandList[KTEFCommandCountsStructSize]);
       
    48 	~CScriptPreProcess();
       
    49 	TInt CountNoOfOccurences();
       
    50 	inline TInt GetStructSize(){return iStructSize;};
       
    51 	void RetrieveValues(TInt& aIndex, TDes& aCommandName, TInt& aCommandCount);	
       
    52 	
       
    53 	//private:
       
    54 	void CreateScriptDataFromScriptFileL();
       
    55 	TBool GetNextScriptLine();
       
    56 	void UpdateCommandCounts();
       
    57 	
       
    58 	private:
       
    59 	TBuf<KMaxTestExecuteCommandLength> iScriptFilePath;
       
    60 	TInt iStructSize;
       
    61 	// Update the array size from TEFExportConst.h whenever the number of commands to count varies
       
    62 	TCommandForCounting iCommandsAndCounts[KTEFCommandCountsStructSize];
       
    63 	HBufC16* iScriptData;
       
    64 	TLex iScriptLex;
       
    65 	TPtrC iCurrentScriptLine;
       
    66 	};
       
    67 
       
    68 #endif