MCPcopy Create free account
hub / github.com/danielaparker/jsoncons / construct_json_byte_string

Function construct_json_byte_string

examples/src/byte_string_examples.cpp:10–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8using namespace jsoncons; // For brevity
9
10void construct_json_byte_string()
11{
12 std::vector<uint8_t> bytes = {'H','e','l','l','o'};
13
14 // default suggested encoding (base64url)
15 json j1(byte_string_arg, bytes);
16 std::cout << "(1) "<< j1 << "\n\n";
17
18 // base64 suggested encoding
19 json j2(byte_string_arg, bytes, semantic_tag::base64);
20 std::cout << "(2) "<< j2 << "\n\n";
21
22 // base16 suggested encoding
23 json j3(byte_string_arg, bytes, semantic_tag::base16);
24 std::cout << "(3) "<< j3 << "\n\n";
25}
26
27void retrieve_json_value_as_byte_string()
28{

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected