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

A collection of filters used to restrict a xr_query. More...

Public Member Functions

void add_absolute_filter (const std::string &s)
 Add an absolute path filter to a xr_file_query object. More...
 
void add_absolute_substring_filter (const std::string &s)
 Add an absolute path substring filter to a xr_file_query object. More...
 
void add_basename_filter (const std::string &s)
 Add a basename filter to a xr_file_query object. More...
 
void add_basename_substring_filter (const std::string &s)
 Add a basename substring filter to a xr_file_query object. More...
 
void add_dirname_filter (const std::string &s)
 Add a dirname path filter to a xr_file_query object. More...
 
void add_dirname_substring_filter (const std::string &s)
 Add a dirname path substring filter to a xr_file_query object. More...
 
void add_file_filter (const sfile &s)
 Add a file filter to a xr_file_query object. More...
 
void add_line_number_filter (line_number s)
 Add a line number filter to a xr_file_query object. More...
 
std::string as_repr () const
 Get a representation of a xr_file_query object that includes information useful for debugging. More...
 
std::string as_string () const
 Get a simple string representation of a xr_file_query object. More...
 
void set_reject_libmodels (bool s)
 Specify whether or not the query should include library model files. More...
 

Related Functions

(Note that these are not member functions.)

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

Detailed Description

A collection of filters used to restrict a xr_query.

There are multiple filter types, each of which may have zero or more associated filters. The types are as follows.

A query includes xr_file_query objects in two different contexts.

In both these contexts, the xr_file_query restricts the query as follows.

Member Function Documentation

◆ add_absolute_filter()

void cs::xr_file_query::add_absolute_filter ( const std::string &  s)
inline

Add an absolute path filter to a xr_file_query object.

Parameters
[in]sThe filter: a string that will be compared against the file's absolute path.
Returns
void

If any strings are specified with this method, a token occurrence or definition will only satisfy the xr_file_query if it is located in a source file whose absolute path exactly matches at least one of those strings.

Comparison is case-insensitive and treats path separators '/' and '\' as interchangeable.

◆ add_absolute_substring_filter()

void cs::xr_file_query::add_absolute_substring_filter ( const std::string &  s)
inline

Add an absolute path substring filter to a xr_file_query object.

Parameters
[in]sThe filter: a string that will be compared against the file's absolute path.
Returns
void

If any strings are specified with this method, a token occurrence or definition will only satisfy the xr_file_query if it is located in a source file whose absolute path has at least one of those strings as a substring.

Comparison is case-insensitive and treats path separators '/' and '\' as interchangeable.

◆ add_basename_filter()

void cs::xr_file_query::add_basename_filter ( const std::string &  s)
inline

Add a basename filter to a xr_file_query object.

Parameters
[in]sThe filter: a string that will be compared against the file's basename.
Returns
void

If any strings are specified with this method, a token occurrence or definition will only satisfy the xr_file_query if it is located in a source file whose basename exactly matches at least one of those strings.

Comparison is case-insensitive.

◆ add_basename_substring_filter()

void cs::xr_file_query::add_basename_substring_filter ( const std::string &  s)
inline

Add a basename substring filter to a xr_file_query object.

Parameters
[in]sThe filter: a string that will be compared against the file's basename.
Returns
void

If any strings are specified with this method, a token occurrence or definition will only satisfy the xr_file_query if it is located in a source file whose basename has at least one of those strings as a substring.

Comparison is case-insensitive.

◆ add_dirname_filter()

void cs::xr_file_query::add_dirname_filter ( const std::string &  s)
inline

Add a dirname path filter to a xr_file_query object.

Parameters
[in]sThe filter: a string that will be compared against the file's dirname.
Returns
void

If any strings are specified with this method, a token occurrence or definition will only satisfy the xr_file_query if it is located in a source file whose dirname (ie, absolute path to file, omitting the basename and with no trailing slash) exactly matches one of those strings.

Comparison is case-insensitive and treats path separators '/' and '\' as interchangeable.

◆ add_dirname_substring_filter()

void cs::xr_file_query::add_dirname_substring_filter ( const std::string &  s)
inline

Add a dirname path substring filter to a xr_file_query object.

Parameters
[in]sThe filter: a string that will be compared against the file's dirname.
Returns
void

If any strings are specified with this method, a token occurrence or definition will only satisfy the xr_file_query if it is located in a source file whose dirname (ie, absolute path to file, omitting the basename and with no trailing slash) has at least one of those strings as a substring.

Comparison is case-insensitive and treats path separators '/' and '\' as interchangeable.

◆ add_file_filter()

void cs::xr_file_query::add_file_filter ( const sfile s)
inline

Add a file filter to a xr_file_query object.

Parameters
[in]sThe filter value: a source file (sfile).
Returns
void

If any sfile objects are specified with this method, a token occurrence or definition will only satisfy the xr_file_query if it is located in at least one of the specified source files.

◆ add_line_number_filter()

void cs::xr_file_query::add_line_number_filter ( line_number  s)
inline

Add a line number filter to a xr_file_query object.

Parameters
[in]sThe filter value: a source line (line_number).
Returns
void

If any line numbers are specified with this method, a token occurrence or definition will only satisfy the xr_file_query if it is located on at least one of the specified lines.

◆ as_repr()

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

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

Returns
The string representation.

◆ as_string()

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

Get a simple string representation of a xr_file_query object.

Returns
The string representation.

◆ set_reject_libmodels()

void cs::xr_file_query::set_reject_libmodels ( bool  s)
inline

Specify whether or not the query should include library model files.

Parameters
[in]sSet to true to exclude library model files; false to include library model files.
Returns
void

Friends And Related Function Documentation

◆ operator<<()

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

Print a representation of an xr_file_query object to the specified stream.

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

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