2019-03-19 15:40:23 +01:00
|
|
|
#include <iostream>
|
|
|
|
#include <nlohmann/json.hpp>
|
|
|
|
|
|
|
|
using json = nlohmann::json;
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
// create empty JSON Pointer
|
|
|
|
json::json_pointer ptr("/foo/bar/baz");
|
2022-07-29 14:28:37 +02:00
|
|
|
std::cout << "\"" << ptr << "\"\n";
|
2019-03-19 15:40:23 +01:00
|
|
|
|
|
|
|
// call pop_back()
|
|
|
|
ptr.pop_back();
|
2022-07-29 14:28:37 +02:00
|
|
|
std::cout << "\"" << ptr << "\"\n";
|
2019-03-19 15:40:23 +01:00
|
|
|
|
|
|
|
ptr.pop_back();
|
2022-07-29 14:28:37 +02:00
|
|
|
std::cout << "\"" << ptr << "\"\n";
|
2019-03-19 15:40:23 +01:00
|
|
|
|
|
|
|
ptr.pop_back();
|
2022-07-29 14:28:37 +02:00
|
|
|
std::cout << "\"" << ptr << "\"\n";
|
2019-03-19 15:40:23 +01:00
|
|
|
}
|