220 { |
220 { |
221 ReportIssue* issue = iv_it->second; |
221 ReportIssue* issue = iv_it->second; |
222 |
222 |
223 TIssueIdentity id = issue->IdentityId(); |
223 TIssueIdentity id = issue->IdentityId(); |
224 TIssueType type = issue->TypeId(); |
224 TIssueType type = issue->TypeId(); |
225 if( id == EIssueIdentityFile && type == EIssueTypeEmpty) |
|
226 { |
|
227 notAnalysed = true; |
|
228 lineInfoNeed = issue->LineInfoNeeded(); |
|
229 break; |
|
230 } |
|
231 } |
|
232 if(lineInfoNeed == false) |
|
233 { |
|
234 aIssue->SetLineNumber(0); |
|
235 } |
225 } |
236 if( v->insert(pair<const ReportIssue*, ReportIssue*>(aIssue,aIssue)).second == false ) |
226 if( v->insert(pair<const ReportIssue*, ReportIssue*>(aIssue,aIssue)).second == false ) |
237 { |
227 { |
238 return -1; |
228 return -1; |
239 } |
229 } |
255 // |
245 // |
256 int ReportGenerator::addIssue(const string& aFile, |
246 int ReportGenerator::addIssue(const string& aFile, |
257 const string& aFQName, const TIssueIdentity& aIdentityId, |
247 const string& aFQName, const TIssueIdentity& aIdentityId, |
258 const TIssueType& aTypeId, const TBCSeverity& aBCSeverityId, |
248 const TIssueType& aTypeId, const TBCSeverity& aBCSeverityId, |
259 const TSCSeverity& aSCSeverityId, const string& aIgnoreInformation, |
249 const TSCSeverity& aSCSeverityId, const string& aIgnoreInformation, |
260 int aLineNumber, const string& aCompareFileName, const string& aCompilationError, bool alineNoNeeded ) |
250 int aLineNumber, const string& aIssueLoc, const string& aCompareFileName, |
261 { |
251 const string& aCompilationError ) |
|
252 { |
|
253 ReportIssue* issue; |
262 string fqName = aFQName; |
254 string fqName = aFQName; |
263 int loc = fqName.find(__FUN_MANGLED__); |
255 int loc = fqName.find(__FUN_MANGLED__); |
264 if(loc != -1) |
256 if(loc != -1) |
265 { |
257 { |
266 fqName = fqName.substr(0,loc); |
258 fqName = fqName.substr(0,loc); |
267 } |
259 } |
268 ReportIssue* issue = new ReportIssue(0, aFile, fqName, |
260 string::size_type dirSepInd = aIssueLoc.find_first_of("\\/"); |
269 aIdentityId, aTypeId, aBCSeverityId, aSCSeverityId, aIgnoreInformation, |
261 string isslueloc(aIssueLoc); |
270 aLineNumber, aCompareFileName, aCompilationError, alineNoNeeded ); |
262 if( dirSepInd != string::npos && isslueloc.at(dirSepInd) != DIR_SEPARATOR ) |
271 |
263 { |
272 /*return*/ |
264 // We need to convert to proper dir-separator |
273 int ret = addIssue(issue); |
265 replaceChar(isslueloc, isslueloc.at(dirSepInd), DIR_SEPARATOR); |
274 if( ret == -1) |
266 } |
275 { |
267 if(isslueloc == aCompareFileName) |
276 delete issue; |
268 issue = new ReportIssue(0, aFile, fqName, |
277 } |
269 aIdentityId, aTypeId, aBCSeverityId, aSCSeverityId, aIgnoreInformation, |
278 return ret; |
270 aLineNumber, "", aCompareFileName, aCompilationError); |
|
271 |
|
272 else |
|
273 issue = new ReportIssue(0, aFile, fqName, |
|
274 aIdentityId, aTypeId, aBCSeverityId, aSCSeverityId, aIgnoreInformation, |
|
275 aLineNumber, isslueloc, aCompareFileName, aCompilationError); |
|
276 |
|
277 /*return*/ |
|
278 int ret = addIssue(issue); |
|
279 if( ret == -1) |
|
280 { |
|
281 delete issue; |
|
282 } |
|
283 return ret; |
279 } |
284 } |
280 |
285 |
281 // ---------------------------------------------------------------------------- |
286 // ---------------------------------------------------------------------------- |
282 // ReportGenerator::dumpXSLToFile |
287 // ReportGenerator::dumpXSLToFile |
283 // ---------------------------------------------------------------------------- |
288 // ---------------------------------------------------------------------------- |
1121 childvec.push_back(createSimpleTextNode(NODE_ISSUELIST_HEADERFILE_ISSUE_DOCUMENTATION, createDocumentationUrlString(aIssue.FQName()).c_str())); |
1126 childvec.push_back(createSimpleTextNode(NODE_ISSUELIST_HEADERFILE_ISSUE_DOCUMENTATION, createDocumentationUrlString(aIssue.FQName()).c_str())); |
1122 |
1127 |
1123 // issue ignore finder field |
1128 // issue ignore finder field |
1124 childvec.push_back(createSimpleTextNode(NODE_ISSUELIST_HEADERFILE_ISSUE_IGNOREINFORMATION, aIssue.IgnoreInformationDescription().c_str())); |
1129 childvec.push_back(createSimpleTextNode(NODE_ISSUELIST_HEADERFILE_ISSUE_IGNOREINFORMATION, aIssue.IgnoreInformationDescription().c_str())); |
1125 |
1130 |
1126 // issue linenumber field |
1131 // issue location field |
|
1132 if(aIssue.IssueLocation().size() != 0) |
|
1133 childvec.push_back(createSimpleTextNode(NODE_ISSUELIST_HEADERFILE_ISSUE_ISSUELOC, aIssue.IssueLocation().c_str())); |
|
1134 |
|
1135 // issue linenumber field |
1127 childvec.push_back(createSimpleTextNode(NODE_ISSUELIST_HEADERFILE_ISSUE_LINENUMBER, aIssue.LineNumber())); |
1136 childvec.push_back(createSimpleTextNode(NODE_ISSUELIST_HEADERFILE_ISSUE_LINENUMBER, aIssue.LineNumber())); |
1128 |
1137 |
1129 // issue extrainformation field |
1138 // issue extrainformation field |
1130 //childvec.push_back(createSimpleTextNode(NODE_ISSUELIST_HEADERFILE_ISSUE_EXTRAINFORMATION, aIssue.ExtraInformationDescription().c_str())); |
1139 //childvec.push_back(createSimpleTextNode(NODE_ISSUELIST_HEADERFILE_ISSUE_EXTRAINFORMATION, aIssue.ExtraInformationDescription().c_str())); |
1131 |
1140 |