jmespath.cpp
C++ implementation of JMESPath, a query language for JSON http://jmespath.org
|
Classes for interpreting the AST of the JMESPath expression. More...
Classes | |
class | AbstractVisitor |
The AbstractVisitor class is an interface which defines the member functions required to visit every type of AST node. More... | |
class | ContextValueVisitorAdaptor |
The ContextValueVisitorAdaptor class adapts a visitor object, which is callable with const lvalue reference of Json and with rvalue reference of Json objects, to ContextValue objects. More... | |
class | Interpreter |
The Interpreter class evaluates the AST structure on a Json context. More... | |
Typedefs | |
using | JsonRef = std::reference_wrapper< const Json > |
Copyable and assignable reference to a constant Json value. More... | |
using | ContextValue = boost::variant< Json, JsonRef > |
Evaluation context type. More... | |
Functions | |
decltype(auto) | makeVisitor (std::function< void(const Json &)> &&lvalueFunc, std::function< void(Json &&)> &&rvalueFunc) |
Create visitor object which accepts ContextValue objects, and calls lvalueFunc callable with a const lvalue ref of the Json reference held by the ContextValue or calls the rvalueFunc callable with an rvalue ref of the Json object held by ContextValue. More... | |
decltype(auto) | makeMoveOnlyVisitor (std::function< void(Json &&)> rvalueFunc) |
Create visitor object which accepts ContextValue objects, and calls the rvalueFunc callable with an rvalue ref of the Json object held by the ContextValue or calls it with the rvalue ref of the copy of the object to which the Json reference points in the ContextValue object. More... | |
Json && | assignContextValue (Json &&value) |
Convert the given value to something assignable to a ContextValue variable. More... | |
JsonRef | assignContextValue (const Json &value) |
Convert the given value to something assignable to a ContextValue variable. More... | |
const Json & | getJsonValue (const ContextValue &contextValue) |
Extract the Json value held by the given value. More... | |
Classes for interpreting the AST of the JMESPath expression.
using jmespath::interpreter::ContextValue = typedef boost::variant<Json, JsonRef> |
using jmespath::interpreter::JsonRef = typedef std::reference_wrapper<const Json> |
Copyable and assignable reference to a constant Json value.
|
inline |
Convert the given value to something assignable to a ContextValue variable.
[in] | value | A Json value. |
|
inline |
Convert the given value to something assignable to a ContextValue variable.
[in] | value | A Json value. |
|
inline |
Extract the Json value held by the given value.
[in] | contextValue | A ContextValue variable. |
|
inline |
Create visitor object which accepts ContextValue objects, and calls the rvalueFunc callable with an rvalue ref of the Json object held by the ContextValue or calls it with the rvalue ref of the copy of the object to which the Json reference points in the ContextValue object.
[in] | rvalueFunc | A callable taking an rvalue reference to Json. |
|
inline |
Create visitor object which accepts ContextValue objects, and calls lvalueFunc callable with a const lvalue ref of the Json reference held by the ContextValue or calls the rvalueFunc callable with an rvalue ref of the Json object held by ContextValue.
[in] | lvalueFunc | A callable taking a const lvalue reference to Json. |
[in] | rvalueFunc | A callable taking an rvalue reference to Json. |