| author | noe\swadi |
| Mon, 26 Apr 2010 16:28:13 +0530 | |
| changeset 3 | ebe3f8f03b59 |
| parent 0 | 638b9c697799 |
| permissions | -rw-r--r-- |
| 0 | 1 |
/* |
2 |
* Copyright (c) 2006-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 "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 __REPORT_ISSUE_H__ |
|
20 |
#define __REPORT_ISSUE_H__ |
|
21 |
||
22 |
#include "CmdGlobals.h" |
|
23 |
#ifdef __WIN__ |
|
24 |
#pragma warning(disable:4786) |
|
25 |
#endif |
|
26 |
||
27 |
||
28 |
#include <xercesc/dom/DOM.hpp> |
|
29 |
||
30 |
XERCES_CPP_NAMESPACE_USE |
|
31 |
||
32 |
||
33 |
#include <string> |
|
34 |
||
35 |
using namespace std; |
|
36 |
||
37 |
// Severity of the issue found for binary compatibility |
|
38 |
enum TBCSeverity |
|
39 |
{
|
|
40 |
ESeverityNULL = 0, |
|
41 |
ESeverityBBCBreak, |
|
42 |
ESeverityPossibleBBCBreak, |
|
43 |
ESeverityInformative, |
|
44 |
ESeverityFCBreak, |
|
45 |
ESeverityPossibleFCBreak, |
|
46 |
ESeverityCount |
|
47 |
}; |
|
48 |
||
49 |
// Severity of the issue found for source compatibility |
|
50 |
enum TSCSeverity |
|
51 |
{
|
|
52 |
ESeveritySCNULL = 0, |
|
53 |
ESeveritySCBreak, |
|
54 |
ESeverityPossibleSCBreak, |
|
55 |
ESeveritySCInformative, |
|
56 |
ESeveritySCCount |
|
57 |
}; |
|
58 |
||
59 |
// Identity of the issue found |
|
60 |
enum TIssueIdentity |
|
61 |
{
|
|
62 |
EIssueIdentityClass, |
|
63 |
EIssueIdentityExportedFunction, |
|
64 |
EIssueIdentityInlineFunction, |
|
65 |
EIssueIdentityVirtualFunction, |
|
66 |
EIssueIdentityEnumeration, |
|
67 |
EIssueIdentityStruct, |
|
68 |
EIssueIdentityUnion, |
|
69 |
EIssueIdentityEnumerationValue, |
|
70 |
EIssueIdentityTypedef, |
|
71 |
EIssueIdentityVariable, |
|
72 |
EIssueIdentityField, |
|
73 |
EIssueIdentityFieldInaccessible, |
|
74 |
EIssueIdentityMacro, |
|
75 |
EIssueIdentityFile, |
|
76 |
EIssueIdentityVirtualTable, |
|
77 |
EIssueIdentitySubobject, |
|
78 |
EIssueIdentityVirtualTablePointer, |
|
79 |
EIssueIdentityExportedInlineFunction, |
|
80 |
EIssueIdentityExportedVirtualFunction, |
|
81 |
EIssueIdentityVirtualInlineFunction, |
|
82 |
EIssueIdentityExportedVirtualInlineFunction, |
|
83 |
EIssueIdentityStructMember, |
|
84 |
EIssueIdentityCount |
|
85 |
||
86 |
}; |
|
87 |
||
88 |
// What kind of issue was happened in the code between two |
|
89 |
// versions of the comparable header files |
|
90 |
enum TIssueType |
|
91 |
{
|
|
92 |
EIssueTypeRemoval, |
|
93 |
EIssueTypeAddition, |
|
94 |
EIssueTypeChange, |
|
95 |
EIssueTypeSize, |
|
96 |
EIssueTypeAlign, |
|
97 |
EIssueTypeParam, |
|
98 |
EIssueTypeReturn, |
|
99 |
EIssueTypeAccess, |
|
100 |
EIssueTypeInheritance, |
|
101 |
EIssueTypeOffset, |
|
102 |
EIssueTypeOrderChange, |
|
103 |
EIssueTypeChangeInType, |
|
104 |
EIssueTypeChangeInInitialisation, |
|
105 |
EIssueTypeCompilationError, |
|
106 |
EIssueTypeNotAnalysed, |
|
107 |
EIssueTypeVirtualBases, |
|
108 |
EIssueTypeNewOverride, |
|
109 |
//EIssueTypeRemovedOverride, |
|
110 |
EIssueTypeEmpty, |
|
111 |
EIssueTypeBaseSize, |
|
112 |
EIssueTypeUnderConstruction, |
|
113 |
EIssueTypeParamConst, |
|
114 |
EIssueTypeParamConst2, |
|
115 |
EIssueTypeReturnConst, |
|
116 |
EIssueTypeReturnConst2, |
|
|
3
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
117 |
EIssueTypeDefaultParam, |
|
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
118 |
EIssueTypeOverload, |
| 0 | 119 |
EIssueTypeCount |
120 |
}; |
|
121 |
||
122 |
||
123 |
/** |
|
124 |
* The ReportIssues class is a data class that encapsulates |
|
125 |
* the data for an issue. |
|
126 |
*/ |
|
127 |
class ReportIssue |
|
128 |
{
|
|
129 |
friend class ReportGenerator; |
|
130 |
public: |
|
131 |
/* |
|
132 |
*Constructor |
|
133 |
* @param aIssueId the unique id of the issue in this report, running number |
|
134 |
* @param aFile the file where the issue is |
|
135 |
* @param aFQName the fully qualified name of the cause |
|
136 |
* @param aIssueIdentityId the issue identity id (class, enum, struct...) |
|
137 |
* @param aIssueTypeId the issue type (removed, added, changed...) |
|
138 |
* @param aBCSeverityId binary compatibility severity of the issue found |
|
139 |
* @param aSCSeverityId source compatibility severity of the issue found |
|
140 |
* @param aIgnoreInformation information needed for ignoring the issue |
|
141 |
* @param aLineNumber line where the issue is |
|
|
3
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
142 |
* @param aIssueLoc filename where the issue is |
| 0 | 143 |
* @param aCompareFileName |
144 |
* @param aCompilationError |
|
145 |
*/ |
|
146 |
ReportIssue(int aIssueId, const string& aFile, |
|
147 |
const string& aFQName, const TIssueIdentity& aIssueIdentityId, |
|
148 |
const TIssueType& aIssueTypeId, const TBCSeverity& aBCSeverityId, |
|
149 |
const TSCSeverity& aSCSeverityId, const string& aIgnoreInformation, |
|
|
3
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
150 |
int aLineNumber, const string& aIssueLoc, const string& aCompareFileName, |
|
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
151 |
const string& aCompilationError = "", bool alineNoNeeded = true); |
| 0 | 152 |
|
153 |
||
154 |
/** |
|
155 |
* Constructor |
|
156 |
*/ |
|
157 |
ReportIssue(); |
|
158 |
||
159 |
/** |
|
160 |
* Destructor |
|
161 |
*/ |
|
162 |
~ReportIssue(); |
|
163 |
||
164 |
/** |
|
165 |
* Constructor |
|
166 |
* @param other issue to report |
|
167 |
*/ |
|
168 |
ReportIssue(const ReportIssue & other); |
|
169 |
||
170 |
const ReportIssue& operator=(const ReportIssue& other); |
|
171 |
||
172 |
bool operator<(const ReportIssue& other) const; |
|
173 |
bool operator==(const ReportIssue& other) const; |
|
174 |
public: |
|
175 |
/** |
|
176 |
* Set issue id |
|
177 |
* @param aId id number to set |
|
178 |
*/ |
|
179 |
void SetId(const int aId); |
|
180 |
||
181 |
/** |
|
182 |
* Set binary compatibility severity level of the issue |
|
183 |
* @param aId reference to severity (TBCSeverity&) |
|
184 |
*/ |
|
185 |
void SetBCSeverity(const TBCSeverity& aId); |
|
186 |
||
187 |
/** |
|
188 |
* Set source compatibility severity level of the issue |
|
189 |
* @param aId reference to severity (TSCSeverity&) |
|
190 |
*/ |
|
191 |
void SetSCSeverity(const TSCSeverity& aId); |
|
192 |
||
193 |
/** |
|
194 |
* Set fully qualified name |
|
195 |
* @param aCause full |
|
196 |
*/ |
|
197 |
void SetFQName(const string& aCause); |
|
198 |
||
199 |
/** |
|
200 |
* Set headerfile |
|
201 |
* @param aFile name of the header file |
|
202 |
*/ |
|
203 |
void SetHeaderFile(const string& aFile); |
|
204 |
||
205 |
/** |
|
206 |
* Get identity |
|
207 |
* @param aIdentityId TIssueIdentity reference to the issue identity id (class, enum, struct...) |
|
208 |
*/ |
|
209 |
void SetIdentityId(const TIssueIdentity& aIdentityId); |
|
210 |
||
211 |
/** |
|
212 |
* Set type id |
|
213 |
* @param aTypeId the issue type (removed, added, changed...) |
|
214 |
*/ |
|
215 |
void SetTypeId(const TIssueType& aTypeId); |
|
216 |
||
217 |
/** |
|
218 |
* Get issue ID |
|
219 |
*/ |
|
220 |
int Id() const; |
|
221 |
||
222 |
/** |
|
223 |
* Get binary compatibility severity level |
|
224 |
* @return reference to severity level |
|
225 |
*/ |
|
226 |
const TBCSeverity& BCSeverity() const; |
|
227 |
||
228 |
/** |
|
229 |
* Get source compatibility severity level |
|
230 |
* @return reference to severity level |
|
231 |
*/ |
|
232 |
const TSCSeverity& SCSeverity() const; |
|
233 |
||
234 |
/** |
|
235 |
* Get fully qualified name of the issue |
|
236 |
* @return reference to fully qualified name |
|
237 |
*/ |
|
238 |
const string& FQName() const; |
|
239 |
||
240 |
/** |
|
241 |
* Get header filename |
|
242 |
* @return name of the file |
|
243 |
*/ |
|
244 |
const string& HeaderFile() const; |
|
245 |
||
246 |
/** |
|
247 |
* Get identity ID |
|
248 |
* @return reference to issue identity |
|
249 |
*/ |
|
250 |
const TIssueIdentity& IdentityId() const; |
|
251 |
||
252 |
/** |
|
253 |
* Get issue type id |
|
254 |
* @return reference to issue type |
|
255 |
*/ |
|
256 |
const TIssueType& TypeId() const; |
|
257 |
||
258 |
/** |
|
259 |
* Get sbinary compatibility severity description string |
|
260 |
* @return description string |
|
261 |
*/ |
|
262 |
const char* BCSeverityDescription() const; |
|
263 |
||
264 |
/** |
|
265 |
* Get source compatibility severity description string |
|
266 |
* @return description string |
|
267 |
*/ |
|
268 |
const char* SCSeverityDescription() const; |
|
269 |
||
270 |
/** |
|
271 |
* Get identity description |
|
272 |
* @return description string |
|
273 |
*/ |
|
274 |
const char* IdentityDescription() const; |
|
275 |
||
276 |
/** |
|
277 |
* Get type description |
|
278 |
* @return description string |
|
279 |
*/ |
|
280 |
const char* TypeDescription() const; |
|
281 |
||
282 |
/** |
|
283 |
* Get ignore information description (information needed for ignoring |
|
284 |
* the issue) |
|
285 |
* @return information description string |
|
286 |
*/ |
|
287 |
const string& IgnoreInformationDescription() const; |
|
288 |
||
289 |
/** |
|
290 |
* Get line number |
|
291 |
* @return line number |
|
292 |
*/ |
|
293 |
int LineNumber() const; |
|
294 |
||
295 |
void SetLineNumber(const int lineNumber); |
|
|
3
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
296 |
|
|
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
297 |
/** |
|
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
298 |
* Get issue location file name |
|
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
299 |
* @return file name string |
|
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
300 |
*/ |
|
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
301 |
|
|
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
302 |
const string& IssueLocation() const; |
| 0 | 303 |
|
304 |
/** |
|
305 |
* Get compare filename |
|
306 |
* @return filename string |
|
307 |
*/ |
|
308 |
const string& CompareFileName() const; |
|
309 |
||
310 |
/** |
|
311 |
* Return reson behind the compilation error |
|
312 |
*/ |
|
313 |
const string& CompilationError() const; |
|
314 |
||
315 |
||
316 |
private: |
|
317 |
//! Headerfile where the issue is found from |
|
318 |
string iHeaderFile; |
|
319 |
||
320 |
//! Fully qualified name of the cause |
|
321 |
string iFQName; |
|
322 |
||
323 |
//! ID number of the issua |
|
324 |
int iId; |
|
325 |
||
326 |
//! How severe is the issue found for binary comaptibility |
|
327 |
TBCSeverity iBCSeverity; |
|
328 |
||
329 |
//! How severe is the issue found for source comaptibility |
|
330 |
TSCSeverity iSCSeverity; |
|
331 |
||
332 |
//! Information needed for ignoring the issue |
|
333 |
string iIgnoreInformation; |
|
334 |
||
335 |
//! What was happened in the code |
|
336 |
TIssueIdentity iIdentityId; |
|
337 |
||
338 |
//! type id of the issue |
|
339 |
TIssueType iTypeId; |
|
340 |
||
341 |
//! Line number |
|
342 |
int iLineNumber; |
|
343 |
||
|
3
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
344 |
//! Compare filename |
|
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
345 |
string iIssueLoc; |
|
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
346 |
|
| 0 | 347 |
//! Compare filename |
348 |
string iCompareFileName; |
|
349 |
||
350 |
//! Cause of compilation error |
|
351 |
string iCompilationError; |
|
352 |
||
353 |
||
354 |
}; |
|
355 |
||
356 |
#endif |