jmespath.cpp
C++ implementation of JMESPath, a query language for JSON http://jmespath.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Types | Public Member Functions | Public Attributes | List of all members
jmespath::ast::ComparatorExpressionNode Class Reference

The ComparatorExpressionNode class represents a JMESPath comparator expression. More...

#include <comparatorexpressionnode.h>

Inheritance diagram for jmespath::ast::ComparatorExpressionNode:
jmespath::ast::BinaryExpressionNode jmespath::ast::AbstractNode

Public Types

enum  Comparator {
  Comparator::Unknown, Comparator::Less, Comparator::LessOrEqual, Comparator::Equal,
  Comparator::GreaterOrEqual, Comparator::Greater, Comparator::NotEqual
}
 The Comparator enum defines the available comparison operators. More...
 

Public Member Functions

 ComparatorExpressionNode ()
 Constructs an empty ComparatorExpressionNode object. More...
 
 ComparatorExpressionNode (const ExpressionNode &left, Comparator valueComparator, const ExpressionNode &right)
 Constructs a ComparatorExpressionNode object with the given leftExpression, comparator and rightExpression. More...
 
bool operator== (const ComparatorExpressionNode &other) const
 Equality compares this node to the other. More...
 
bool isProjection () const override
 Returns whather this expression requires the projection of subsequent expressions. More...
 
bool stopsProjection () const override
 Reports whether the node should stop an ongoing projection or not. More...
 
void accept (interpreter::AbstractVisitor *visitor) const override
 Calls the visit method of the given visitor with the dynamic type of the node. More...
 
- Public Member Functions inherited from jmespath::ast::BinaryExpressionNode
 BinaryExpressionNode ()
 Constructs an empty BinaryExpressionNode object. More...
 
 BinaryExpressionNode (const ExpressionNode &left, const ExpressionNode &right)
 Constructs a BinaryExpressionNode object with the given leftExpressin and rightExpression as its children. More...
 
bool operator== (const BinaryExpressionNode &other) const
 Equality compares this node to the other. More...
 
- Public Member Functions inherited from jmespath::ast::AbstractNode
 AbstractNode ()=default
 Constructs an AbstractNode object. More...
 
 AbstractNode (const AbstractNode &)=default
 Copy-constructs an AbstractNode object. More...
 
virtual ~AbstractNode ()
 Destroys the AbstractNode object. More...
 
AbstractNodeoperator= (const AbstractNode &)=default
 Copy-assigns the other object to this object. More...
 

Public Attributes

Comparator comparator
 The type of comparator associated with the expression. More...
 
- Public Attributes inherited from jmespath::ast::BinaryExpressionNode
ExpressionNode leftExpression
 The left hand expression of the node. More...
 
ExpressionNode rightExpression
 The right hand expression of the node. More...
 

Detailed Description

The ComparatorExpressionNode class represents a JMESPath comparator expression.

Member Enumeration Documentation

The Comparator enum defines the available comparison operators.

Enumerator
Unknown 
Less 
LessOrEqual 
Equal 
GreaterOrEqual 
Greater 
NotEqual 

Constructor & Destructor Documentation

jmespath::ast::ComparatorExpressionNode::ComparatorExpressionNode ( )

Constructs an empty ComparatorExpressionNode object.

jmespath::ast::ComparatorExpressionNode::ComparatorExpressionNode ( const ExpressionNode left,
Comparator  valueComparator,
const ExpressionNode right 
)

Constructs a ComparatorExpressionNode object with the given leftExpression, comparator and rightExpression.

Parameters
[in]leftThe node's left hand child expression.
[in]valueComparatorThe type of comparison operator to use for comparing the results of the left and right hand child expressions.
[in]rightThe node's right hand child expression.

Member Function Documentation

void jmespath::ast::ComparatorExpressionNode::accept ( interpreter::AbstractVisitor visitor) const
overridevirtual

Calls the visit method of the given visitor with the dynamic type of the node.

Parameters
[in]visitorA visitor implementation

Reimplemented from jmespath::ast::BinaryExpressionNode.

bool jmespath::ast::ComparatorExpressionNode::isProjection ( ) const
overridevirtual

Returns whather this expression requires the projection of subsequent expressions.

Returns
Returns true if projection is required, otherwise returns false.

Implements jmespath::ast::BinaryExpressionNode.

bool jmespath::ast::ComparatorExpressionNode::operator== ( const ComparatorExpressionNode other) const

Equality compares this node to the other.

Parameters
[in]otherThe node that should be compared.
Returns
Returns true if this object is equal to the other, otherwise false
bool jmespath::ast::ComparatorExpressionNode::stopsProjection ( ) const
overridevirtual

Reports whether the node should stop an ongoing projection or not.

Returns
Returns true if the node should stop an ongoing projection, otherwise returns false.

Implements jmespath::ast::BinaryExpressionNode.

Member Data Documentation

Comparator jmespath::ast::ComparatorExpressionNode::comparator

The type of comparator associated with the expression.


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