|
1 /* |
|
2 * Copyright (c) 1998-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 "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 #ifndef __T_ERRORCONVERTER_H__ |
|
20 #define __T_ERRORCONVERTER_H__ |
|
21 |
|
22 #include <e32std.h> |
|
23 |
|
24 class CErrorItem; |
|
25 |
|
26 /** |
|
27 * This class provides useful functions to read and parse the input file. |
|
28 */ |
|
29 class CErrorConverter : public CBase |
|
30 { |
|
31 public: |
|
32 IMPORT_C static CErrorConverter* NewL(void); |
|
33 IMPORT_C static CErrorConverter* NewLC(void); |
|
34 IMPORT_C virtual ~CErrorConverter(); |
|
35 |
|
36 public: |
|
37 /* |
|
38 Searches the list of standard error codes (e32err.h 0 to -46) finding the matching error code for the string |
|
39 |
|
40 Parameters |
|
41 const TDesC& aResult [IN] - Error code string to be searched from |
|
42 TInt &aError [OUT] - Matching error code if found |
|
43 |
|
44 Returns |
|
45 TBool - True if error code was found, False if it was not |
|
46 */ |
|
47 IMPORT_C TBool GetExpectedResultL(const TDesC& aResult /*in*/, TInt &aError /*out*/); |
|
48 /* |
|
49 Searches the list of standard error codes (e32err.h 0 to -46) finding the matching text representaion of the error code |
|
50 |
|
51 Parameters |
|
52 TInt &aError [IN] - Error code to return the string of |
|
53 HBufC*& aResult [OUT] -Reference to a pointer, pointing to the error string of the matching error code (Dont forget to free it) |
|
54 |
|
55 Returns |
|
56 TBool - True if error code was found, False if it was not |
|
57 */ |
|
58 IMPORT_C TBool GetExpectedResultL(const TInt &aError /*in*/, HBufC*& aResult /*out*/); |
|
59 |
|
60 IMPORT_C void AddErrorItem(const TDesC& aErrorName, const TInt &aErrorCode); |
|
61 private: |
|
62 CErrorConverter(){}; |
|
63 void ConstructL(void); |
|
64 void CreateErrorMapL(void); |
|
65 private: |
|
66 RPointerArray<CErrorItem> iErrorMap; |
|
67 }; |
|
68 |
|
69 #endif |