From c35ffa3ce89cc723ad7ebeac5d2f1535c2a67d8e Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Sat, 15 Apr 2017 17:28:48 +0430 Subject: added a new class to read the xml report created by M0. --- bruiser/bruiser.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) 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 #include @@ -38,11 +39,14 @@ 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 -- cgit v1.2.3