class report_flags¶
Flag class used by a number of warningclass report() and report_return_warning() methods.
report_flags Members¶
| Constructors | none |
| Static Method | from_integer() |
| Methods | __and__(), __cmp__(), __eq__(), __ge__(), __gt__(), __hash__(), __invert__(), __le__(), __lt__(), __ne__(), __or__(), __repr__(), __str__(), as_integer(), name() |
| Attributes | ALREADY_XML_ENCODED, DONT_MARK_CONTRIBUTING, NONE |
report_flags Details¶
-
class
cs.report_flags¶ Flag class used by a number of
warningclassreport() andreport_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_flagsRaises: result.ERROR_INVALID_ARGUMENTif_inneris not a valid integer representation for areport_flagsinstance.Invariant: For
report_flagsx, 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_flagsReturns: A report_flagsobject containing all flags that are in bothselfandb.>>> 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) – Thereport_flagsobject 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) – Thereport_flagsobject to compare against.Return type: bool Returns: Trueifselfandbcompare equal,Falseotherwise.>>> report_flags.NONE == report_flags.DONT_MARK_CONTRIBUTING False
-
__ge__(b)¶ Greater-than-or-equal operator for
report_flags.Parameters: b ( report_flags) – Thereport_flagsobject to compare against.Return type: bool Returns: Trueifself>=b,Falseotherwise.>>> report_flags.ALREADY_XML_ENCODED >= report_flags.NONE True
-
__gt__(b)¶ Greater-than operator for
report_flags.Parameters: b ( report_flags) – Thereport_flagsobject to compare against.Return type: bool Returns: Trueifself>b,Falseotherwise.>>> 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_flagsReturns: A report_flagsobject containing the flags that are NOT contained inself.>>> ~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) – Thereport_flagsobject to compare against.Return type: bool Returns: Trueifself<=b,Falseotherwise.>>> report_flags.ALREADY_XML_ENCODED <= report_flags.NONE False
-
__lt__(b)¶ Less-than operator for
report_flags.Parameters: b ( report_flags) – Thereport_flagsobject to compare against.Return type: bool Returns: Trueifself<b,Falseotherwise.>>> report_flags.NONE < report_flags.DONT_MARK_CONTRIBUTING True
-
__ne__(b)¶ Inequality operator for
report_flags.Parameters: b ( report_flags) – Thereport_flagsobject to compare against.Return type: bool Returns: Falseifselfandbcompare equal,Trueotherwise.>>> report_flags.NONE != report_flags.NONE False
-
__or__(b)¶ OR operator for
report_flags.Parameters: b ( report_flags) – OR operand.Return type: report_flagsReturns: A report_flagsobject containing all flags that are in at least one ofself,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_flagsobject 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_flagsobject.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_flagsx, report_flags.from_integer(x.as_integer()) == x>>> report_flags.NONE.as_integer() 0
-
name()¶ Get the name of a
report_flagsobject.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>
-
static