| 410 | } |
| 411 | |
| 412 | void working_with_cbor2() |
| 413 | { |
| 414 | // Parse the string of data into a std::vector<std::tuple<std::string,jsoncons::byte_string,std::string>> value |
| 415 | auto val = cbor::decode_cbor<std::vector<std::tuple<std::string,jsoncons::byte_string,std::string>>>(data); |
| 416 | |
| 417 | std::cout << "(1)\n"; |
| 418 | for (const auto& row : val) |
| 419 | { |
| 420 | std::cout << std::get<0>(row) << ", " << std::get<1>(row) << ", " << std::get<2>(row) << "\n"; |
| 421 | } |
| 422 | std::cout << "\n"; |
| 423 | |
| 424 | // Serialize back to CBOR |
| 425 | std::vector<uint8_t> buffer; |
| 426 | cbor::encode_cbor(val, buffer); |
| 427 | std::cout << "(2)\n" << byte_string_view(buffer) << "\n\n"; |
| 428 | } |
| 429 | |
| 430 | void working_with_cbor3() |
| 431 | { |
no test coverage detected