| 581 | } |
| 582 | |
| 583 | void make_expression_examples() |
| 584 | { |
| 585 | auto expr = jsonpath::make_expression<jsoncons::json>("$.books[1,1,3].title"); |
| 586 | |
| 587 | std::ifstream is("./input/books.json"); |
| 588 | auto data =jsoncons::json::parse(is); |
| 589 | |
| 590 | jsoncons::json result1 = expr.evaluate(data); |
| 591 | std::cout << "(1) " << pretty_print(result1) << "\n\n"; |
| 592 | |
| 593 | jsoncons::json result2 = expr.evaluate(data, jsonpath::result_options::path); |
| 594 | std::cout << "(2) " << pretty_print(result2) << "\n\n"; |
| 595 | |
| 596 | jsoncons::json result3 = expr.evaluate(data, jsonpath::result_options::nodups); |
| 597 | std::cout << "(3) " << pretty_print(result3) << "\n\n"; |
| 598 | |
| 599 | jsoncons::json result4 = expr.evaluate(data, jsonpath::result_options::path | jsonpath::result_options::nodups); |
| 600 | std::cout << "(4) " << pretty_print(result4) << "\n\n"; |
| 601 | } |
| 602 | |
| 603 | void more_make_expression_example() |
| 604 | { |
no test coverage detected