| 56 | } |
| 57 | |
| 58 | void serialize_json_byte_string() |
| 59 | { |
| 60 | std::vector<uint8_t> bytes = {'H','e','l','l','o'}; |
| 61 | |
| 62 | json j(byte_string_arg, bytes); |
| 63 | |
| 64 | // default |
| 65 | std::cout << "(1) "<< j << "\n\n"; |
| 66 | |
| 67 | // base16 |
| 68 | auto options2 = json_options{} |
| 69 | .byte_string_format(byte_string_chars_format::base16); |
| 70 | std::cout << "(2) "<< print(j, options2) << "\n\n"; |
| 71 | |
| 72 | // base64 |
| 73 | auto options3 = json_options{} |
| 74 | .byte_string_format(byte_string_chars_format::base64); |
| 75 | std::cout << "(3) "<< print(j, options3) << "\n\n"; |
| 76 | |
| 77 | // base64url |
| 78 | auto options4 = json_options{} |
| 79 | .byte_string_format(byte_string_chars_format::base64url); |
| 80 | std::cout << "(4) "<< print(j, options4) << "\n\n"; |
| 81 | } |
| 82 | |
| 83 | int main() |
| 84 | { |
no test coverage detected