Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 967 Bytes

make_expression.md

File metadata and controls

38 lines (26 loc) · 967 Bytes

jsoncons::jmespath::make_expression

#include <jsoncons_ext/jmespath/jmespath.hpp>

template <typename Json>
jmespath_expression<Json> make_expression(const json::string_view_type& expr); (1)

template <typename Json>
jmespath_expression<Json> make_expression(const json::string_view_type& expr,
                                          std::error_code& ec); (2)

Returns a compiled JMESPath expression for later evaluation.

Parameters

expr JMESPath expression
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.