2009-06-24 09:54:56 +02:00
|
|
|
/*
|
|
|
|
* Cppcheck - A tool for static C/C++ code analysis
|
2016-01-01 14:34:45 +01:00
|
|
|
* Copyright (C) 2007-2016 Cppcheck team.
|
2009-06-24 09:54:56 +02:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2009-09-27 17:08:31 +02:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2009-06-24 09:54:56 +02:00
|
|
|
*/
|
|
|
|
|
2009-06-24 22:49:38 +02:00
|
|
|
#ifndef XML_REPORT_H
|
|
|
|
#define XML_REPORT_H
|
2009-06-24 09:54:56 +02:00
|
|
|
|
|
|
|
#include <QString>
|
2011-02-05 11:12:34 +01:00
|
|
|
#include <QList>
|
2009-06-24 22:49:38 +02:00
|
|
|
#include "report.h"
|
2011-02-05 11:41:29 +01:00
|
|
|
#include "erroritem.h"
|
2009-06-24 09:54:56 +02:00
|
|
|
|
2011-02-04 22:56:14 +01:00
|
|
|
class QObject;
|
|
|
|
|
2009-07-17 10:49:01 +02:00
|
|
|
/// @addtogroup GUI
|
|
|
|
/// @{
|
|
|
|
|
|
|
|
|
2009-06-24 09:54:56 +02:00
|
|
|
/**
|
2011-02-04 22:56:14 +01:00
|
|
|
* @brief Base class for XML report classes.
|
2009-06-24 09:54:56 +02:00
|
|
|
*/
|
2011-10-13 20:53:06 +02:00
|
|
|
class XmlReport : public Report {
|
2009-06-24 09:54:56 +02:00
|
|
|
public:
|
2015-03-08 18:18:09 +01:00
|
|
|
explicit XmlReport(const QString &filename);
|
2011-02-04 23:23:25 +01:00
|
|
|
|
2011-02-05 11:12:34 +01:00
|
|
|
/**
|
|
|
|
* @brief Read contents of the report file.
|
|
|
|
*/
|
2011-02-05 11:41:29 +01:00
|
|
|
virtual QList<ErrorItem> Read() = 0;
|
2011-02-05 11:12:34 +01:00
|
|
|
|
2011-02-04 23:23:25 +01:00
|
|
|
/**
|
|
|
|
* @brief Quote the message.
|
|
|
|
* @param message Message to quote.
|
|
|
|
* @return quoted message.
|
|
|
|
*/
|
|
|
|
static QString quoteMessage(const QString &message);
|
2011-02-05 11:12:34 +01:00
|
|
|
|
2011-02-05 15:07:59 +01:00
|
|
|
/**
|
|
|
|
* @brief Unquote the message.
|
|
|
|
* @param message Message to quote.
|
|
|
|
* @return quoted message.
|
|
|
|
*/
|
|
|
|
static QString unquoteMessage(const QString &message);
|
|
|
|
|
2011-02-05 11:12:34 +01:00
|
|
|
/**
|
|
|
|
* @brief Get the XML report format version from the file.
|
|
|
|
* @param filename Filename of the report file.
|
|
|
|
* @return XML report format version or 0 if error happened.
|
|
|
|
*/
|
|
|
|
static int determineVersion(const QString &filename);
|
2009-06-24 09:54:56 +02:00
|
|
|
};
|
2009-07-17 10:49:01 +02:00
|
|
|
/// @}
|
2011-02-04 22:56:14 +01:00
|
|
|
|
2009-06-24 22:49:38 +02:00
|
|
|
#endif // XML_REPORT_H
|