|
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,
|
|
|
117 |
EIssueTypeCount
|
|
|
118 |
};
|
|
|
119 |
|
|
|
120 |
|
|
|
121 |
/**
|
|
|
122 |
* The ReportIssues class is a data class that encapsulates
|
|
|
123 |
* the data for an issue.
|
|
|
124 |
*/
|
|
|
125 |
class ReportIssue
|
|
|
126 |
{
|
|
|
127 |
friend class ReportGenerator;
|
|
|
128 |
public:
|
|
|
129 |
/*
|
|
|
130 |
*Constructor
|
|
|
131 |
* @param aIssueId the unique id of the issue in this report, running number
|
|
|
132 |
* @param aFile the file where the issue is
|
|
|
133 |
* @param aFQName the fully qualified name of the cause
|
|
|
134 |
* @param aIssueIdentityId the issue identity id (class, enum, struct...)
|
|
|
135 |
* @param aIssueTypeId the issue type (removed, added, changed...)
|
|
|
136 |
* @param aBCSeverityId binary compatibility severity of the issue found
|
|
|
137 |
* @param aSCSeverityId source compatibility severity of the issue found
|
|
|
138 |
* @param aIgnoreInformation information needed for ignoring the issue
|
|
|
139 |
* @param aLineNumber line where the issue is
|
|
|
140 |
* @param aCompareFileName
|
|
|
141 |
* @param aCompilationError
|
|
|
142 |
*/
|
|
|
143 |
ReportIssue(int aIssueId, const string& aFile,
|
|
|
144 |
const string& aFQName, const TIssueIdentity& aIssueIdentityId,
|
|
|
145 |
const TIssueType& aIssueTypeId, const TBCSeverity& aBCSeverityId,
|
|
|
146 |
const TSCSeverity& aSCSeverityId, const string& aIgnoreInformation,
|
|
|
147 |
int aLineNumber, const string& aCompareFileName, const string& aCompilationError = "", bool alineNoNeeded = true);
|
|
|
148 |
|
|
|
149 |
|
|
|
150 |
/**
|
|
|
151 |
* Constructor
|
|
|
152 |
*/
|
|
|
153 |
ReportIssue();
|
|
|
154 |
|
|
|
155 |
/**
|
|
|
156 |
* Destructor
|
|
|
157 |
*/
|
|
|
158 |
~ReportIssue();
|
|
|
159 |
|
|
|
160 |
/**
|
|
|
161 |
* Constructor
|
|
|
162 |
* @param other issue to report
|
|
|
163 |
*/
|
|
|
164 |
ReportIssue(const ReportIssue & other);
|
|
|
165 |
|
|
|
166 |
const ReportIssue& operator=(const ReportIssue& other);
|
|
|
167 |
|
|
|
168 |
bool operator<(const ReportIssue& other) const;
|
|
|
169 |
bool operator==(const ReportIssue& other) const;
|
|
|
170 |
public:
|
|
|
171 |
/**
|
|
|
172 |
* Set issue id
|
|
|
173 |
* @param aId id number to set
|
|
|
174 |
*/
|
|
|
175 |
void SetId(const int aId);
|
|
|
176 |
|
|
|
177 |
/**
|
|
|
178 |
* Set binary compatibility severity level of the issue
|
|
|
179 |
* @param aId reference to severity (TBCSeverity&)
|
|
|
180 |
*/
|
|
|
181 |
void SetBCSeverity(const TBCSeverity& aId);
|
|
|
182 |
|
|
|
183 |
/**
|
|
|
184 |
* Set source compatibility severity level of the issue
|
|
|
185 |
* @param aId reference to severity (TSCSeverity&)
|
|
|
186 |
*/
|
|
|
187 |
void SetSCSeverity(const TSCSeverity& aId);
|
|
|
188 |
|
|
|
189 |
/**
|
|
|
190 |
* Set fully qualified name
|
|
|
191 |
* @param aCause full
|
|
|
192 |
*/
|
|
|
193 |
void SetFQName(const string& aCause);
|
|
|
194 |
|
|
|
195 |
/**
|
|
|
196 |
* Set headerfile
|
|
|
197 |
* @param aFile name of the header file
|
|
|
198 |
*/
|
|
|
199 |
void SetHeaderFile(const string& aFile);
|
|
|
200 |
|
|
|
201 |
/**
|
|
|
202 |
* Get identity
|
|
|
203 |
* @param aIdentityId TIssueIdentity reference to the issue identity id (class, enum, struct...)
|
|
|
204 |
*/
|
|
|
205 |
void SetIdentityId(const TIssueIdentity& aIdentityId);
|
|
|
206 |
|
|
|
207 |
/**
|
|
|
208 |
* Set type id
|
|
|
209 |
* @param aTypeId the issue type (removed, added, changed...)
|
|
|
210 |
*/
|
|
|
211 |
void SetTypeId(const TIssueType& aTypeId);
|
|
|
212 |
|
|
|
213 |
/**
|
|
|
214 |
* Get issue ID
|
|
|
215 |
*/
|
|
|
216 |
int Id() const;
|
|
|
217 |
|
|
|
218 |
/**
|
|
|
219 |
* Get binary compatibility severity level
|
|
|
220 |
* @return reference to severity level
|
|
|
221 |
*/
|
|
|
222 |
const TBCSeverity& BCSeverity() const;
|
|
|
223 |
|
|
|
224 |
/**
|
|
|
225 |
* Get source compatibility severity level
|
|
|
226 |
* @return reference to severity level
|
|
|
227 |
*/
|
|
|
228 |
const TSCSeverity& SCSeverity() const;
|
|
|
229 |
|
|
|
230 |
/**
|
|
|
231 |
* Get fully qualified name of the issue
|
|
|
232 |
* @return reference to fully qualified name
|
|
|
233 |
*/
|
|
|
234 |
const string& FQName() const;
|
|
|
235 |
|
|
|
236 |
/**
|
|
|
237 |
* Get header filename
|
|
|
238 |
* @return name of the file
|
|
|
239 |
*/
|
|
|
240 |
const string& HeaderFile() const;
|
|
|
241 |
|
|
|
242 |
/**
|
|
|
243 |
* Get identity ID
|
|
|
244 |
* @return reference to issue identity
|
|
|
245 |
*/
|
|
|
246 |
const TIssueIdentity& IdentityId() const;
|
|
|
247 |
|
|
|
248 |
/**
|
|
|
249 |
* Get issue type id
|
|
|
250 |
* @return reference to issue type
|
|
|
251 |
*/
|
|
|
252 |
const TIssueType& TypeId() const;
|
|
|
253 |
|
|
|
254 |
/**
|
|
|
255 |
* Get sbinary compatibility severity description string
|
|
|
256 |
* @return description string
|
|
|
257 |
*/
|
|
|
258 |
const char* BCSeverityDescription() const;
|
|
|
259 |
|
|
|
260 |
/**
|
|
|
261 |
* Get source compatibility severity description string
|
|
|
262 |
* @return description string
|
|
|
263 |
*/
|
|
|
264 |
const char* SCSeverityDescription() const;
|
|
|
265 |
|
|
|
266 |
/**
|
|
|
267 |
* Get identity description
|
|
|
268 |
* @return description string
|
|
|
269 |
*/
|
|
|
270 |
const char* IdentityDescription() const;
|
|
|
271 |
|
|
|
272 |
/**
|
|
|
273 |
* Get type description
|
|
|
274 |
* @return description string
|
|
|
275 |
*/
|
|
|
276 |
const char* TypeDescription() const;
|
|
|
277 |
|
|
|
278 |
/**
|
|
|
279 |
* Get ignore information description (information needed for ignoring
|
|
|
280 |
* the issue)
|
|
|
281 |
* @return information description string
|
|
|
282 |
*/
|
|
|
283 |
const string& IgnoreInformationDescription() const;
|
|
|
284 |
|
|
|
285 |
/**
|
|
|
286 |
* Get line number
|
|
|
287 |
* @return line number
|
|
|
288 |
*/
|
|
|
289 |
int LineNumber() const;
|
|
|
290 |
|
|
|
291 |
void SetLineNumber(const int lineNumber);
|
|
|
292 |
|
|
|
293 |
/**
|
|
|
294 |
* Get compare filename
|
|
|
295 |
* @return filename string
|
|
|
296 |
*/
|
|
|
297 |
const string& CompareFileName() const;
|
|
|
298 |
|
|
|
299 |
/**
|
|
|
300 |
* Return reson behind the compilation error
|
|
|
301 |
*/
|
|
|
302 |
const string& CompilationError() const;
|
|
|
303 |
|
|
|
304 |
const bool& LineInfoNeeded();
|
|
|
305 |
|
|
|
306 |
|
|
|
307 |
private:
|
|
|
308 |
//! Headerfile where the issue is found from
|
|
|
309 |
string iHeaderFile;
|
|
|
310 |
|
|
|
311 |
//! Fully qualified name of the cause
|
|
|
312 |
string iFQName;
|
|
|
313 |
|
|
|
314 |
//! ID number of the issua
|
|
|
315 |
int iId;
|
|
|
316 |
|
|
|
317 |
//! How severe is the issue found for binary comaptibility
|
|
|
318 |
TBCSeverity iBCSeverity;
|
|
|
319 |
|
|
|
320 |
//! How severe is the issue found for source comaptibility
|
|
|
321 |
TSCSeverity iSCSeverity;
|
|
|
322 |
|
|
|
323 |
//! Information needed for ignoring the issue
|
|
|
324 |
string iIgnoreInformation;
|
|
|
325 |
|
|
|
326 |
//! What was happened in the code
|
|
|
327 |
TIssueIdentity iIdentityId;
|
|
|
328 |
|
|
|
329 |
//! type id of the issue
|
|
|
330 |
TIssueType iTypeId;
|
|
|
331 |
|
|
|
332 |
//! Line number
|
|
|
333 |
int iLineNumber;
|
|
|
334 |
|
|
|
335 |
//! Compare filename
|
|
|
336 |
string iCompareFileName;
|
|
|
337 |
|
|
|
338 |
//! Cause of compilation error
|
|
|
339 |
string iCompilationError;
|
|
|
340 |
|
|
|
341 |
bool iLineNoNeeded;
|
|
|
342 |
|
|
|
343 |
};
|
|
|
344 |
|
|
|
345 |
#endif
|