From 4d52c188e1a502cdb6e97b57d38b313f32742fa7 Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Tue, 27 Dec 2016 02:12:42 +0330 Subject: added the json report writer interface --- mutator_aux.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/mutator_aux.h b/mutator_aux.h index ed7d1a4..16f4a0f 100644 --- a/mutator_aux.h +++ b/mutator_aux.h @@ -8,6 +8,7 @@ /*********************************************************************************************************************/ /*inclusion directives*/ #include +#include #include "clang/AST/AST.h" #include "clang/Basic/SourceManager.h" #include "clang/Rewrite/Core/Rewriter.h" @@ -38,6 +39,23 @@ private: XMLNode* RootPointer; }; +class JSONReport +{ +public: + JSONReport(); + + void JSONCreateReport(void); + void JSONAddElement(ASTContext* ASTC, SourceLocation SL, std::string MisraRule, std::string Description); + /*overload for checks that announce the result in onendoftranslation unit.*/ + void JSONAddElement(FullSourceLoc FSL, SourceLocation SL, std::string MisraRule, std::string Description); + /*overload for PPCallbacks.*/ + void JSONAddElement(const SourceManager &SM, SourceLocation SL, std::string MisraRule, std::string Description); + void CloseReport(void); + +private: + std::ofstream JSONRepFile; +}; + } #endif -- cgit v1.2.3