cryptomgmtlibs/securitytestfw/test/testhandler2/t_tefinput.h
changeset 8 35751d3474b7
child 19 ece3df019add
equal deleted inserted replaced
2:675a964f4eb5 8:35751d3474b7
       
     1 // Copyright (c) 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 the License "Symbian Foundation License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 #ifndef T_TEFINPUT_H_
       
    18 #define T_TEFINPUT_H_
       
    19 
       
    20 #include <e32cons.h>
       
    21 #include <f32file.h>
       
    22 #include <e32std.h>
       
    23 #include "t_input.h"
       
    24 
       
    25 
       
    26 
       
    27 class Tefinput
       
    28 	{
       
    29 public: // static functions no object required
       
    30 	
       
    31 	// Extracts RUN_TESTSTEP from the whole of script file passed in
       
    32 	IMPORT_C static TPtrC8 ParseRunTestStep(const TDesC8& aBuf, const TDesC8& aTag, TInt& aPos, TInt& aError);
       
    33 	
       
    34 	// Extracts the nth word from the given descritor
       
    35 	IMPORT_C static TPtrC8 ParseNthElement(const TDesC8& aBuf, TInt aWordPos, TInt& aError);
       
    36 	
       
    37 	// Extracts testCaseID from the whole script file
       
    38 	IMPORT_C static TPtrC8 ParseTestCaseID(const TDesC8& aBuf, const TDesC8& aTag, TDes8& aPrevTestID, TInt& aPos, TInt& aError, TBool& testSet, TBool& startTest);
       
    39 			
       
    40 	// Generates the path for .ini file from the .script file path
       
    41 	IMPORT_C static TInt ParseiniPath(const TDesC8& aIniFileName, const TDesC& aScriptPath, TDes& aIniFilePath);
       
    42 	
       
    43 	// Reads the whole of .ini file contents, calls ParseActionbody()to extract info between <actionbody></actionbody>tags
       
    44 	IMPORT_C static HBufC8* GetiniFile(RFs& aFs, const TDesC& aIniFilePath, TInt& err);
       
    45 	
       
    46 	// Extracts info between <actionbody></actionbody>tags from the inifile contents
       
    47 	IMPORT_C static TInt ParseActionbody(TPtrC8& aBuf, const TDesC8& aIniTag, TPtrC8& aSectionBody);
       
    48 	
       
    49 	// Takes in an integer and returns the appropriate error code with <return></return> tags
       
    50 	IMPORT_C static TInt GetActionResult(TInt aErrCode, TDes8& aReturnTag);
       
    51 	
       
    52 	// Checks if the first word in RUN_TEST_STEP is an error code. If, then calls GetActionResult().
       
    53 	IMPORT_C static TInt ParseActionResult(const TDesC8& aBuf, TDes8& aActionResult);
       
    54 	
       
    55 	
       
    56 	// Removes any /t, /n and empty spaces from any extracted data.
       
    57 	IMPORT_C static TPtrC8 Trim(const TDesC8& aBuf);
       
    58 	
       
    59 	//Removes '_' that is joining 2 words
       
    60 	IMPORT_C static TDes8 TrimActionType(const TDesC8& aBuf, TDes8& aType);
       
    61 	
       
    62 	//Returns ETRUE if reached end of a testcase
       
    63 	IMPORT_C static TBool EndTestCase(const TDesC8& aBuf, const TDesC8& aRunStep, const TDesC8& aTag, TInt& aPos);
       
    64 
       
    65 	
       
    66 };
       
    67 
       
    68 #endif