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

Flag class used by a number of warningclass report() and report_return_warning() methods. 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 report_flags object that includes information useful for debugging. More...
 
std::string as_string () const
 Get a simple string representation of a report_flags object. More...
 
int cmp (const report_flags &other) const
 Comparison function for report_flags, with respect to a stable overall ordering. More...
 
cs_hash_t hash () const
 Hash function for report_flags. More...
 
std::string name () const
 Get the name of a report_flags object. More...
 
report_flagsoperator &= (const report_flags &other)
 AND-assign operator. More...
 
report_flagsoperator|= (const report_flags &other)
 OR-assign operator. More...
 
report_flags operator~ () const
 Complementation operator. More...
 

Static Public Member Functions

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

Static Public Attributes

static const report_flags ALREADY_XML_ENCODED
 Special characters such as '<' and '>' are already XML-escaped in the 'problem' string. More...
 
static const report_flags DONT_MARK_CONTRIBUTING
 This location should not be additionally highlighted in the code listing. More...
 
static const report_flags NONE
 Use this if you don't want any other flags. More...
 

Friends

report_flags operator & (const report_flags &a, const report_flags &b)
 
report_flags operator| (const report_flags &a, const report_flags &b)
 

Related Functions

(Note that these are not member functions.)

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

Detailed Description

Flag class used by a number of warningclass report() and report_return_warning() methods.

Member Function Documentation

◆ as_integer()

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

Get an integer representation of this.

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

◆ as_repr()

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

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

Returns
The string representation.

◆ as_string()

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

Get a simple string representation of a report_flags object.

Returns
The string representation.

◆ cmp()

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

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

Parameters
otherThe report_flags 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 report_flags cs::report_flags::from_integer ( csint64  _inner)
inlinestatic

Construct an instance from an integer representation.

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

◆ hash()

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

Hash function for report_flags.

◆ name()

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

Get the name of a report_flags object.

◆ operator &=()

report_flags& cs::report_flags::operator&= ( const report_flags other)
inline

AND-assign operator.

Returns
A report_flags object containing the flags that are contained in both this and other.

◆ operator|=()

report_flags& cs::report_flags::operator|= ( const report_flags other)
inline

OR-assign operator.

Returns
A report_flags object containing the flags that are contained in this, other, or both.

◆ operator~()

report_flags cs::report_flags::operator~ ( ) const
inline

Complementation operator.

Returns
A report_flags object containing the flags that are NOT contained in this.

Friends And Related Function Documentation

◆ operator!=()

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

Inequality operator for report_flags.

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

◆ operator&()

report_flags operator & ( const report_flags a,
const report_flags b 
)
related

AND operator for report_flags.

Parameters
[in]aAND operand.
[in]bAND operand.
Returns
A report_flags object containing all flags that are in both a and b.

◆ operator<()

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

Less-than operator for report_flags.

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

◆ operator<<()

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

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

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

◆ operator<=()

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

Less-than-or-equal operator for report_flags.

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

◆ operator==()

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

Equality operator for report_flags.

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

◆ operator>()

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

Greater-than operator for report_flags.

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

◆ operator>=()

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

Greater-than-or-equal operator for report_flags.

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

◆ operator|()

report_flags operator| ( const report_flags a,
const report_flags b 
)
related

OR operator for report_flags.

Parameters
[in]aOR operand.
[in]bOR operand.
Returns
A report_flags object containing all flags that are in at least one of a, b.

Member Data Documentation

◆ ALREADY_XML_ENCODED

const report_flags cs::report_flags::ALREADY_XML_ENCODED
static

Special characters such as '<' and '>' are already XML-escaped in the 'problem' string.

◆ DONT_MARK_CONTRIBUTING

const report_flags cs::report_flags::DONT_MARK_CONTRIBUTING
static

This location should not be additionally highlighted in the code listing.

(Note that in some cases CodeSonar will have independently determined that the location shouldn't be additionally highlighted.)

◆ NONE

const report_flags cs::report_flags::NONE
static

Use this if you don't want any other flags.


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