2222// ---------------------------------------------------------------------------
2323
2424#include " config.h"
25- #include " errortypes.h"
2625
2726#include < list>
2827#include < string>
@@ -36,14 +35,8 @@ namespace CTU {
3635 class FileInfo ;
3736}
3837
39- namespace ValueFlow {
40- class Value ;
41- }
42-
4338class Settings ;
44- class Token ;
4539class ErrorLogger ;
46- class ErrorMessage ;
4740class Tokenizer ;
4841
4942/* * Use WRONG_DATA in checkers to mark conditions that check that data is correct */
@@ -59,17 +52,9 @@ class Tokenizer;
5952class CPPCHECKLIB Check {
6053public:
6154 /* * This constructor is used when registering the CheckClass */
62- explicit Check (std::string aname);
63-
64- protected:
65- /* * This constructor is used when running checks. */
66- Check (std::string aname, const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger)
67- : mTokenizer (tokenizer), mSettings (settings), mErrorLogger (errorLogger), mName (std::move(aname)) {}
68-
69- private:
70- static std::list<Check *> &instances_internal ();
71-
72- public:
55+ explicit Check (std::string aname)
56+ : mName(std::move(aname))
57+ {}
7358 virtual ~Check () = default ;
7459
7560 Check (const Check &) = delete ;
@@ -89,13 +74,6 @@ class CPPCHECKLIB Check {
8974 /* * get information about this class, used to generate documentation */
9075 virtual std::string classInfo () const = 0;
9176
92- /* *
93- * Write given error to stdout in xml format.
94- * This is for for printout out the error list with --errorlist
95- * @param errmsg Error message to write
96- */
97- static void writeToErrorList (const ErrorMessage &errmsg);
98-
9977 /* * Base class used for whole-program analysis */
10078 class CPPCHECKLIB FileInfo {
10179 public:
@@ -121,40 +99,6 @@ class CPPCHECKLIB Check {
12199 return false ;
122100 }
123101
124- protected:
125- static std::string getMessageId (const ValueFlow::Value &value, const char id[]);
126-
127- const Tokenizer* const mTokenizer {};
128- const Settings* const mSettings {};
129- ErrorLogger* const mErrorLogger {};
130-
131- /* * report an error */
132- void reportError (const Token *tok, const Severity severity, const std::string &id, const std::string &msg) {
133- reportError (tok, severity, id, msg, CWE (0U ), Certainty::normal);
134- }
135-
136- /* * report an error */
137- void reportError (const Token *tok, const Severity severity, const std::string &id, const std::string &msg, const CWE &cwe, Certainty certainty) {
138- const std::list<const Token *> callstack (1 , tok);
139- reportError (callstack, severity, id, msg, cwe, certainty);
140- }
141-
142- /* * report an error */
143- void reportError (const std::list<const Token *> &callstack, Severity severity, const std::string &id, const std::string &msg, const CWE &cwe, Certainty certainty);
144-
145- void reportError (ErrorPath errorPath, Severity severity, const char id[], const std::string &msg, const CWE &cwe, Certainty certainty);
146-
147- /* * log checker */
148- void logChecker (const char id[]);
149-
150- ErrorPath getErrorPath (const Token* errtok, const ValueFlow::Value* value, std::string bug) const ;
151-
152- /* *
153- * Use WRONG_DATA in checkers when you check for wrong data. That
154- * will call this method
155- */
156- bool wrongData (const Token *tok, const char *str);
157-
158102private:
159103 const std::string mName ;
160104};
0 commit comments