CodeSonar C++ API
Public Member Functions | Static Public Member Functions | Static Public Attributes | Related Symbols | List of all members
cs::ast_traverse_directives Class Reference

Flag class: specifies behavior during traversal with an ast_iterator. More...

Public Member Functions

csint64 as_integer () const
 Get an integer representation of this.
 
std::string as_repr () const
 Get a representation of a ast_traverse_directives object that includes information useful for debugging.
 
std::string as_string () const
 Get a simple string representation of a ast_traverse_directives object.
 
int cmp (const ast_traverse_directives &other) const
 Comparison function for ast_traverse_directives, with respect to a stable overall ordering.
 
cs_hash_t hash () const
 Hash function for ast_traverse_directives.
 
std::string name () const
 Get the name of a ast_traverse_directives object.
 
ast_traverse_directivesoperator&= (const ast_traverse_directives &other)
 AND-assign operator.
 
ast_traverse_directivesoperator|= (const ast_traverse_directives &other)
 OR-assign operator.
 
ast_traverse_directives operator~ () const
 Complementation operator.
 

Static Public Member Functions

static ast_traverse_directives from_integer (csint64 _inner)
 Construct an instance from an integer representation.
 

Static Public Attributes

static const ast_traverse_directives NONE
 No directives set.
 
static const ast_traverse_directives SKIP_CHILDREN
 Skip the children of the current node, but continue with remainder of traversal.
 

Related Symbols

(Note that these are not member symbols.)

bool operator!= (const ast_traverse_directives &a, const ast_traverse_directives &b)
 Inequality operator for ast_traverse_directives.
 
ast_traverse_directives operator& (const ast_traverse_directives &a, const ast_traverse_directives &b)
 AND operator for ast_traverse_directives.
 
bool operator< (const ast_traverse_directives &a, const ast_traverse_directives &b)
 Less-than operator for ast_traverse_directives.
 
std::ostream & operator<< (std::ostream &out, const ast_traverse_directives &a)
 Print a representation of a ast_traverse_directives object to the specified stream.
 
bool operator<= (const ast_traverse_directives &a, const ast_traverse_directives &b)
 Less-than-or-equal operator for ast_traverse_directives.
 
bool operator== (const ast_traverse_directives &a, const ast_traverse_directives &b)
 Equality operator for ast_traverse_directives.
 
bool operator> (const ast_traverse_directives &a, const ast_traverse_directives &b)
 Greater-than operator for ast_traverse_directives.
 
bool operator>= (const ast_traverse_directives &a, const ast_traverse_directives &b)
 Greater-than-or-equal operator for ast_traverse_directives.
 
ast_traverse_directives operator| (const ast_traverse_directives &a, const ast_traverse_directives &b)
 OR operator for ast_traverse_directives.
 

Detailed Description

Flag class: specifies behavior during traversal with an ast_iterator.

Apply with ast_iterator::apply_directives() at any point during traversal.

Member Function Documentation

◆ as_integer()

csint64 cs::ast_traverse_directives::as_integer ( ) const
inline

Get an integer representation of this.

Returns
An integer suitable for use with from_integer().

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

◆ as_repr()

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

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

Returns
The string representation.

◆ as_string()

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

Get a simple string representation of a ast_traverse_directives object.

Returns
The string representation.

◆ cmp()

int cs::ast_traverse_directives::cmp ( const ast_traverse_directives other) const
inline

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

Parameters
otherThe ast_traverse_directives object to compare against.
Returns
An integer N such that:
  • N==0 if the two objects compare equal
  • N<0 if this < other
  • N>0 if this > other

◆ from_integer()

static ast_traverse_directives cs::ast_traverse_directives::from_integer ( csint64  _inner)
inlinestatic

Construct an instance from an integer representation.

Parameters
[in]_innerThe integer representation, as returned by as_integer().

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

Exceptions
cs::result::ERROR_INVALID_ARGUMENTif _inner is not a valid integer representation for a ast_traverse_directives instance.

◆ hash()

cs_hash_t cs::ast_traverse_directives::hash ( ) const
inline

Hash function for ast_traverse_directives.


◆ name()

std::string cs::ast_traverse_directives::name ( ) const
inline

Get the name of a ast_traverse_directives object.

◆ operator&=()

ast_traverse_directives & cs::ast_traverse_directives::operator&= ( const ast_traverse_directives other)
inline

AND-assign operator.

Returns
A ast_traverse_directives object containing the flags that are contained in both this and other.

◆ operator|=()

ast_traverse_directives & cs::ast_traverse_directives::operator|= ( const ast_traverse_directives other)
inline

OR-assign operator.

Returns
A ast_traverse_directives object containing the flags that are contained in this, other, or both.

◆ operator~()

ast_traverse_directives cs::ast_traverse_directives::operator~ ( ) const
inline

Complementation operator.

Returns
A ast_traverse_directives object containing the flags that are NOT contained in this.

Friends And Related Symbol Documentation

◆ operator!=()

bool operator!= ( const ast_traverse_directives a,
const ast_traverse_directives b 
)
related

Inequality operator for ast_traverse_directives.

Parameters
[in]aThe ast_traverse_directives object to compare.
[in]bThe ast_traverse_directives object to compare against.
Returns
false if a and b are equal according to ast_traverse_directives::cmp(), true otherwise.

◆ operator&()

ast_traverse_directives operator& ( const ast_traverse_directives a,
const ast_traverse_directives b 
)
related

AND operator for ast_traverse_directives.

Parameters
[in]aAND operand.
[in]bAND operand.
Returns
A ast_traverse_directives object containing all flags that are in both a and b.

◆ operator<()

bool operator< ( const ast_traverse_directives a,
const ast_traverse_directives b 
)
related

Less-than operator for ast_traverse_directives.

Parameters
[in]aThe ast_traverse_directives object to compare.
[in]bThe ast_traverse_directives object to compare against.
Returns
true if a < b according to ast_traverse_directives::cmp() , false otherwise.

◆ operator<<()

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

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

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

◆ operator<=()

bool operator<= ( const ast_traverse_directives a,
const ast_traverse_directives b 
)
related

Less-than-or-equal operator for ast_traverse_directives.

Parameters
[in]aThe ast_traverse_directives object to compare.
[in]bThe ast_traverse_directives object to compare against.
Returns
true if a <= b according to ast_traverse_directives::cmp() , false otherwise.

◆ operator==()

bool operator== ( const ast_traverse_directives a,
const ast_traverse_directives b 
)
related

Equality operator for ast_traverse_directives.

Parameters
[in]aThe ast_traverse_directives object to compare.
[in]bThe ast_traverse_directives object to compare against.
Returns
true if a and b are equal according to ast_traverse_directives::cmp(), false otherwise.

◆ operator>()

bool operator> ( const ast_traverse_directives a,
const ast_traverse_directives b 
)
related

Greater-than operator for ast_traverse_directives.

Parameters
[in]aThe ast_traverse_directives object to compare.
[in]bThe ast_traverse_directives object to compare against.
Returns
true if a > b according to ast_traverse_directives::cmp() , false otherwise.

◆ operator>=()

bool operator>= ( const ast_traverse_directives a,
const ast_traverse_directives b 
)
related

Greater-than-or-equal operator for ast_traverse_directives.

Parameters
[in]aThe ast_traverse_directives object to compare.
[in]bThe ast_traverse_directives object to compare against.
Returns
true if a >= b according to ast_traverse_directives::cmp() , false otherwise.

◆ operator|()

ast_traverse_directives operator| ( const ast_traverse_directives a,
const ast_traverse_directives b 
)
related

OR operator for ast_traverse_directives.

Parameters
[in]aOR operand.
[in]bOR operand.
Returns
A ast_traverse_directives object containing all flags that are in at least one of a, b.

Member Data Documentation

◆ NONE

const ast_traverse_directives cs::ast_traverse_directives::NONE
static

No directives set.

◆ SKIP_CHILDREN

const ast_traverse_directives cs::ast_traverse_directives::SKIP_CHILDREN
static

Skip the children of the current node, but continue with remainder of traversal.


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