aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2017-04-15 12:58:48 +0000
committerbloodstalker <thabogre@gmail.com>2017-04-15 12:58:48 +0000
commitc35ffa3ce89cc723ad7ebeac5d2f1535c2a67d8e (patch)
tree989213ed35c82752433a476dda41fcba0395ce58
parentadded a new class to read the xml report created by M0. (diff)
downloadmutator-c35ffa3ce89cc723ad7ebeac5d2f1535c2a67d8e.tar.gz
mutator-c35ffa3ce89cc723ad7ebeac5d2f1535c2a67d8e.zip
added a new class to read the xml report created by M0.
-rw-r--r--bruiser/bruiser.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/bruiser/bruiser.h b/bruiser/bruiser.h
index fcfcaec..32dafae 100644
--- a/bruiser/bruiser.h
+++ b/bruiser/bruiser.h
@@ -26,6 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.*
/**********************************************************************************************************************/
/*included modules*/
/*project headers*/
+#include "../tinyxml2/tinyxml2.h"
/*standard library headers*/
#include <string>
#include <fstream>
@@ -38,12 +39,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.*
/**********************************************************************************************************************/
/*using*/
+using namespace tinyxml2;
using namespace llvm;
using namespace clang;
/**********************************************************************************************************************/
namespace bruiser
{
/**********************************************************************************************************************/
+ const char* M0REP = "../test/misrareport.xml";
+/**********************************************************************************************************************/
/**
* @brief This class hanhles the logging for bruiser.
*/
@@ -76,6 +80,39 @@ class TypeInfo
const clang::ast_type_traits::DynTypedNode* DTN;
};
/**********************************************************************************************************************/
+class ReadMutatorRep
+{
+ public:
+ ReadMutatorRep() {}
+
+ ~ReadMutatorRep() {}
+
+ int LoadXMLDoc(void)
+ {
+ XMLError eResult = IntermediateXMLDoc.LoadFile(M0REP);
+
+ return eResult;
+ }
+
+ int ReadFirstElement(void)
+ {
+ RootPointer = IntermediateXMLDoc.FirstChild();
+
+ if (RootPointer == nullptr)
+ {
+ return XML_ERROR_FILE_READ_ERROR;
+ }
+ else
+ {
+ return XML_SUCCESS;
+ }
+ }
+
+private:
+ XMLDocument IntermediateXMLDoc;
+ XMLNode* RootPointer;
+};
+/**********************************************************************************************************************/
/**********************************************************************************************************************/
} // end of namespace bruiser
#endif