| 8 | using namespace jsoncons; // For brevity |
| 9 | |
| 10 | void 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 | |
| 27 | void retrieve_json_value_as_byte_string() |
| 28 | { |