2009-06-24 09:54:56 +02:00
|
|
|
/*
|
|
|
|
* Cppcheck - A tool for static C/C++ code analysis
|
2021-09-26 11:34:56 +02:00
|
|
|
* Copyright (C) 2007-2021 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"
|
2009-06-24 09:54:56 +02:00
|
|
|
|
2020-04-13 13:44:48 +02:00
|
|
|
class ErrorItem;
|
2011-02-04 22:56:14 +01:00
|
|
|
|
2009-07-17 10:49:01 +02:00
|
|
|
/// @addtogroup GUI
|
|
|
|
/// @{
|
|
|
|
|
|
|
|
|
2009-06-24 09:54:56 +02:00
|
|
|
/**
|
2021-08-07 20:51:18 +02:00
|
|
|
* @brief Base class for XML report classes.
|
|
|
|
*/
|
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.
|
|
|
|
*/
|
2017-07-28 11:12:05 +02: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
|