diff options
author | bloodstalker <thabogre@gmail.com> | 2017-01-05 09:33:16 +0000 |
---|---|---|
committer | bloodstalker <thabogre@gmail.com> | 2017-01-05 09:33:16 +0000 |
commit | 928116a7ffc5c112851bd3c72e1b10c277f737c3 (patch) | |
tree | 146661f703ee40b02186909a9ef385f2593ee960 | |
parent | added one more test for 9.2 (diff) | |
download | mutator-928116a7ffc5c112851bd3c72e1b10c277f737c3.tar.gz mutator-928116a7ffc5c112851bd3c72e1b10c277f737c3.zip |
added a new overload for each report class for 19.1
-rw-r--r-- | mutator_aux.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/mutator_aux.cpp b/mutator_aux.cpp index 0bbba8f..6a56352 100644 --- a/mutator_aux.cpp +++ b/mutator_aux.cpp @@ -209,6 +209,17 @@ void XMLReport::XMLAddNode(const SourceManager &SM, SourceLocation SL, std::stri RootPointer->InsertEndChild(MisraElement); } +void XMLReport::XMLAddNode(std::string FilePath, std::string MisraRule, std::string Description) +{ + //assert(SL.isValid() && "SourceLocation Acquired by SourceManager in an overload(3) of XMLAddNode is not valid."); + + XMLElement* MisraElement = XMLReportDoc.NewElement("MisraDiag"); + MisraElement->SetText(Description.c_str()); + MisraElement->SetAttribute("Misra-C:2004Rule", MisraRule.c_str()); + MisraElement->SetAttribute("FileName", FilePath.c_str()); + RootPointer->InsertEndChild(MisraElement); +} + void XMLReport::SaveReport(void) { XMLError XMLErrorResult = XMLReportDoc.SaveFile("./test/misrareport.xml"); @@ -294,6 +305,20 @@ void JSONReport::JSONAddElement(const SourceManager &SM, SourceLocation SL, std: JSONRepFile << RepJ << std::endl; } +void JSONReport::JSONAddElement(std::string FilePath, std::string MisraRule, std::string Description) +{ + //assert(SL.isValid() && "SourceLocation Acquired by SourceManager in an overload(3) of XMLAddNode is not valid."); + + json RepJ; + + RepJ["MisraDiag"]["Description"] = Description.c_str(); + RepJ["MisraDiag"]["Misra-C:2004Rule"] = MisraRule.c_str(); + RepJ["MisraDiag"]["FileName"] = FilePath.c_str(); + + + JSONRepFile << RepJ << std::endl; +} + void JSONReport::CloseReport(void) { JSONRepFile.close(); |