| 560 | } |
| 561 | |
| 562 | void more_json_query_examples() |
| 563 | { |
| 564 | std::ifstream is("./input/books.json"); |
| 565 | auto data =jsoncons::json::parse(is); |
| 566 | |
| 567 | auto result1 = jsonpath::json_query(data, "$.books[1,1,3].title"); |
| 568 | std::cout << "(1)\n" << pretty_print(result1) << "\n\n"; |
| 569 | |
| 570 | auto result2 = jsonpath::json_query(data, "$.books[1,1,3].title", |
| 571 | jsonpath::result_options::path); |
| 572 | std::cout << "(2)\n" << pretty_print(result2) << "\n\n"; |
| 573 | |
| 574 | auto result3 = jsonpath::json_query(data, "$.books[1,1,3].title", |
| 575 | jsonpath::result_options::nodups); |
| 576 | std::cout << "(3)\n" << pretty_print(result3) << "\n\n"; |
| 577 | |
| 578 | auto result4 = jsonpath::json_query(data, "$.books[1,1,3].title", |
| 579 | jsonpath::result_options::path | jsonpath::result_options::nodups); |
| 580 | std::cout << "(4)\n" << pretty_print(result4) << "\n\n"; |
| 581 | } |
| 582 | |
| 583 | void make_expression_examples() |
| 584 | { |
no test coverage detected