|
| 1 | +/* |
| 2 | + * Cppcheck - A tool for static C/C++ code analysis |
| 3 | + * Copyright (C) 2007-2010 Daniel Marjamäki and Cppcheck team. |
| 4 | + * |
| 5 | + * This program is free software: you can redistribute it and/or modify |
| 6 | + * it under the terms of the GNU General Public License as published by |
| 7 | + * the Free Software Foundation, either version 3 of the License, or |
| 8 | + * (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 |
| 13 | + * GNU 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. If not, see <http://www.gnu.org/licenses/>. |
| 17 | + */ |
| 18 | + |
| 19 | +#ifndef CHECKSTATISTICS_H |
| 20 | +#define CHECKSTATISTICS_H |
| 21 | + |
| 22 | +#include <QObject> |
| 23 | +#include "common.h" |
| 24 | + |
| 25 | +/// @addtogroup GUI |
| 26 | +/// @{ |
| 27 | + |
| 28 | +/** |
| 29 | + * A class for check statistics. |
| 30 | + */ |
| 31 | +class CheckStatistics : public QObject |
| 32 | +{ |
| 33 | +public: |
| 34 | + CheckStatistics(QObject *parent = NULL); |
| 35 | + |
| 36 | + /** |
| 37 | + * @brief Add new checked item to statistics. |
| 38 | + * |
| 39 | + * @param type Type of the item to add. |
| 40 | + */ |
| 41 | + void AddItem(ShowTypes type); |
| 42 | + |
| 43 | + /** |
| 44 | + * @brief Clear the statistics. |
| 45 | + * |
| 46 | + */ |
| 47 | + void Clear(); |
| 48 | + |
| 49 | + /** |
| 50 | + * @brief Return statistics for given type. |
| 51 | + * |
| 52 | + * @param type Type for which the statistics are returned. |
| 53 | + * @return Number of items of given type. |
| 54 | + */ |
| 55 | + unsigned GetCount(ShowTypes type) const; |
| 56 | + |
| 57 | +private: |
| 58 | + unsigned mStyle; |
| 59 | + unsigned mWarning; |
| 60 | + unsigned mPerformance; |
| 61 | + unsigned mError; |
| 62 | +}; |
| 63 | + |
| 64 | +/// @} |
| 65 | + |
| 66 | +#endif // CHECKSTATISTICS_H |
0 commit comments