File indexing completed on 2024-04-21 04:34:33

0001 /*
0002  * This file is part of KDevelop Krazy2 Plugin.
0003  *
0004  * Copyright 2012 Daniel Calviño Sánchez <danxuliu@gmail.com>
0005  *
0006  * This program is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU General Public License
0008  * as published by the Free Software Foundation; either version 2
0009  * of the License, or (at your option) any later version.
0010  *
0011  * This program is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014  * GNU General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU General Public License
0017  * along with this program. If not, see <http://www.gnu.org/licenses/>.
0018  */
0019 
0020 #ifndef ISSUE_H
0021 #define ISSUE_H
0022 
0023 #include <QString>
0024 
0025 class Checker;
0026 
0027 /**
0028  * An issue found by Krazy2.
0029  * Several issues can be associated to the same Checker.
0030  *
0031  * The default line value is -1 (which represents a not set or invalid line).
0032  */
0033 class Issue {
0034 public:
0035 
0036     Issue();
0037 
0038     QString message() const;
0039     void setMessage(const QString& message);
0040 
0041     QString fileName() const;
0042     void setFileName(const QString& fileName);
0043 
0044     int line() const;
0045     void setLine(int line);
0046 
0047     const Checker* checker() const;
0048     void setChecker(const Checker* checker);
0049 
0050 private:
0051 
0052     QString m_message;
0053     QString m_fileName;
0054     int m_line;
0055     const Checker* m_checker;
0056 
0057 };
0058 
0059 #endif