Changeset View
Changeset View
Standalone View
Standalone View
plugins/clazy/checksdb.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 | }; | ||||
38 | | ||||
39 | struct Level | ||||
40 | { | ||||
41 | QString name; | ||||
42 | QString displayName; | ||||
43 | QString description; | ||||
44 | | ||||
45 | QMap<QString, Check*> checks; | ||||
46 | }; | ||||
47 | | ||||
48 | class ChecksDB | ||||
49 | { | ||||
50 | public: | ||||
51 | explicit ChecksDB(const QUrl& docsPath); | ||||
52 | ~ChecksDB(); | ||||
53 | | ||||
54 | bool isValid() const; | ||||
55 | QString error() const; | ||||
56 | | ||||
57 | const QMap<QString, Level*>& levels() const; | ||||
58 | | ||||
59 | const QMap<QString, Check*>& checks() const; | ||||
60 | | ||||
61 | private: | ||||
62 | QString m_error; | ||||
63 | | ||||
64 | QMap<QString, Check*> m_checks; | ||||
65 | QMap<QString, Level*> m_levels; | ||||
66 | }; | ||||
67 | | ||||
68 | } | ||||
69 | | ||||
70 | #endif |