2010-07-10 19:30:31 +02:00
|
|
|
/*
|
|
|
|
* Cppcheck - A tool for static C/C++ code analysis
|
2010-10-02 23:20:18 +02:00
|
|
|
* Copyright (C) 2007-2010 Daniel Marjamäki and Cppcheck team.
|
2010-07-10 19:30:31 +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
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ERRORITEM_H
|
|
|
|
#define ERRORITEM_H
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
#include <QStringList>
|
2010-07-14 13:24:46 +02:00
|
|
|
#include <QMetaType>
|
2010-07-10 19:30:31 +02:00
|
|
|
|
2010-07-11 00:04:53 +02:00
|
|
|
class ErrorLine;
|
|
|
|
|
2010-07-10 19:30:31 +02:00
|
|
|
/// @addtogroup GUI
|
|
|
|
/// @{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief A class containing error data for one error.
|
2011-01-06 19:45:07 +01:00
|
|
|
*
|
|
|
|
* The paths are stored with internal ("/") separators. Only when we show the
|
|
|
|
* path or copy if for user (to clipboard) we convert to native separators.
|
|
|
|
* Full path is stored instead of relative path for flexibility. It is easy
|
|
|
|
* to get the relative path from full path when needed.
|
2010-07-10 19:30:31 +02:00
|
|
|
*/
|
|
|
|
class ErrorItem
|
|
|
|
{
|
|
|
|
public:
|
2010-07-11 00:04:53 +02:00
|
|
|
ErrorItem() { }
|
|
|
|
ErrorItem(const ErrorItem &item);
|
|
|
|
ErrorItem(const ErrorLine &line);
|
2010-07-14 13:24:46 +02:00
|
|
|
~ErrorItem() { }
|
2010-07-11 00:04:53 +02:00
|
|
|
|
2010-08-28 19:37:21 +02:00
|
|
|
/**
|
|
|
|
* @brief Convert error item to string.
|
|
|
|
* @return Error item as string.
|
|
|
|
*/
|
|
|
|
QString ToString() const;
|
|
|
|
|
2010-07-10 19:30:31 +02:00
|
|
|
QString file;
|
|
|
|
QStringList files;
|
2010-07-10 19:54:33 +02:00
|
|
|
QList<unsigned int> lines;
|
2010-07-10 19:30:31 +02:00
|
|
|
QString id;
|
|
|
|
QString severity;
|
2010-11-11 21:51:00 +01:00
|
|
|
QString summary;
|
|
|
|
QString message;
|
2010-07-10 19:30:31 +02:00
|
|
|
};
|
|
|
|
|
2010-07-14 13:24:46 +02:00
|
|
|
Q_DECLARE_METATYPE(ErrorItem);
|
|
|
|
|
2010-07-10 19:30:31 +02:00
|
|
|
/**
|
|
|
|
* @brief A class containing error data for one shown error line.
|
|
|
|
*/
|
|
|
|
class ErrorLine
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
QString file;
|
2010-07-12 00:51:36 +02:00
|
|
|
unsigned int line;
|
2010-07-10 19:30:31 +02:00
|
|
|
QString id;
|
|
|
|
QString severity;
|
2010-11-11 21:51:00 +01:00
|
|
|
QString summary;
|
|
|
|
QString message;
|
2010-07-10 19:30:31 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/// @}
|
|
|
|
#endif // ERRORITEM_H
|