aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger/analyzer/diagnosticlocation.h
blob: eda19a6f2ab9f5ed2953bde3cd2425b8f0344aca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include <debugger/debugger_global.h>

#include <utils/filepath.h>

#include <QDebug>
#include <QMetaType>
#include <QString>

namespace Debugger {

class DEBUGGER_EXPORT DiagnosticLocation
{
public:
    DiagnosticLocation();
    DiagnosticLocation(const Utils::FilePath &filePath, int line, int column);

    bool isValid() const;

    DEBUGGER_EXPORT friend bool operator==(const DiagnosticLocation &first, const DiagnosticLocation &second);
    DEBUGGER_EXPORT friend bool operator<(const DiagnosticLocation &first, const DiagnosticLocation &second);
    DEBUGGER_EXPORT friend QDebug operator<<(QDebug dbg, const DiagnosticLocation &location);

    Utils::FilePath filePath;

    // Both values start at 1.
    int line = 0;
    int column = 0;
};

} // namespace Debugger

Q_DECLARE_METATYPE(Debugger::DiagnosticLocation)