CodeSonar C++ API
[For improved navigation, enable JavaScript.]
Public Member Functions | Static Public Member Functions | Static Public Attributes | Related Functions | List of all members
cs::warning_significance Class Reference

Enumeration class describing the significance setting for a warning class. More...

Public Member Functions

csint64 as_integer () const
 Get an integer representation of this. More...
 
std::string as_repr () const
 Get a representation of a warning_significance object that includes information useful for debugging. More...
 
std::string as_string () const
 Get a simple string representation of a warning_significance object. More...
 
int cmp (const warning_significance &other) const
 Comparison function for warning_significance, with respect to a stable overall ordering. More...
 
cs_hash_t hash () const
 Hash function for warning_significance. More...
 
std::string name () const
 Get the name of a warning_significance object. More...
 

Static Public Member Functions

static warning_significance from_integer (csint64 _inner)
 Construct an instance from an integer representation. More...
 

Static Public Attributes

static const warning_significance DIAGNOSTIC
 diagnostic: warnings of this class do not indicate vulnerabilities, they indicate the locations of events or artifacts of interest. More...
 
static const warning_significance FROM_MANIFEST
 Use this when creating a warning class to denote that the significance is to be read from the manifest: any significance value provided to the warning class creation function is ignored. More...
 
static const warning_significance REDUNDANCY
 redundancy: redundant code; may indicate a logic error. More...
 
static const warning_significance RELIABILITY
 reliability: a code correctness issue. More...
 
static const warning_significance SECURITY
 security: a security vulnerability. More...
 
static const warning_significance STYLE
 style: a violation of one or more coding guidelines. More...
 
static const warning_significance UNSPECIFIED
 No significance value was specified. More...
 

Related Functions

(Note that these are not member functions.)

bool operator!= (const warning_significance &a, const warning_significance &b)
 Inequality operator for warning_significance. More...
 
bool operator< (const warning_significance &a, const warning_significance &b)
 Less-than operator for warning_significance. More...
 
std::ostream & operator<< (std::ostream &out, const warning_significance &a)
 Print a representation of a warning_significance object to the specified stream. More...
 
bool operator<= (const warning_significance &a, const warning_significance &b)
 Less-than-or-equal operator for warning_significance. More...
 
bool operator== (const warning_significance &a, const warning_significance &b)
 Equality operator for warning_significance. More...
 
bool operator> (const warning_significance &a, const warning_significance &b)
 Greater-than operator for warning_significance. More...
 
bool operator>= (const warning_significance &a, const warning_significance &b)
 Greater-than-or-equal operator for warning_significance. More...
 

Detailed Description

Enumeration class describing the significance setting for a warning class.

Member Function Documentation

◆ as_integer()

csint64 cs::warning_significance::as_integer ( ) const
inline

Get an integer representation of this.

Returns
An integer suitable for use with from_integer(). Invariant: For warning_significance x, warning_significance.from_integer(x.as_integer()) == x

◆ as_repr()

std::string cs::warning_significance::as_repr ( ) const
inline

Get a representation of a warning_significance object that includes information useful for debugging.

Returns
The string representation.

◆ as_string()

std::string cs::warning_significance::as_string ( ) const
inline

Get a simple string representation of a warning_significance object.

Returns
The string representation.

◆ cmp()

int cs::warning_significance::cmp ( const warning_significance other) const
inline

Comparison function for warning_significance, with respect to a stable overall ordering.

Parameters
otherThe warning_significance object to compare against.
Returns
An integer N such that:
  • N==0 if the two objects compare equal
  • N<0 if this < other
  • N>0 if this > other

◆ from_integer()

static warning_significance cs::warning_significance::from_integer ( csint64  _inner)
inlinestatic

Construct an instance from an integer representation.

Parameters
[in]_innerThe integer representation, as returned by as_integer(). Invariant: For warning_significance x, warning_significance.from_integer(x.as_integer()) == x
Exceptions
cs::result::ERROR_INVALID_ARGUMENTif _inner is not a valid integer representation for a warning_significance instance.

◆ hash()

cs_hash_t cs::warning_significance::hash ( ) const
inline

Hash function for warning_significance.

◆ name()

std::string cs::warning_significance::name ( ) const
inline

Get the name of a warning_significance object.

Returns
The name.

Friends And Related Function Documentation

◆ operator!=()

bool operator!= ( const warning_significance a,
const warning_significance b 
)
related

Inequality operator for warning_significance.

Parameters
[in]aThe warning_significance object to compare.
[in]bThe warning_significance object to compare against.
Returns
false if a and b are equal according to warning_significance::cmp(), true otherwise.

◆ operator<()

bool operator< ( const warning_significance a,
const warning_significance b 
)
related

Less-than operator for warning_significance.

Parameters
[in]aThe warning_significance object to compare.
[in]bThe warning_significance object to compare against.
Returns
true if a < b according to warning_significance::cmp() , false otherwise.

◆ operator<<()

std::ostream & operator<< ( std::ostream &  out,
const warning_significance a 
)
related

Print a representation of a warning_significance object to the specified stream.

Parameters
[in]outThe stream to print to.
[in]aThe warning_significance object to print.
Returns
void

◆ operator<=()

bool operator<= ( const warning_significance a,
const warning_significance b 
)
related

Less-than-or-equal operator for warning_significance.

Parameters
[in]aThe warning_significance object to compare.
[in]bThe warning_significance object to compare against.
Returns
true if a <= b according to warning_significance::cmp() , false otherwise.

◆ operator==()

bool operator== ( const warning_significance a,
const warning_significance b 
)
related

Equality operator for warning_significance.

Parameters
[in]aThe warning_significance object to compare.
[in]bThe warning_significance object to compare against.
Returns
true if a and b are equal according to warning_significance::cmp(), false otherwise.

◆ operator>()

bool operator> ( const warning_significance a,
const warning_significance b 
)
related

Greater-than operator for warning_significance.

Parameters
[in]aThe warning_significance object to compare.
[in]bThe warning_significance object to compare against.
Returns
true if a > b according to warning_significance::cmp() , false otherwise.

◆ operator>=()

bool operator>= ( const warning_significance a,
const warning_significance b 
)
related

Greater-than-or-equal operator for warning_significance.

Parameters
[in]aThe warning_significance object to compare.
[in]bThe warning_significance object to compare against.
Returns
true if a >= b according to warning_significance::cmp() , false otherwise.

Member Data Documentation

◆ DIAGNOSTIC

const warning_significance cs::warning_significance::DIAGNOSTIC
static

diagnostic: warnings of this class do not indicate vulnerabilities, they indicate the locations of events or artifacts of interest.

◆ FROM_MANIFEST

const warning_significance cs::warning_significance::FROM_MANIFEST
static

Use this when creating a warning class to denote that the significance is to be read from the manifest: any significance value provided to the warning class creation function is ignored.

◆ REDUNDANCY

const warning_significance cs::warning_significance::REDUNDANCY
static

redundancy: redundant code; may indicate a logic error.

◆ RELIABILITY

const warning_significance cs::warning_significance::RELIABILITY
static

reliability: a code correctness issue.

◆ SECURITY

const warning_significance cs::warning_significance::SECURITY
static

security: a security vulnerability.

◆ STYLE

const warning_significance cs::warning_significance::STYLE
static

style: a violation of one or more coding guidelines.

◆ UNSPECIFIED

const warning_significance cs::warning_significance::UNSPECIFIED
static

No significance value was specified.


The documentation for this class was generated from the following file: