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