xml2: Added cppcheck-version
This commit is contained in:
parent
f392dbef95
commit
3a612d7cd8
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include "errorlogger.h"
|
||||
#include "path.h"
|
||||
#include "cppcheck.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
|
@ -129,14 +130,22 @@ bool ErrorLogger::ErrorMessage::deserialize(const std::string &data)
|
|||
return true;
|
||||
}
|
||||
|
||||
std::string ErrorLogger::ErrorMessage::getXMLHeader(int version)
|
||||
std::string ErrorLogger::ErrorMessage::getXMLHeader(int xml_version)
|
||||
{
|
||||
std::ostringstream strver;
|
||||
if (version > 1)
|
||||
strver << " version=\"" << version << "\"";
|
||||
std::ostringstream ostr;
|
||||
ostr << "<?xml version=\"1.0\"?>\n";
|
||||
|
||||
return "<?xml version=\"1.0\"?>\n"
|
||||
"<results" + strver.str() + ">";
|
||||
if (xml_version <= 1)
|
||||
{
|
||||
ostr << "<results>";
|
||||
}
|
||||
else
|
||||
{
|
||||
ostr << "<results version=\"" << xml_version << "\">\n";
|
||||
ostr << " <cppcheck-version>" << CppCheck::version() << "</cppcheck-version>";
|
||||
}
|
||||
|
||||
return ostr.str();
|
||||
}
|
||||
|
||||
std::string ErrorLogger::ErrorMessage::getXMLFooter()
|
||||
|
|
|
@ -132,7 +132,7 @@ public:
|
|||
*/
|
||||
std::string toXML(bool verbose, int ver) const;
|
||||
|
||||
static std::string getXMLHeader(int ver);
|
||||
static std::string getXMLHeader(int xml_version);
|
||||
static std::string getXMLFooter();
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue