errormessage: updated the files. the errormessage.h is automaticly
generated by the tools/errmsg program
This commit is contained in:
parent
3bdb3064b0
commit
1bc5740742
|
@ -1,11 +1,10 @@
|
||||||
#include "errormessage.h"
|
#include "errormessage.h"
|
||||||
|
#include "tokenize.h"
|
||||||
|
#include "token.h"
|
||||||
|
|
||||||
ErrorMessage::ErrorMessage()
|
std::string ErrorMessage::msg1(const Tokenizer *tokenizer, const Token *Location)
|
||||||
{
|
{
|
||||||
//ctor
|
return tokenizer->fileLine(Location) + ": ";
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorMessage::~ErrorMessage()
|
|
||||||
{
|
|
||||||
//dtor
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,19 +1,22 @@
|
||||||
#ifndef ErrorMessageH
|
#ifndef errormessageH
|
||||||
#define ErrorMessageH
|
#define errormessageH
|
||||||
|
#include <string>
|
||||||
/**
|
#include "settings.h"
|
||||||
* This class is used by the Cppcheck application to get
|
class Token;
|
||||||
* informative error messages when e.g. memory leak is found
|
class Tokenizer;
|
||||||
* from the inspected source file. This is also used another
|
|
||||||
* program to generate text for wiki and man page.
|
|
||||||
*/
|
|
||||||
class ErrorMessage
|
class ErrorMessage
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ErrorMessage();
|
static std::string msg1(const Tokenizer *tokenizer, const Token *Location);
|
||||||
virtual ~ErrorMessage();
|
static std::string memleak(const Tokenizer *tokenizer, const Token *Location, const std::string &varname)
|
||||||
protected:
|
{ return msg1(tokenizer, Location) + "Memory leak: " + varname + ""; }
|
||||||
private:
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // ErrorMessageH
|
static bool memleak(const Settings &s)
|
||||||
|
{ return true; }
|
||||||
|
static std::string resourceLeak(const Tokenizer *tokenizer, const Token *Location, const std::string &varname)
|
||||||
|
{ return msg1(tokenizer, Location) + "Resource leak: " + varname + ""; }
|
||||||
|
|
||||||
|
static bool resourceLeak(const Settings &s)
|
||||||
|
{ return true; }
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue