Rename Severity::e to Severity::SeverityType.
This commit is contained in:
parent
d7f971c347
commit
3716b3f9d8
|
@ -118,7 +118,7 @@ protected:
|
|||
ErrorLogger * const _errorLogger;
|
||||
|
||||
/** report an error */
|
||||
void reportError(const Token *tok, const Severity::e severity, const std::string &id, const std::string &msg)
|
||||
void reportError(const Token *tok, const Severity::SeverityType severity, const std::string &id, const std::string &msg)
|
||||
{
|
||||
std::list<const Token *> callstack;
|
||||
if (tok)
|
||||
|
@ -127,7 +127,7 @@ protected:
|
|||
}
|
||||
|
||||
/** report an error */
|
||||
void reportError(const std::list<const Token *> &callstack, const Severity::e severity, const std::string &id, std::string msg)
|
||||
void reportError(const std::list<const Token *> &callstack, const Severity::SeverityType severity, const std::string &id, std::string msg)
|
||||
{
|
||||
// If the verbose flag hasn't been given, don't show verbose information
|
||||
if (!_settings || !_settings->_verbose)
|
||||
|
|
|
@ -300,7 +300,7 @@ void CheckMemoryLeak::memoryLeak(const Token *tok, const std::string &varname, A
|
|||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
void CheckMemoryLeak::reportErr(const Token *tok, Severity::e severity, const std::string &id, const std::string &msg) const
|
||||
void CheckMemoryLeak::reportErr(const Token *tok, Severity::SeverityType severity, const std::string &id, const std::string &msg) const
|
||||
{
|
||||
std::list<const Token *> callstack;
|
||||
|
||||
|
@ -310,7 +310,7 @@ void CheckMemoryLeak::reportErr(const Token *tok, Severity::e severity, const st
|
|||
reportErr(callstack, severity, id, msg);
|
||||
}
|
||||
|
||||
void CheckMemoryLeak::reportErr(const std::list<const Token *> &callstack, Severity::e severity, const std::string &id, const std::string &msg) const
|
||||
void CheckMemoryLeak::reportErr(const std::list<const Token *> &callstack, Severity::SeverityType severity, const std::string &id, const std::string &msg) const
|
||||
{
|
||||
std::list<ErrorLogger::ErrorMessage::FileLocation> locations;
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ private:
|
|||
* @param id type of message
|
||||
* @param msg text
|
||||
*/
|
||||
void reportErr(const Token *location, Severity::e severity, const std::string &id, const std::string &msg) const;
|
||||
void reportErr(const Token *location, Severity::SeverityType severity, const std::string &id, const std::string &msg) const;
|
||||
|
||||
/**
|
||||
* Report error. Similar with the function Check::reportError
|
||||
|
@ -80,7 +80,7 @@ private:
|
|||
* @param id type of message
|
||||
* @param msg text
|
||||
*/
|
||||
void reportErr(const std::list<const Token *> &callstack, Severity::e severity, const std::string &id, const std::string &msg) const;
|
||||
void reportErr(const std::list<const Token *> &callstack, Severity::SeverityType severity, const std::string &id, const std::string &msg) const;
|
||||
|
||||
public:
|
||||
CheckMemoryLeak(const Tokenizer *t, ErrorLogger *e)
|
||||
|
|
|
@ -29,6 +29,24 @@ class Tokenizer;
|
|||
/// @addtogroup Core
|
||||
/// @{
|
||||
|
||||
/** @brief enum class for severity. Used when reporting errors. */
|
||||
class Severity
|
||||
{
|
||||
public:
|
||||
enum SeverityType { error, style };
|
||||
static std::string stringify(SeverityType severity)
|
||||
{
|
||||
switch (severity)
|
||||
{
|
||||
case error:
|
||||
return "error";
|
||||
case style:
|
||||
return "style";
|
||||
};
|
||||
return "???";
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief This is an interface, which the class responsible of error logging
|
||||
* should implement.
|
||||
|
@ -307,24 +325,6 @@ private:
|
|||
void _writemsg(const Tokenizer *tokenizer, const std::list<const Token *> &callstack, const char severity[], const std::string &msg, const std::string &id);
|
||||
};
|
||||
|
||||
/** @brief enum class for severity. Used when reporting errors. */
|
||||
class Severity
|
||||
{
|
||||
public:
|
||||
enum e { error, style };
|
||||
static std::string stringify(e severity)
|
||||
{
|
||||
switch (severity)
|
||||
{
|
||||
case error:
|
||||
return "error";
|
||||
case style:
|
||||
return "style";
|
||||
};
|
||||
return "???";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
Loading…
Reference in New Issue