]>
git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/third_party/nlohmann-json/doc/examples/binary.cpp
2 #include <nlohmann/json.hpp>
4 using json
= nlohmann::json
;
8 // create a binary vector
9 std::vector
<std::uint8_t> vec
= {0xCA, 0xFE, 0xBA, 0xBE};
11 // create a binary JSON value with subtype 42
12 json j
= json::binary(vec
, 42);
14 // output type and subtype
15 std::cout
<< "type: " << j
.type_name() << ", subtype: " << j
.get_binary().subtype() << std::endl
;