diff --git a/src/cppcheckexecutor.cpp b/src/cppcheckexecutor.cpp index 90a4bef58..3707b807d 100644 --- a/src/cppcheckexecutor.cpp +++ b/src/cppcheckexecutor.cpp @@ -42,8 +42,7 @@ int CppCheckExecutor::check(int argc, const char* const argv[]) _settings = cppCheck.settings(); if (_settings._xml) { - reportErr(""); - reportErr(""); + reportErr(ErrorLogger::ErrorMessage::getXMLHeader()); } unsigned int returnValue = 0; @@ -67,7 +66,7 @@ int CppCheckExecutor::check(int argc, const char* const argv[]) if (_settings._xml) { - reportErr(""); + reportErr(ErrorLogger::ErrorMessage::getXMLFooter()); } if (returnValue) diff --git a/src/errorlogger.cpp b/src/errorlogger.cpp index ca8f23d8d..e5c316075 100644 --- a/src/errorlogger.cpp +++ b/src/errorlogger.cpp @@ -113,6 +113,17 @@ bool ErrorLogger::ErrorMessage::deserialize(const std::string &data) return true; } +std::string ErrorLogger::ErrorMessage::getXMLHeader() +{ + return "\n" + ""; +} + +std::string ErrorLogger::ErrorMessage::getXMLFooter() +{ + return ""; +} + std::string ErrorLogger::ErrorMessage::toXML() const { std::ostringstream xml; diff --git a/src/errorlogger.h b/src/errorlogger.h index 43aa2334f..7070bf45a 100644 --- a/src/errorlogger.h +++ b/src/errorlogger.h @@ -59,6 +59,10 @@ public: ErrorMessage(const std::list &callStack, const std::string &severity, const std::string &msg, const std::string &id); ErrorMessage(); std::string toXML() const; + + static std::string getXMLHeader(); + static std::string getXMLFooter(); + std::string toText() const; std::string serialize() const; bool deserialize(const std::string &data);