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 | Private Attributes | List of all members
jmespath::parser::InsertNodeAction< NodeInserterT, NodeInsertConditionT > Class Template Reference

The InsertNodeAction class is a functor for inserting the given node into the AST whose root node is specified with targetNode. More...

#include <insertnodeaction.h>

Public Types

using result_type = void
 The action's result type. More...
 

Public Member Functions

template<typename T >
void operator() (ast::ExpressionNode &targetNode, T &node) const
 Inserts the given node into the AST whose root node is specified with targetNode. More...
 

Private Attributes

NodeInserterT m_nodeInserter
 Functor for inserting the a node at the position of the target node into the AST. More...
 
NodeInsertConditionT m_insertCondition
 Functor for checking whether the passed node can be inserted at the position of the target node. More...
 

Detailed Description

template<typename NodeInserterT, typename NodeInsertConditionT>
class jmespath::parser::InsertNodeAction< NodeInserterT, NodeInsertConditionT >

The InsertNodeAction class is a functor for inserting the given node into the AST whose root node is specified with targetNode.

The functor iterates over the left edge of the AST and if NodeInsertConditionT returns true for the given combination of targetNode and node the node will be inserted using NodeInserterT. If NodeInsertConditionT returns false it will try to insert node at the next location on the left edge of the AST.

Template Parameters
NodeInserterTPolicy type for inserting the a node at the position of the target node into the AST. The functor should have an overloaded function call operator with a signature of void(ast::ExpressionNode* targetNode, T* node) const.
NodeInsertConditionTPolicy type for checking whether the passed node can be inserted at the position of the target node. The functor should have an overloaded function call operator with a signature of bool(ast::ExpressionNode* targetNode, T* node) const.

Member Typedef Documentation

template<typename NodeInserterT , typename NodeInsertConditionT >
using jmespath::parser::InsertNodeAction< NodeInserterT, NodeInsertConditionT >::result_type = void

The action's result type.

Member Function Documentation

template<typename NodeInserterT , typename NodeInsertConditionT >
template<typename T >
void jmespath::parser::InsertNodeAction< NodeInserterT, NodeInsertConditionT >::operator() ( ast::ExpressionNode targetNode,
T &  node 
) const
inline

Inserts the given node into the AST whose root node is specified with targetNode.

Parameters
[in]targetNodeThe root node of the AST.
[in]nodeThe node which should be inserted.

Member Data Documentation

template<typename NodeInserterT , typename NodeInsertConditionT >
NodeInsertConditionT jmespath::parser::InsertNodeAction< NodeInserterT, NodeInsertConditionT >::m_insertCondition
private

Functor for checking whether the passed node can be inserted at the position of the target node.

template<typename NodeInserterT , typename NodeInsertConditionT >
NodeInserterT jmespath::parser::InsertNodeAction< NodeInserterT, NodeInsertConditionT >::m_nodeInserter
private

Functor for inserting the a node at the position of the target node into the AST.


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