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

A collection of line count statistics. More...

Public Member Functions

 line_counts (size_t _blank, size_t _comment, size_t _code, size_t _mixed)
 Constructor. More...
 
std::string as_repr () const
 Get a representation of a line_counts object that includes information useful for debugging. More...
 
std::string as_string () const
 Get a simple string representation of a line_counts object. More...
 
size_t get_blank () const
 Get the number of blank lines. More...
 
size_t get_code () const
 Get the number of code-only lines from a line_counts object. More...
 
size_t get_comment () const
 Get the number of comment-only lines from a line_counts object. More...
 
size_t get_mixed () const
 Get the number of mixed lines from a line_counts object. More...
 

Friends

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

Related Functions

(Note that these are not member functions.)

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

Detailed Description

A collection of line count statistics.

Constructor & Destructor Documentation

◆ line_counts()

cs::line_counts::line_counts ( size_t  _blank,
size_t  _comment,
size_t  _code,
size_t  _mixed 
)
inline

Constructor.

Parameters
[in]_blankThe number of blank lines.
[in]_commentThe number of lines that contain comments only.
[in]_codeThe number of lines that contain code only.
[in]_mixedThe number of mized lines: lines that contain a combination of code and comments.

Member Function Documentation

◆ as_repr()

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

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

Returns
The string representation.

◆ as_string()

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

Get a simple string representation of a line_counts object.

Returns
The string representation.

◆ get_blank()

size_t cs::line_counts::get_blank ( ) const
inline

Get the number of blank lines.

Returns
The number of lines that are blank.

◆ get_code()

size_t cs::line_counts::get_code ( ) const
inline

Get the number of code-only lines from a line_counts object.

Returns
The number of lines that contain code only.

◆ get_comment()

size_t cs::line_counts::get_comment ( ) const
inline

Get the number of comment-only lines from a line_counts object.

Returns
The number of lines that contain comments only.

◆ get_mixed()

size_t cs::line_counts::get_mixed ( ) const
inline

Get the number of mixed lines from a line_counts object.

Returns
The number of lines that contain a combination of code and comments.

Friends And Related Function Documentation

◆ operator<<()

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

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

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

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