make_expression.md
December 11, 2024 ยท View on GitHub
jsoncons::jmespath::make_expression
#include <jsoncons_ext/jmespath/jmespath.hpp>
template <typename Json>
jmespath_expression<Json> make_expression(const json::string_view_type& expr); (until 1.0.0)
(1)
template <typename Json>
jmespath_expression<Json> make_expression(const Json::string_view_type& expr, (since 1.0.0)
const custom_functions<Json>& funcs = custom_functions<Json>());
template <typename Json>
jmespath_expression<Json> make_expression(const json::string_view_type& expr, (2)
std::error_code& ec);
template <typename Json>
jmespath_expression<Json> make_expression(const Json::string_view_type& expr, (3) (since 1.0.0)
const custom_functions<Json>& funcs,
std::error_code& ec)
Returns a compiled JMESPath expression for later evaluation.
Parameters
| expr | JMESPath expression |
| funcs | Custom functions |
| ec | out-parameter for reporting errors in the non-throwing overload |
Return value
Returns a jmespath_expression object that represents the JMESPath expression.
Exceptions
(1) Throws a jmespath_error if JMESPath compilation fails.
(2) Sets the out-parameter ec to the jmespath_error_category if JMESPath compilation fails.