]>
git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/third_party/nlohmann-json/doc/examples/to_bson.cpp
3 #include <nlohmann/json.hpp>
5 using json
= nlohmann::json
;
10 json j
= R
"({"compact
": true, "schema
": 0})"_json
;
12 // serialize it to BSON
13 std::vector
<std::uint8_t> v
= json::to_bson(j
);
15 // print the vector content
18 std::cout
<< "0x" << std::hex
<< std::setw(2) << std::setfill('0') << (int)byte
<< " ";
20 std::cout
<< std::endl
;