| author | shrivatsa |
| Mon, 27 Sep 2010 14:51:17 +0530 | |
| changeset 12 | a0eee409ff14 |
| parent 3 | ebe3f8f03b59 |
| 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 |
#include "ReportIssue.h" |
|
20 |
#include "Issues.h" |
|
21 |
||
22 |
||
23 |
||
24 |
||
25 |
// ---------------------------------------------------------------------------- |
|
26 |
// ReportIssue::ReportIssue |
|
27 |
// |
|
28 |
// ---------------------------------------------------------------------------- |
|
29 |
// |
|
30 |
ReportIssue::ReportIssue() |
|
31 |
{
|
|
32 |
||
33 |
} |
|
34 |
||
35 |
// ---------------------------------------------------------------------------- |
|
36 |
// ReportIssue::ReportIssue |
|
37 |
// |
|
38 |
// ---------------------------------------------------------------------------- |
|
39 |
// |
|
40 |
ReportIssue::ReportIssue(int aIssueId, const string& aFile, |
|
41 |
const string& aFQName, const TIssueIdentity& aIdentityId, |
|
42 |
const TIssueType& aTypeId, const TBCSeverity& aBCSeverityId, |
|
|
3
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
43 |
const TSCSeverity& aSCSeverityId, const string& aIgnoreInformation, |
|
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
44 |
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
|
45 |
const string& aCompilationError, bool alineNoNeeded): |
| 0 | 46 |
iHeaderFile(aFile), |
47 |
iFQName(aFQName), |
|
48 |
iId(aIssueId), |
|
49 |
iBCSeverity(aBCSeverityId), |
|
50 |
iSCSeverity(aSCSeverityId), |
|
51 |
iIgnoreInformation(aIgnoreInformation), |
|
52 |
iIdentityId(aIdentityId), |
|
53 |
iTypeId(aTypeId), |
|
54 |
iLineNumber( aLineNumber ), |
|
|
3
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
55 |
iIssueLoc(aIssueLoc), |
| 0 | 56 |
iCompareFileName( aCompareFileName ), |
|
3
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
57 |
iCompilationError(aCompilationError) |
| 0 | 58 |
{
|
59 |
} |
|
60 |
||
61 |
// ---------------------------------------------------------------------------- |
|
62 |
// ReportIssue::~ReportIssue |
|
63 |
// |
|
64 |
// ---------------------------------------------------------------------------- |
|
65 |
// |
|
66 |
ReportIssue::~ReportIssue() |
|
67 |
{
|
|
68 |
} |
|
69 |
||
70 |
// ---------------------------------------------------------------------------- |
|
71 |
// ReportIssue::SetId |
|
72 |
// |
|
73 |
// ---------------------------------------------------------------------------- |
|
74 |
// |
|
75 |
void ReportIssue::SetId(const int aId) |
|
76 |
{
|
|
77 |
iId = aId; |
|
78 |
} |
|
79 |
||
80 |
// ---------------------------------------------------------------------------- |
|
81 |
// ReportIssue::SetBCSeverity |
|
82 |
// ---------------------------------------------------------------------------- |
|
83 |
// |
|
84 |
void ReportIssue::SetBCSeverity(const TBCSeverity& aBCSeverity) |
|
85 |
{
|
|
86 |
iBCSeverity = aBCSeverity; |
|
87 |
} |
|
88 |
||
89 |
// ---------------------------------------------------------------------------- |
|
90 |
// ReportIssue::SetSCSeverity |
|
91 |
// ---------------------------------------------------------------------------- |
|
92 |
// |
|
93 |
void ReportIssue::SetSCSeverity(const TSCSeverity& aSCSeverity) |
|
94 |
{
|
|
95 |
iSCSeverity = aSCSeverity; |
|
96 |
} |
|
97 |
||
98 |
// ---------------------------------------------------------------------------- |
|
99 |
// ReportIssue::SetFQName |
|
100 |
// ---------------------------------------------------------------------------- |
|
101 |
// |
|
102 |
void ReportIssue::SetFQName(const string& aFQName) |
|
103 |
{
|
|
104 |
iFQName = aFQName; |
|
105 |
} |
|
106 |
||
107 |
// ---------------------------------------------------------------------------- |
|
108 |
// ReportIssue::SetFQName |
|
109 |
// ---------------------------------------------------------------------------- |
|
110 |
// |
|
111 |
void ReportIssue::SetHeaderFile(const string& aFile) |
|
112 |
{
|
|
113 |
iHeaderFile = aFile; |
|
114 |
} |
|
115 |
||
116 |
||
117 |
// ---------------------------------------------------------------------------- |
|
118 |
// ReportIssue::SetIdentityId |
|
119 |
// ---------------------------------------------------------------------------- |
|
120 |
// |
|
121 |
void ReportIssue::SetIdentityId(const TIssueIdentity& aIdentityId) |
|
122 |
{
|
|
123 |
iIdentityId = aIdentityId; |
|
124 |
} |
|
125 |
||
126 |
// ---------------------------------------------------------------------------- |
|
127 |
// ReportIssue::SetTypeId |
|
128 |
// |
|
129 |
// ---------------------------------------------------------------------------- |
|
130 |
// |
|
131 |
void ReportIssue::SetTypeId(const TIssueType& aTypeId) |
|
132 |
{
|
|
133 |
iTypeId = aTypeId; |
|
134 |
} |
|
135 |
||
136 |
// ---------------------------------------------------------------------------- |
|
137 |
// ReportIssue::Id |
|
138 |
// ---------------------------------------------------------------------------- |
|
139 |
// |
|
140 |
int ReportIssue::Id() const |
|
141 |
{
|
|
142 |
return iId; |
|
143 |
} |
|
144 |
||
145 |
// ---------------------------------------------------------------------------- |
|
146 |
// ReportIssue::BCSeverity |
|
147 |
// ---------------------------------------------------------------------------- |
|
148 |
// |
|
149 |
const TBCSeverity& ReportIssue::BCSeverity() const |
|
150 |
{
|
|
151 |
return iBCSeverity; |
|
152 |
} |
|
153 |
||
154 |
// ---------------------------------------------------------------------------- |
|
155 |
// ReportIssue::SCSeverity |
|
156 |
// ---------------------------------------------------------------------------- |
|
157 |
// |
|
158 |
const TSCSeverity& ReportIssue::SCSeverity() const |
|
159 |
{
|
|
160 |
return iSCSeverity; |
|
161 |
} |
|
162 |
||
163 |
// ---------------------------------------------------------------------------- |
|
164 |
// ReportIssue::FQName |
|
165 |
// ---------------------------------------------------------------------------- |
|
166 |
// |
|
167 |
const string& ReportIssue::FQName() const |
|
168 |
{
|
|
169 |
return iFQName; |
|
170 |
} |
|
171 |
||
172 |
// ---------------------------------------------------------------------------- |
|
173 |
// ReportIssue::HeaderFile |
|
174 |
// |
|
175 |
// ---------------------------------------------------------------------------- |
|
176 |
// |
|
177 |
const string& ReportIssue::HeaderFile() const |
|
178 |
{
|
|
179 |
return iHeaderFile; |
|
180 |
} |
|
181 |
||
182 |
// ---------------------------------------------------------------------------- |
|
183 |
// ReportIssue::FQName |
|
184 |
// |
|
185 |
// ---------------------------------------------------------------------------- |
|
186 |
// |
|
187 |
const TIssueIdentity& ReportIssue::IdentityId() const |
|
188 |
{
|
|
189 |
return iIdentityId; |
|
190 |
} |
|
191 |
||
192 |
// ---------------------------------------------------------------------------- |
|
193 |
// ReportIssue::TypeId |
|
194 |
// ---------------------------------------------------------------------------- |
|
195 |
// |
|
196 |
const TIssueType& ReportIssue::TypeId() const |
|
197 |
{
|
|
198 |
return iTypeId; |
|
199 |
} |
|
200 |
||
201 |
// ---------------------------------------------------------------------------- |
|
202 |
// ReportIssue::BCSeverityDescription |
|
203 |
// ---------------------------------------------------------------------------- |
|
204 |
// |
|
205 |
const char* ReportIssue::BCSeverityDescription() const |
|
206 |
{
|
|
207 |
return KSeverityDesc[iBCSeverity]; |
|
208 |
} |
|
209 |
||
210 |
// ---------------------------------------------------------------------------- |
|
211 |
// ReportIssue::SCSeverityDescription |
|
212 |
// ---------------------------------------------------------------------------- |
|
213 |
// |
|
214 |
const char* ReportIssue::SCSeverityDescription() const |
|
215 |
{
|
|
216 |
return KSeveritySCDesc[iSCSeverity]; |
|
217 |
} |
|
218 |
||
219 |
// ---------------------------------------------------------------------------- |
|
220 |
// ReportIssue::IdentityDescription |
|
221 |
// ---------------------------------------------------------------------------- |
|
222 |
// |
|
223 |
const char* ReportIssue::IdentityDescription() const |
|
224 |
{
|
|
225 |
return KIssueIdentityDesc[iIdentityId]; |
|
226 |
} |
|
227 |
||
228 |
// ---------------------------------------------------------------------------- |
|
229 |
// ReportIssue::TypeDescription |
|
230 |
// ---------------------------------------------------------------------------- |
|
231 |
// |
|
232 |
const char* ReportIssue::TypeDescription() const |
|
233 |
{
|
|
234 |
return KIssueTypeDesc[iTypeId]; |
|
235 |
} |
|
236 |
||
237 |
// ---------------------------------------------------------------------------- |
|
238 |
// ReportIssue::IgnoreInformationDescription |
|
239 |
// ---------------------------------------------------------------------------- |
|
240 |
// |
|
241 |
const string& ReportIssue::IgnoreInformationDescription() const |
|
242 |
{
|
|
243 |
return iIgnoreInformation; |
|
244 |
} |
|
245 |
||
246 |
// ---------------------------------------------------------------------------- |
|
247 |
// ReportIssue::LineNumber |
|
248 |
// ---------------------------------------------------------------------------- |
|
249 |
// |
|
250 |
int ReportIssue::LineNumber() const |
|
251 |
{
|
|
252 |
return iLineNumber; |
|
253 |
} |
|
254 |
void ReportIssue::SetLineNumber(int lineNumber) |
|
255 |
{
|
|
256 |
iLineNumber = lineNumber; |
|
257 |
} |
|
258 |
||
259 |
// ---------------------------------------------------------------------------- |
|
|
3
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
260 |
// ReportIssue::LineNumber |
|
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
261 |
// ---------------------------------------------------------------------------- |
|
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
262 |
// |
|
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
263 |
const string& ReportIssue::IssueLocation() const |
|
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
264 |
{
|
|
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
265 |
return iIssueLoc; |
|
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
266 |
} |
|
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
267 |
|
|
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
268 |
// ---------------------------------------------------------------------------- |
| 0 | 269 |
// ReportIssue::CompareFileName |
270 |
// ---------------------------------------------------------------------------- |
|
271 |
// |
|
272 |
const string& ReportIssue::CompareFileName() const |
|
273 |
{
|
|
274 |
return iCompareFileName; |
|
275 |
} |
|
276 |
||
277 |
// ---------------------------------------------------------------------------- |
|
278 |
// ReportIssue::Cause of compilation error |
|
279 |
// ---------------------------------------------------------------------------- |
|
280 |
// |
|
281 |
const string& ReportIssue::CompilationError() const |
|
282 |
{
|
|
283 |
return iCompilationError; |
|
284 |
} |
|
285 |
||
286 |
// ---------------------------------------------------------------------------- |
|
287 |
// ReportIssue::ReportIssue |
|
288 |
// ---------------------------------------------------------------------------- |
|
289 |
// |
|
290 |
ReportIssue::ReportIssue(const ReportIssue & other) |
|
291 |
{
|
|
292 |
(*this)=other; |
|
293 |
} |
|
294 |
||
295 |
// ---------------------------------------------------------------------------- |
|
296 |
// ReportIssue::FQName |
|
297 |
// ---------------------------------------------------------------------------- |
|
298 |
// |
|
299 |
const ReportIssue& ReportIssue::operator=(const ReportIssue& other) |
|
300 |
{
|
|
301 |
iHeaderFile=other.iHeaderFile; |
|
302 |
iFQName=other.iFQName; |
|
303 |
iId=other.iId; |
|
304 |
iBCSeverity=other.iBCSeverity; |
|
305 |
iSCSeverity=other.iSCSeverity; |
|
306 |
iIgnoreInformation=other.iIgnoreInformation; |
|
307 |
iIdentityId=other.iIdentityId; |
|
308 |
iTypeId=other.iTypeId; |
|
309 |
iLineNumber=other.iLineNumber; |
|
|
3
ebe3f8f03b59
Compatibility Analyser updated to version 2.8.4. Support for Qt code analysis added.
noe\swadi
parents:
0
diff
changeset
|
310 |
iIssueLoc=other.iIssueLoc; |
| 0 | 311 |
iCompareFileName=other.iCompareFileName; |
312 |
iCompilationError=other.iCompilationError; |
|
313 |
return (*this); |
|
314 |
} |
|
315 |
||
316 |
bool ReportIssue::operator<(const ReportIssue& other) const |
|
317 |
{
|
|
318 |
if (iFQName == other.iFQName) |
|
319 |
{
|
|
320 |
if ( iIdentityId == other.iIdentityId ) |
|
321 |
{
|
|
322 |
return iTypeId < other.iTypeId; |
|
323 |
} |
|
324 |
else |
|
325 |
{
|
|
326 |
return iIdentityId < other.iIdentityId; |
|
327 |
} |
|
328 |
}else |
|
329 |
{
|
|
330 |
return iFQName < other.iFQName; |
|
331 |
} |
|
332 |
} |
|
333 |
||
334 |
bool ReportIssue::operator==(const ReportIssue& other) const |
|
335 |
{
|
|
336 |
return ((*this) < other == false) && |
|
337 |
(other < (*this) == false); |
|
338 |
} |