From 0c059af3cb564f870e4e0b3f76ca5d417551e7b3 Mon Sep 17 00:00:00 2001 From: Reijo Tomperi Date: Mon, 15 Jun 2009 21:36:39 +0300 Subject: [PATCH] getXMLFooter() and getXMLHeader() functions added and taken into use --- src/cppcheckexecutor.cpp | 5 ++--- src/errorlogger.cpp | 11 +++++++++++ src/errorlogger.h | 4 ++++ 3 files changed, 17 insertions(+), 3 deletions(-) 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);