| 325 | } |
| 326 | |
| 327 | void decode_cbor_with_packed_strings() |
| 328 | { |
| 329 | std::vector<uint8_t> v = {0xd9,0x01,0x00, // tag(256) |
| 330 | 0x85, // array(5) |
| 331 | 0x63, // text(3) |
| 332 | 0x61,0x61,0x61, // "aaa" |
| 333 | 0xd8, 0x19, // tag(25) |
| 334 | 0x00, // unsigned(0) |
| 335 | 0xd9, 0x01,0x00, // tag(256) |
| 336 | 0x83, // array(3) |
| 337 | 0x63, // text(3) |
| 338 | 0x62,0x62,0x62, // "bbb" |
| 339 | 0x63, // text(3) |
| 340 | 0x61,0x61,0x61, // "aaa" |
| 341 | 0xd8, 0x19, // tag(25) |
| 342 | 0x01, // unsigned(1) |
| 343 | 0xd9, 0x01,0x00, // tag(256) |
| 344 | 0x82, // array(2) |
| 345 | 0x63, // text(3) |
| 346 | 0x63,0x63,0x63, // "ccc" |
| 347 | 0xd8, 0x19, // tag(25) |
| 348 | 0x00, // unsigned(0) |
| 349 | 0xd8, 0x19, // tag(25) |
| 350 | 0x00 // unsigned(0) |
| 351 | }; |
| 352 | |
| 353 | ojson j = cbor::decode_cbor<ojson>(v); |
| 354 | |
| 355 | std::cout << pretty_print(j) << "\n"; |
| 356 | } |
| 357 | |
| 358 | const std::vector<uint8_t> data = { |
| 359 | 0x9f, // Start indefinte length array |