|
Cppcheck
|
Wrapper for error messages, provided by reportErr() More...
#include <errorlogger.h>
Classes | |
| class | FileLocation |
| File name and line number. More... | |
Public Member Functions | |
| ErrorMessage (const std::list< FileLocation > &callStack, Severity::SeverityType severity, const std::string &msg, const std::string &id, bool inconclusive) | |
| ErrorMessage (const std::list< const Token * > &callstack, const TokenList *list, Severity::SeverityType severity, const std::string &id, const std::string &msg, bool inconclusive) | |
| ErrorMessage () | |
| std::string | toXML (bool verbose, int ver) const |
| Format the error message in XML format. | |
| std::string | toString (bool verbose, const std::string &outputFormat="") const |
| Format the error message into a string. | |
| std::string | serialize () const |
| bool | deserialize (const std::string &data) |
| void | setmsg (const std::string &msg) |
| set short and verbose messages | |
| const std::string & | shortMessage () const |
| Short message (single line short message) | |
| const std::string & | verboseMessage () const |
| Verbose message (may be the same as the short message) | |
Static Public Member Functions | |
| static std::string | getXMLHeader (int xml_version) |
| static std::string | getXMLFooter (int xml_version) |
Public Attributes | |
| std::list< FileLocation > | _callStack |
| std::string | _id |
| std::string | file0 |
| source file (not header) | |
| Severity::SeverityType | _severity |
| bool | _inconclusive |
Static Private Member Functions | |
| static void | findAndReplace (std::string &source, const std::string &searchFor, const std::string &replaceWith) |
| Replace all occurrences of searchFor with replaceWith in the given source. | |
Private Attributes | |
| std::string | _shortMessage |
| Short message. | |
| std::string | _verboseMessage |
| Verbose message. | |
Wrapper for error messages, provided by reportErr()
Definition at line 154 of file errorlogger.h.
| ErrorLogger::ErrorMessage::ErrorMessage | ( | const std::list< FileLocation > & | callStack, |
| Severity::SeverityType | severity, | ||
| const std::string & | msg, | ||
| const std::string & | id, | ||
| bool | inconclusive | ||
| ) |
Definition at line 38 of file errorlogger.cpp.
References setmsg().
| ErrorLogger::ErrorMessage::ErrorMessage | ( | const std::list< const Token * > & | callstack, |
| const TokenList * | list, | ||
| Severity::SeverityType | severity, | ||
| const std::string & | id, | ||
| const std::string & | msg, | ||
| bool | inconclusive | ||
| ) |
Definition at line 48 of file errorlogger.cpp.
References _callStack, file0, TokenList::getFiles(), and setmsg().
Definition at line 33 of file errorlogger.cpp.
| bool ErrorLogger::ErrorMessage::deserialize | ( | const std::string & | data | ) |
Definition at line 111 of file errorlogger.cpp.
References Severity::fromString(), ErrorLogger::ErrorMessage::FileLocation::line, and ErrorLogger::ErrorMessage::FileLocation::setfile().
| void ErrorLogger::ErrorMessage::findAndReplace | ( | std::string & | source, |
| const std::string & | searchFor, | ||
| const std::string & | replaceWith | ||
| ) | [static, private] |
Replace all occurrences of searchFor with replaceWith in the given source.
| source | The string to modify |
| searchFor | What should be searched for |
| replaceWith | What will replace the found item |
Definition at line 270 of file errorlogger.cpp.
| std::string ErrorLogger::ErrorMessage::getXMLFooter | ( | int | xml_version | ) | [static] |
Definition at line 198 of file errorlogger.cpp.
Referenced by CppCheckExecutor::check(), and CppCheckExecutor::parseFromArgs().
| std::string ErrorLogger::ErrorMessage::getXMLHeader | ( | int | xml_version | ) | [static] |
Definition at line 175 of file errorlogger.cpp.
References CppCheck::version().
Referenced by CppCheckExecutor::check(), and CppCheckExecutor::parseFromArgs().
| std::string ErrorLogger::ErrorMessage::serialize | ( | ) | const |
Definition at line 88 of file errorlogger.cpp.
References Severity::toString().
| void ErrorLogger::ErrorMessage::setmsg | ( | const std::string & | msg | ) |
set short and verbose messages
Definition at line 66 of file errorlogger.cpp.
Referenced by ErrorMessage(), and Preprocessor::getcfgs().
| const std::string& ErrorLogger::ErrorMessage::shortMessage | ( | ) | const [inline] |
Short message (single line short message)
Definition at line 235 of file errorlogger.h.
Referenced by ThreadResult::reportErr().
| std::string ErrorLogger::ErrorMessage::toString | ( | bool | verbose, |
| const std::string & | outputFormat = "" |
||
| ) | const |
Format the error message into a string.
| verbose | use verbose message |
| outputFormat | Empty string to use default output format or template to be used. E.g. "{file}:{line},{severity},{id},{message}" |
Definition at line 279 of file errorlogger.cpp.
References ErrorLogger::callStackToString(), Severity::none, and Severity::toString().
Referenced by CppCheckExecutor::reportErr(), and CppCheck::reportErr().
| std::string ErrorLogger::ErrorMessage::toXML | ( | bool | verbose, |
| int | ver | ||
| ) | const |
Format the error message in XML format.
| verbose | use verbose message |
| ver | XML version |
Definition at line 224 of file errorlogger.cpp.
References Severity::error, stringToXml(), and Severity::toString().
Referenced by CppCheckExecutor::reportErr(), and Check::reportError().
| const std::string& ErrorLogger::ErrorMessage::verboseMessage | ( | ) | const [inline] |
Verbose message (may be the same as the short message)
Definition at line 240 of file errorlogger.h.
Referenced by ThreadResult::reportErr().
Definition at line 222 of file errorlogger.h.
Referenced by ErrorMessage(), Preprocessor::getcfgs(), ThreadResult::reportErr(), CppCheck::reportErr(), and CppCheck::reportInfo().
| std::string ErrorLogger::ErrorMessage::_id |
Definition at line 223 of file errorlogger.h.
Referenced by Preprocessor::getcfgs(), ThreadResult::reportErr(), CppCheck::reportErr(), and CppCheck::reportInfo().
Definition at line 229 of file errorlogger.h.
Referenced by ThreadResult::reportErr().
Definition at line 228 of file errorlogger.h.
Referenced by Preprocessor::getcfgs(), and ThreadResult::reportErr().
std::string ErrorLogger::ErrorMessage::_shortMessage [private] |
Short message.
Definition at line 255 of file errorlogger.h.
std::string ErrorLogger::ErrorMessage::_verboseMessage [private] |
Verbose message.
Definition at line 258 of file errorlogger.h.
| std::string ErrorLogger::ErrorMessage::file0 |
source file (not header)
Definition at line 226 of file errorlogger.h.
Referenced by ErrorMessage(), Preprocessor::missingInclude(), and ThreadResult::reportErr().
1.7.6.1