aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2017-05-20 17:04:01 +0000
committerbloodstalker <thabogre@gmail.com>2017-05-20 17:04:01 +0000
commit17cf6faf1098c6f8a37d98020a8559dee45dfecb (patch)
treeb6a0a8ee863a53754e25490ed39e5a1aebbb382b
parentadded a report class (diff)
downloadmutator-17cf6faf1098c6f8a37d98020a8559dee45dfecb.tar.gz
mutator-17cf6faf1098c6f8a37d98020a8559dee45dfecb.zip
added an xml report base class
Diffstat (limited to '')
-rw-r--r--mutator_report.cpp32
1 files changed, 30 insertions, 2 deletions
diff --git a/mutator_report.cpp b/mutator_report.cpp
index 0eef3ca..c989d32 100644
--- a/mutator_report.cpp
+++ b/mutator_report.cpp
@@ -38,13 +38,41 @@ using json = nlohmann::json;
namespace Devi {
/*********************************************************************************************************************/
/*********************************************************************************************************************/
+/****************************************************XMLReportBase****************************************************/
+ XMLReportBase::XMLReportBase()
+ {
+ RootPointer = Doc.NewElement("mutagen:Report");
+ RootPointer->SetAttribute("xmlns:mutator", "http://www.w3.org/2001/XMLSchema");
+ }
+
+ XMLReportBase::~XMLReportBase()
+ {
+ Doc.InsertEndChild(RootPointer);
+ }
+
+ void XMLReportBase::CreateReport()
+ {
+ Doc.InsertFirstChild(RootPointer);
+ }
+
+ void XMLReportBase::SaveReport()
+ {
+ Doc.InsertEndChild(RootPointer);
+
+ XMLError XMLErrorResult = Doc.SaveFile("./test/misrareport.xml");
+
+ if (XMLErrorResult != XML_SUCCESS)
+ {
+ std::cerr << "could not write xml misra report.\n";
+ }
+ }
+/************************************************end of XMLReportBase*************************************************/
+/*********************************************************************************************************************/
/******************************************************XMLReport******************************************************/
XMLReport::XMLReport()
{
RootPointer = XMLReportDoc.NewElement("mutator:Report");
-#if 1
RootPointer->SetAttribute("xmlns:mutator", "http://www.w3.org/2001/XMLSchema");
-#endif
}
XMLReport::~XMLReport()