Cppcheck
Public Types | Public Member Functions | Public Attributes | List of all members
SuppressionList::Suppression Struct Reference

#include <suppressions.h>

Public Types

enum  { NO_LINE = -1 }
 

Public Member Functions

 Suppression ()=default
 
 Suppression (std::string id, std::string file, int line=NO_LINE)
 
bool operator< (const Suppression &other) const
 
bool operator== (const Suppression &other) const
 
bool parseComment (std::string comment, std::string *errorMessage)
 Parse inline suppression in comment. More...
 
bool isSuppressed (const ErrorMessage &errmsg) const
 
bool isMatch (const ErrorMessage &errmsg)
 
std::string getText () const
 
bool isLocal () const
 
bool isSameParameters (const Suppression &other) const
 

Public Attributes

std::string errorId
 
std::string fileName
 
int lineNumber = NO_LINE
 
int lineBegin = NO_LINE
 
int lineEnd = NO_LINE
 
Type type = Type::unique
 
std::string symbolName
 
std::string macroName
 
std::size_t hash {}
 
bool thisAndNextLine {}
 
bool matched {}
 
bool checked {}
 

Detailed Description

Definition at line 66 of file suppressions.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
NO_LINE 

Definition at line 150 of file suppressions.h.

Constructor & Destructor Documentation

◆ Suppression() [1/2]

SuppressionList::Suppression::Suppression ( )
default

◆ Suppression() [2/2]

SuppressionList::Suppression::Suppression ( std::string  id,
std::string  file,
int  line = NO_LINE 
)
inline

Definition at line 68 of file suppressions.h.

Member Function Documentation

◆ getText()

std::string SuppressionList::Suppression::getText ( ) const

Definition at line 392 of file suppressions.cpp.

References startsWith().

Referenced by ProjectFileDialog::addSingleSuppression().

◆ isLocal()

bool SuppressionList::Suppression::isLocal ( ) const
inline

Definition at line 124 of file suppressions.h.

Referenced by SuppressionList::addSuppression().

◆ isMatch()

bool SuppressionList::Suppression::isMatch ( const ErrorMessage errmsg)

Definition at line 383 of file suppressions.cpp.

References SuppressionList::isSuppressed().

◆ isSameParameters()

bool SuppressionList::Suppression::isSameParameters ( const Suppression other) const
inline

Definition at line 128 of file suppressions.h.

References errorId, fileName, hash, lineNumber, symbolName, and thisAndNextLine.

Referenced by SuppressionList::addSuppression().

◆ isSuppressed()

bool SuppressionList::Suppression::isSuppressed ( const ErrorMessage errmsg) const

◆ operator<()

bool SuppressionList::Suppression::operator< ( const Suppression other) const
inline

Definition at line 70 of file suppressions.h.

References errorId, fileName, hash, lineNumber, macroName, symbolName, and thisAndNextLine.

◆ operator==()

bool SuppressionList::Suppression::operator== ( const Suppression other) const
inline

Definition at line 88 of file suppressions.h.

References errorId, fileName, hash, lineBegin, lineEnd, lineNumber, macroName, symbolName, and type.

◆ parseComment()

bool SuppressionList::Suppression::parseComment ( std::string  comment,
std::string *  errorMessage 
)

Parse inline suppression in comment.

Parameters
commentthe full comment text
errorMessageoutput parameter for error message (wrong suppression attribute)
Returns
true if it is a inline comment.

Definition at line 297 of file suppressions.cpp.

References startsWith().

Referenced by parseInlineSuppressionCommentToken().

Member Data Documentation

◆ checked

bool SuppressionList::Suppression::checked {}

Definition at line 148 of file suppressions.h.

◆ errorId

std::string SuppressionList::Suppression::errorId

◆ fileName

std::string SuppressionList::Suppression::fileName

◆ hash

std::size_t SuppressionList::Suppression::hash {}

◆ lineBegin

int SuppressionList::Suppression::lineBegin = NO_LINE

Definition at line 140 of file suppressions.h.

Referenced by addInlineSuppressions(), and operator==().

◆ lineEnd

int SuppressionList::Suppression::lineEnd = NO_LINE

Definition at line 141 of file suppressions.h.

Referenced by operator==().

◆ lineNumber

int SuppressionList::Suppression::lineNumber = NO_LINE

◆ macroName

std::string SuppressionList::Suppression::macroName

Definition at line 144 of file suppressions.h.

Referenced by operator<(), and operator==().

◆ matched

bool SuppressionList::Suppression::matched {}

Definition at line 147 of file suppressions.h.

Referenced by SuppressionList::addSuppression().

◆ symbolName

std::string SuppressionList::Suppression::symbolName

◆ thisAndNextLine

bool SuppressionList::Suppression::thisAndNextLine {}

Definition at line 146 of file suppressions.h.

Referenced by isSameParameters(), and operator<().

◆ type

Type SuppressionList::Suppression::type = Type::unique

Definition at line 142 of file suppressions.h.

Referenced by operator==(), and parseInlineSuppressionCommentToken().


The documentation for this struct was generated from the following files: