MCPcopy Create free account
hub / github.com/danielaparker/jsoncons / custom_functions1

Function custom_functions1

examples/src/jsonpath_examples.cpp:783–794  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

781};
782
783void custom_functions1()
784{
785 my_custom_functions<jsoncons::json> funcs;
786
787 jsoncons::json root = jsoncons::json::parse(R"([{"foo": 60, "bar": 10},{"foo": 60, "bar": 5}])");
788 std::cout << pretty_print(root) << "\n\n";
789
790 auto expr = jsonpath::make_expression<jsoncons::json>("$[?(divide(@.foo, @.bar) == 6)]", funcs);
791 jsoncons::json result = expr.evaluate(root);
792
793 std::cout << pretty_print(result) << "\n\n";
794}
795
796void custom_functions2()
797{

Callers 1

mainFunction · 0.85

Calls 3

parseFunction · 0.85
pretty_printFunction · 0.85
evaluateMethod · 0.45

Tested by

no test coverage detected