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

Used by warningclass report() and report_return_warnings() methods that report a warning with a list of code locations. More...

Public Member Functions

 locations_node (sfileinst _sfi, line_number _line, const std::string &_event, locations_node_flags _flags)
 Constructor. More...
 
 locations_node (sfileinst _sfi, line_number _start_line, line_number _end_line, column_number _start_col, column_number _end_col, const std::string &_event, locations_node_flags _flags)
 Constructor. More...
 
std::string as_repr () const
 Get a representation of a locations_node object that includes information useful for debugging. More...
 
std::string as_string () const
 Get a simple string representation of a locations_node object. More...
 
column_number get_end_col () const
 Get the end column from a locations_node. More...
 
line_number get_end_line () const
 Get the end line from a locations_node. More...
 
std::string get_event () const
 Get the event string from a locations_node. More...
 
sfileinst get_file () const
 Get the file instance from a locations_node. More...
 
locations_node_flags get_flags () const
 Get the flags from a locations_node. More...
 
column_number get_start_col () const
 Get the start column from a locations_node. More...
 
line_number get_start_line () const
 Get the start line from a locations_node. More...
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &out, const locations_node &a)
 Print a representation of a locations_node object to the specified stream. More...
 

Detailed Description

Used by warningclass report() and report_return_warnings() methods that report a warning with a list of code locations.

Constructor & Destructor Documentation

◆ locations_node() [1/2]

cs::locations_node::locations_node ( sfileinst  _sfi,
line_number  _line,
const std::string &  _event,
locations_node_flags  _flags 
)
inline

Constructor.

Parameters
[in]_sfiThe file instance (sfileinst) in which the event occurs.
[in]_lineThe line (line_number) in _sfi at which the event occurs.
[in]_eventA short description of the problem. If empty, no event will be associated with this node.
[in]_flagslocations_node_flags that characterize the node.

◆ locations_node() [2/2]

cs::locations_node::locations_node ( sfileinst  _sfi,
line_number  _start_line,
line_number  _end_line,
column_number  _start_col,
column_number  _end_col,
const std::string &  _event,
locations_node_flags  _flags 
)
inline

Constructor.

Parameters
[in]_sfiThe file instance (sfileinst) in which the event occurs.
[in]_start_lineThe line (line_number) in _sfi at which the event starts. One-based.
[in]_end_lineThe line (line_number) in _sfi at which the event ends. One-based. Inclusive.
[in]_start_colThe column (column_number) on _start_line where the event starts. Zero-based.
[in]_end_colThe column (column_number) on _end_line where the event ends. Zero-based. Exclusive. The value 0 is special and means end of line.
[in]_eventA short description of the problem. If empty, no event will be associated with this node.
[in]_flagslocations_node_flags that characterize the node.
Exceptions
result::ERROR_INVALID_ARGUMENTif relationships between specified _start_line, _end_line, are such that they cannot describe a valid span (in any file).

Member Function Documentation

◆ as_repr()

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

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

Returns
The string representation.

◆ as_string()

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

Get a simple string representation of a locations_node object.

Returns
The string representation.

◆ get_end_col()

column_number cs::locations_node::get_end_col ( ) const
inline

Get the end column from a locations_node.

Returns
The node's ending column.

◆ get_end_line()

line_number cs::locations_node::get_end_line ( ) const
inline

Get the end line from a locations_node.

Returns
The node's end line.

◆ get_event()

std::string cs::locations_node::get_event ( ) const
inline

Get the event string from a locations_node.

Returns
The node's event string.

◆ get_file()

sfileinst cs::locations_node::get_file ( ) const
inline

Get the file instance from a locations_node.

Returns
The node's file instance (sfileinst).

◆ get_flags()

locations_node_flags cs::locations_node::get_flags ( ) const
inline

Get the flags from a locations_node.

Returns
The node's flags.

◆ get_start_col()

column_number cs::locations_node::get_start_col ( ) const
inline

Get the start column from a locations_node.

Returns
The node's starting column.

◆ get_start_line()

line_number cs::locations_node::get_start_line ( ) const
inline

Get the start line from a locations_node.

Returns
The node's start line.

Friends And Related Function Documentation

◆ operator<<()

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

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

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

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