2014-09-25 11:11:58 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-14 10:59:10 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2014-09-25 11:11:58 +02:00
|
|
|
**
|
2016-01-14 10:59:10 +01:00
|
|
|
** This file is part of Qt Creator.
|
2014-09-25 11:11:58 +02:00
|
|
|
**
|
2016-01-14 10:59:10 +01:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
2014-09-25 11:11:58 +02:00
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-14 10:59:10 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2014-09-25 11:11:58 +02:00
|
|
|
**
|
2016-01-14 10:59:10 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2014-09-25 11:11:58 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2014-09-25 11:11:58 +02:00
|
|
|
|
2016-02-24 14:42:52 +01:00
|
|
|
#include <debugger/analyzer/diagnosticlocation.h>
|
2015-06-19 15:37:16 +02:00
|
|
|
|
2021-10-14 22:27:08 +03:00
|
|
|
#include <utils/porting.h>
|
|
|
|
|
|
2014-09-25 11:11:58 +02:00
|
|
|
#include <QMetaType>
|
|
|
|
|
#include <QString>
|
2018-12-07 16:36:27 +01:00
|
|
|
#include <QVector>
|
2014-09-25 11:11:58 +02:00
|
|
|
|
2018-03-14 12:58:12 +01:00
|
|
|
namespace ClangTools {
|
2014-09-25 11:11:58 +02:00
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class ExplainingStep
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
bool isValid() const;
|
2018-12-07 16:36:27 +01:00
|
|
|
bool operator<(const ExplainingStep &other) const {
|
|
|
|
|
return std::tie(location, ranges, message)
|
|
|
|
|
< std::tie(other.location, other.ranges, other.message);
|
|
|
|
|
}
|
2014-09-25 11:11:58 +02:00
|
|
|
|
|
|
|
|
QString message;
|
2016-03-02 13:57:37 +01:00
|
|
|
Debugger::DiagnosticLocation location;
|
2018-12-07 16:36:27 +01:00
|
|
|
QVector<Debugger::DiagnosticLocation> ranges;
|
2018-05-15 14:31:48 +02:00
|
|
|
bool isFixIt = false;
|
2014-09-25 11:11:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class Diagnostic
|
|
|
|
|
{
|
|
|
|
|
public:
|
2014-11-14 14:59:27 +01:00
|
|
|
bool isValid() const;
|
2020-07-21 13:11:01 +02:00
|
|
|
QIcon icon() const;
|
2014-11-14 14:59:27 +01:00
|
|
|
|
2021-12-06 05:11:04 +01:00
|
|
|
friend bool operator==(const Diagnostic &lhs, const Diagnostic &rhs);
|
|
|
|
|
friend Utils::QHashValueType qHash(const Diagnostic &diagnostic);
|
|
|
|
|
|
2019-11-04 14:44:36 +01:00
|
|
|
QString name;
|
2014-09-25 11:11:58 +02:00
|
|
|
QString description;
|
|
|
|
|
QString category;
|
|
|
|
|
QString type;
|
2016-03-02 13:57:37 +01:00
|
|
|
Debugger::DiagnosticLocation location;
|
2018-12-07 16:36:27 +01:00
|
|
|
QVector<ExplainingStep> explainingSteps;
|
2018-05-15 14:31:48 +02:00
|
|
|
bool hasFixits = false;
|
2014-09-25 11:11:58 +02:00
|
|
|
};
|
|
|
|
|
|
2019-07-23 10:04:01 +02:00
|
|
|
using Diagnostics = QList<Diagnostic>;
|
|
|
|
|
|
2014-09-25 11:11:58 +02:00
|
|
|
} // namespace Internal
|
2018-03-14 12:58:12 +01:00
|
|
|
} // namespace ClangTools
|
2014-09-25 11:11:58 +02:00
|
|
|
|
2018-03-14 12:58:12 +01:00
|
|
|
Q_DECLARE_METATYPE(ClangTools::Internal::Diagnostic)
|