class report_flags

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

report_flags Details

class cs.report_flags

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

static from_integer(_inner)

Construct an instance from an integer representation.

Parameters:_inner (int) – The integer representation, as returned by report_flags.as_integer().
Return type:report_flags
Raises:result.ERROR_INVALID_ARGUMENT if _inner is not a valid integer representation for a report_flags instance.

Invariant: For report_flags x, report_flags.from_integer(x.as_integer()) == x

>>> report_flags.from_integer(1)
<cs.report_flags already_xml_encoded>
__and__(b)

AND operator for report_flags .

Parameters:b (report_flags) – AND operand.
Return type:report_flags
Returns:A report_flags object containing all flags that are in both self and b.
>>> report_flags.NONE & report_flags.ALREADY_XML_ENCODED
<cs.report_flags none>
__cmp__(other)

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

Parameters:other (report_flags) – The report_flags object to compare against.
Return type:int
Returns:An integer N such that:
  • N==0 if the two objects compare equal
  • N<0 if self < other
  • N>0 if self > other
>>> report_flags.DONT_MARK_CONTRIBUTING.__cmp__(report_flags.ALREADY_XML_ENCODED)
1
__eq__(b)

Equality operator for report_flags .

Parameters:b (report_flags) – The report_flags object to compare against.
Return type:bool
Returns:True if self and b compare equal, False otherwise.
>>> report_flags.NONE == report_flags.DONT_MARK_CONTRIBUTING
False
__ge__(b)

Greater-than-or-equal operator for report_flags .

Parameters:b (report_flags) – The report_flags object to compare against.
Return type:bool
Returns:True if self >= b , False otherwise.
>>> report_flags.ALREADY_XML_ENCODED >= report_flags.NONE
True
__gt__(b)

Greater-than operator for report_flags .

Parameters:b (report_flags) – The report_flags object to compare against.
Return type:bool
Returns:True if self > b , False otherwise.
>>> report_flags.ALREADY_XML_ENCODED > report_flags.DONT_MARK_CONTRIBUTING
False
__hash__()

Hash function for report_flags .

Return type:int
>>> hash(report_flags.DONT_MARK_CONTRIBUTING)
2
__invert__()

Complementation operator.

Return type:report_flags
Returns:A report_flags object containing the flags that are NOT contained in self.
>>> ~report_flags.NONE
<cs.report_flags already_xml_encoded|dont_mark_contributing>
__le__(b)

Less-than-or-equal operator for report_flags .

Parameters:b (report_flags) – The report_flags object to compare against.
Return type:bool
Returns:True if self <= b , False otherwise.
>>> report_flags.ALREADY_XML_ENCODED <= report_flags.NONE
False
__lt__(b)

Less-than operator for report_flags .

Parameters:b (report_flags) – The report_flags object to compare against.
Return type:bool
Returns:True if self < b , False otherwise.
>>> report_flags.NONE < report_flags.DONT_MARK_CONTRIBUTING
True
__ne__(b)

Inequality operator for report_flags .

Parameters:b (report_flags) – The report_flags object to compare against.
Return type:bool
Returns:False if self and b compare equal, True otherwise.
>>> report_flags.NONE != report_flags.NONE
False
__or__(b)

OR operator for report_flags .

Parameters:b (report_flags) – OR operand.
Return type:report_flags
Returns:A report_flags object containing all flags that are in at least one of self, b.
>>> report_flags.DONT_MARK_CONTRIBUTING | report_flags.ALREADY_XML_ENCODED
<cs.report_flags already_xml_encoded|dont_mark_contributing>
__repr__()

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

Return type:str
Returns:The string representation.
>>> repr(report_flags.DONT_MARK_CONTRIBUTING)
'<cs.report_flags dont_mark_contributing>'
__str__()

Get a simple string representation of a report_flags object.

Return type:str
Returns:The string representation.
>>> str(report_flags.NONE)
'none'
as_integer()

Get an integer representation of self.

Return type:int
Returns:An integer suitable for use with report_flags.from_integer().

Invariant: For report_flags x, report_flags.from_integer(x.as_integer()) == x

>>> report_flags.NONE.as_integer()
0
name()

Get the name of a report_flags object.

Return type:str
>>> report_flags.DONT_MARK_CONTRIBUTING.name()
'dont_mark_contributing'
ALREADY_XML_ENCODED

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

>>> report_flags.ALREADY_XML_ENCODED
<cs.report_flags already_xml_encoded>
DONT_MARK_CONTRIBUTING

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.)

>>> report_flags.DONT_MARK_CONTRIBUTING
<cs.report_flags dont_mark_contributing>
NONE

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

>>> report_flags.NONE
<cs.report_flags none>