os/security/cryptomgmtlibs/securitytestfw/test/testhandler2/t_errorconverter.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/cryptomgmtlibs/securitytestfw/test/testhandler2/t_errorconverter.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,70 @@
     1.4 +/*
     1.5 +* Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of the License "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#ifndef __T_ERRORCONVERTER_H__
    1.23 +#define __T_ERRORCONVERTER_H__
    1.24 +
    1.25 +#include <e32std.h>
    1.26 +
    1.27 +class CErrorItem;
    1.28 +
    1.29 +/**
    1.30 + * This class provides useful functions to read and parse the input file.
    1.31 + */
    1.32 +class CErrorConverter : public CBase
    1.33 +	{
    1.34 +public:
    1.35 +	IMPORT_C static CErrorConverter* NewL(void);
    1.36 +	IMPORT_C static CErrorConverter* NewLC(void);
    1.37 +	IMPORT_C virtual ~CErrorConverter();
    1.38 +
    1.39 +public: 
    1.40 +	/*
    1.41 +	Searches the list of standard error codes (e32err.h 0 to -46) finding the matching error code for the string 
    1.42 +
    1.43 +	Parameters
    1.44 +	const TDesC& aResult  	[IN] - Error code string to be searched from
    1.45 +	TInt &aError 	 		[OUT] - Matching error code if found
    1.46 +
    1.47 +	Returns
    1.48 +	TBool			- True if error code was found, False if it was not
    1.49 +	*/
    1.50 +	IMPORT_C TBool GetExpectedResultL(const TDesC& aResult /*in*/, TInt &aError /*out*/);
    1.51 +	/*
    1.52 +	Searches the list of standard error codes (e32err.h 0 to -46) finding the matching text representaion of the error code
    1.53 +
    1.54 +	Parameters
    1.55 +	 TInt &aError 	 	[IN] - Error code to return the string of
    1.56 +	HBufC*& aResult   	[OUT] -Reference to a pointer, pointing to the error string of the matching error code (Dont forget to free it)
    1.57 +
    1.58 +	Returns
    1.59 +	TBool			- True if error code was found, False if it was not
    1.60 +	*/
    1.61 +	IMPORT_C TBool GetExpectedResultL(const TInt &aError /*in*/, HBufC*& aResult /*out*/);
    1.62 +
    1.63 +	IMPORT_C void AddErrorItem(const TDesC& aErrorName, const TInt &aErrorCode);
    1.64 +private:
    1.65 +	CErrorConverter(){};
    1.66 +	void ConstructL(void);
    1.67 +	void CreateErrorMapL(void);
    1.68 +private:
    1.69 +	RPointerArray<CErrorItem> iErrorMap;
    1.70 +	};
    1.71 +
    1.72 +#endif
    1.73 +