|
Cppcheck
|
class for handling suppressions More...
#include <suppressions.h>
Classes | |
| class | FileMatcher |
| struct | SuppressionEntry |
Public Member Functions | |
| std::string | parseFile (std::istream &istr) |
| Don't show errors listed in the file. | |
| std::string | addSuppressionLine (const std::string &line) |
| Don't show the given error. | |
| std::string | addSuppression (const std::string &errorId, const std::string &file="", unsigned int line=0) |
| Don't show this error. | |
| bool | isSuppressed (const std::string &errorId, const std::string &file, unsigned int line) |
| Returns true if this message should not be shown to the user. | |
| bool | isSuppressedLocal (const std::string &errorId, const std::string &file, unsigned int line) |
| Returns true if this message should not be shown to the user (explicit files only, not glob patterns). | |
| std::list< SuppressionEntry > | getUnmatchedLocalSuppressions (const std::string &file) const |
| Returns list of unmatched local (per-file) suppressions. | |
| std::list< SuppressionEntry > | getUnmatchedGlobalSuppressions () const |
| Returns list of unmatched global (glob pattern) suppressions. | |
Private Attributes | |
| std::map< std::string, FileMatcher > | _suppressions |
| List of error which the user doesn't want to see. | |
class for handling suppressions
Definition at line 32 of file suppressions.h.
| std::string Suppressions::addSuppression | ( | const std::string & | errorId, |
| const std::string & | file = "", |
||
| unsigned int | line = 0 |
||
| ) |
Don't show this error.
File and/or line are optional. In which case the errorId alone is used for filtering.
| errorId | the id for the error, e.g. "arrayIndexOutOfBounds" |
| file | File name with the path, e.g. "src/main.cpp" |
| line | number, e.g. "123" |
Definition at line 219 of file suppressions.cpp.
References _suppressions.
Referenced by addSuppressionLine(), and Preprocessor::removeComments().
| std::string Suppressions::addSuppressionLine | ( | const std::string & | line | ) |
Don't show the given error.
| line | Description of error to suppress (in id:file:line format). |
Definition at line 56 of file suppressions.cpp.
References addSuppression(), and Path::fromNativeSeparators().
Referenced by parseFile(), and CmdLineParser::ParseFromArgs().
| std::list< Suppressions::SuppressionEntry > Suppressions::getUnmatchedGlobalSuppressions | ( | ) | const |
Returns list of unmatched global (glob pattern) suppressions.
Definition at line 287 of file suppressions.cpp.
References _suppressions.
Referenced by CppCheckExecutor::check().
| std::list< Suppressions::SuppressionEntry > Suppressions::getUnmatchedLocalSuppressions | ( | const std::string & | file | ) | const |
Returns list of unmatched local (per-file) suppressions.
Definition at line 268 of file suppressions.cpp.
References _suppressions.
Referenced by CppCheck::processFile().
| bool Suppressions::isSuppressed | ( | const std::string & | errorId, |
| const std::string & | file, | ||
| unsigned int | line | ||
| ) |
Returns true if this message should not be shown to the user.
| errorId | the id for the error, e.g. "arrayIndexOutOfBounds" |
| file | File name with the path, e.g. "src/main.cpp" |
| line | number, e.g. "123" |
Definition at line 244 of file suppressions.cpp.
References _suppressions.
Referenced by Preprocessor::missingInclude(), CppCheck::reportErr(), and CppCheck::reportInfo().
| bool Suppressions::isSuppressedLocal | ( | const std::string & | errorId, |
| const std::string & | file, | ||
| unsigned int | line | ||
| ) |
Returns true if this message should not be shown to the user (explicit files only, not glob patterns).
| errorId | the id for the error, e.g. "arrayIndexOutOfBounds" |
| file | File name with the path, e.g. "src/main.cpp" |
| line | number, e.g. "123" |
Definition at line 256 of file suppressions.cpp.
References _suppressions.
Referenced by Suppressions::FileMatcher::isSuppressed(), CppCheck::reportErr(), and CppCheck::reportInfo().
| std::string Suppressions::parseFile | ( | std::istream & | istr | ) |
Don't show errors listed in the file.
| istr | Open file stream where errors can be read. |
Definition at line 28 of file suppressions.cpp.
References addSuppressionLine().
Referenced by CmdLineParser::ParseFromArgs().
std::map<std::string, FileMatcher> Suppressions::_suppressions [private] |
List of error which the user doesn't want to see.
Definition at line 77 of file suppressions.h.
Referenced by addSuppression(), getUnmatchedGlobalSuppressions(), getUnmatchedLocalSuppressions(), isSuppressed(), and isSuppressedLocal().
1.7.6.1