|
1 /* |
|
2 * Copyright (c) 2007-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 * @internalComponent |
|
16 * @released |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef EXCEPTIONIMPLEMENTATION_H |
|
22 #define EXCEPTIONIMPLEMENTATION_H |
|
23 |
|
24 #include "common.h" |
|
25 |
|
26 typedef std::map<int,String> IndexVsMessageMap; |
|
27 const unsigned int KMAXWARNINGSORERROR = 100; |
|
28 |
|
29 /** |
|
30 To include more error or warning messages, Just include the key word here and |
|
31 write the key word contents into the Message array at ".cpp" file. |
|
32 Then increase the Message array MAX size by number of messages included |
|
33 |
|
34 @internalComponent |
|
35 @released |
|
36 */ |
|
37 enum |
|
38 { |
|
39 UNKNOWNIMAGETYPE = 1, |
|
40 UNKNOWNPREFIX, |
|
41 VALUEEXPECTED, |
|
42 VALUENOTEXPECTED, |
|
43 UNKNOWNOPTION, |
|
44 QUIETMODESELECTED, |
|
45 NOIMAGE, |
|
46 NOROMIMAGE, |
|
47 XMLOPTION, |
|
48 NOMEMORY, |
|
49 FILENAMETOOBIG, |
|
50 XMLNAMENOTVALID, |
|
51 REPORTTYPEINVALID, |
|
52 FILEOPENFAIL, |
|
53 XSLCREATIONFAILED, |
|
54 UNEXPECTEDNUMBEROFVALUE, |
|
55 INVALIDVIDVALUE, |
|
56 UNKNOWNSUPPRESSVAL, |
|
57 ALLCHECKSSUPPRESSED, |
|
58 SUPPRESSCOMBINEDWITHVIDVAL, |
|
59 SIDALLCOMBINEDWITHSID, |
|
60 DATAOVERFLOW, |
|
61 VALIDIMAGE, |
|
62 IMAGENAMEALREADYRECEIVED, |
|
63 UNKNOWNDBGVALUE, |
|
64 ONLYSINGLEDIRECTORYEXPECTED, |
|
65 INVALIDDIRECTORY, |
|
66 INCORRECTVALUES, |
|
67 NOVALIDATIONSENABLED, |
|
68 NOEXEPRESENT, |
|
69 E32INPUTNOTEXIST, |
|
70 VALIDE32INPUT, |
|
71 // Add the New Error and warning messages above this line |
|
72 GATHERINGDEPENDENCIES = 101, |
|
73 WRITINGINTOREPORTER, |
|
74 COLLECTDEPDATA, |
|
75 NOOFEXECUTABLES, |
|
76 NOOFHEXECUTABLES, |
|
77 READINGIMAGE, |
|
78 GATHERINGIDDATA, |
|
79 GENERATINGREPORT, |
|
80 REPORTGENERATION, |
|
81 //Add the new status informations below this line |
|
82 NODISKSPACE |
|
83 }; |
|
84 |
|
85 /** |
|
86 Structure for Messages. |
|
87 |
|
88 @internalComponent |
|
89 @released |
|
90 */ |
|
91 struct Messages |
|
92 { |
|
93 int iIndex; |
|
94 char* iMessage; |
|
95 }; |
|
96 |
|
97 /** |
|
98 Class Exception implementation. |
|
99 |
|
100 @internalComponent |
|
101 @released |
|
102 */ |
|
103 class ExceptionImplementation |
|
104 { |
|
105 public: |
|
106 static ExceptionImplementation* Instance(unsigned int aCmdFlag); |
|
107 static void DeleteInstance(void); |
|
108 String& Message(int aMsgIndex); |
|
109 void Log(const String aMsg); |
|
110 void Report(const String aMsg); |
|
111 |
|
112 private: |
|
113 ofstream iLogStream; |
|
114 IndexVsMessageMap iMessage; |
|
115 unsigned int iMsgIndex; |
|
116 static unsigned int iCmdFlag; |
|
117 static ExceptionImplementation* iInstance; |
|
118 ExceptionImplementation(void); |
|
119 ~ExceptionImplementation(void); |
|
120 }; |
|
121 |
|
122 #endif //EXCEPTIONIMPLEMENTATION_H |