Changeset View
Changeset View
Standalone View
Standalone View
plugins/clazy/checks_db.h
- This file was added.
1 | /* This file is part of KDevelop | ||||
---|---|---|---|---|---|
2 | | ||||
3 | Copyright 2018 Anton Anikin <anton@anikin.xyz> | ||||
4 | | ||||
5 | This program is free software; you can redistribute it and/or | ||||
6 | modify it under the terms of the GNU General Public | ||||
7 | License as published by the Free Software Foundation; either | ||||
8 | version 2 of the License, or (at your option) any later version. | ||||
9 | | ||||
10 | This program is distributed in the hope that it will be useful, | ||||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
13 | General Public License for more details. | ||||
14 | | ||||
15 | You should have received a copy of the GNU General Public License | ||||
16 | along with this program; see the file COPYING. If not, write to | ||||
17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||||
18 | Boston, MA 02110-1301, USA. | ||||
19 | */ | ||||
20 | | ||||
21 | #ifndef KDEVCLAZY_CHECKS_DB_H | ||||
22 | #define KDEVCLAZY_CHECKS_DB_H | ||||
23 | | ||||
24 | #include <QMap> | ||||
25 | #include <QUrl> | ||||
26 | | ||||
27 | namespace Clazy | ||||
28 | { | ||||
29 | | ||||
30 | struct Level; | ||||
31 | | ||||
32 | struct Check | ||||
33 | { | ||||
34 | const Level* level = nullptr; | ||||
35 | QString name; | ||||
36 | QString description; | ||||
37 | QUrl url; | ||||
38 | }; | ||||
39 | | ||||
40 | struct Level | ||||
41 | { | ||||
42 | QString name; | ||||
43 | QString displayName; | ||||
44 | QString description; | ||||
45 | | ||||
46 | QMap<QString, Check*> checks; | ||||
47 | }; | ||||
48 | | ||||
49 | class ChecksDB | ||||
50 | { | ||||
51 | public: | ||||
52 | explicit ChecksDB(const QUrl& docsPath); | ||||
53 | ~ChecksDB(); | ||||
54 | | ||||
55 | bool isValid() const; | ||||
56 | QString error() const; | ||||
57 | | ||||
58 | const QMap<QString, Level*>& levels() const; | ||||
59 | | ||||
60 | const QMap<QString, Check*>& checks() const; | ||||
61 | | ||||
62 | protected: | ||||
63 | QString m_error; | ||||
64 | | ||||
65 | QMap<QString, Check*> m_checks; | ||||
66 | QMap<QString, Level*> m_levels; | ||||
67 | }; | ||||
68 | | ||||
69 | } | ||||
70 | | ||||
71 | #endif |