42 return i->
name() == aname;
45 throw std::runtime_error(
"'" + aname +
"' instance already exists");
50 return i->
name() > aname;
60 std::cout << errmsg.
toXML() << std::endl;
94 static std::list<Check *> *_instances=
new std::list<Check *>;
97 static std::list<Check *> _instances;
105 return id + std::string(
"Cond");
107 return std::string(
"safe") + (char)std::toupper(
id[0]) + (
id + 1);
115 errorPath.emplace_back(errtok, std::move(bug));
118 errorPath.emplace_back(errtok, std::move(bug));
124 errorPath.emplace_back(errtok, std::move(bug));
Interface class that cppcheck uses to communicate with the checks.
static std::list< Check * > & instances()
List of registered check classes.
Check(const std::string &aname)
This constructor is used when registering the CheckClass.
void reportError(const Token *tok, const Severity severity, const std::string &id, const std::string &msg)
report an error
const Settings *const mSettings
static void writeToErrorList(const ErrorMessage &errmsg)
Write given error to stdout in xml format.
ErrorPath getErrorPath(const Token *errtok, const ValueFlow::Value *value, std::string bug) const
ErrorLogger *const mErrorLogger
const Tokenizer *const mTokenizer
static std::string getMessageId(const ValueFlow::Value &value, const char id[])
void logChecker(const char id[])
log checker
const std::string & name() const
class name, used to generate documentation
bool wrongData(const Token *tok, const char *str)
Use WRONG_DATA in checkers when you check for wrong data.
virtual void reportErr(const ErrorMessage &msg)=0
Information about found errors and warnings is directed here.
Wrapper for error messages, provided by reportErr()
std::string toXML() const
Format the error message in XML format.
bool xml
write XML results (–xml)
std::string templateLocation
The output format in which the error locations are printed in text mode, e.g.
bool daca
Are we running from DACA script?
bool verbose
Is –verbose given?
The token list that the TokenList generates is a linked-list of this class.
std::string expressionString() const
TokenList list
Token list: stores all tokens.
const Token * condition
Condition that this value depends on.
bool safe
value relies on safe checking
Severity
enum class for severity.
std::list< ErrorPathItem > ErrorPath
@ internal
Internal message.