| 63 | } |
| 64 | |
| 65 | void jsonpointer_contains() |
| 66 | { |
| 67 | // Example from RFC 6901 |
| 68 | auto j = json::parse(R"( |
| 69 | { |
| 70 | "foo": ["bar", "baz"], |
| 71 | "": 0, |
| 72 | "a/b": 1, |
| 73 | "c%d": 2, |
| 74 | "e^f": 3, |
| 75 | "g|h": 4, |
| 76 | "i\\j": 5, |
| 77 | "k\"l": 6, |
| 78 | " ": 7, |
| 79 | "m~n": 8 |
| 80 | } |
| 81 | )"); |
| 82 | |
| 83 | std::cout << "(1) " << jsonpointer::contains(j, "/foo/0") << '\n'; |
| 84 | std::cout << "(2) " << jsonpointer::contains(j, "e^g") << '\n'; |
| 85 | } |
| 86 | |
| 87 | void jsonpointer_select_author() |
| 88 | { |