| 405 | } |
| 406 | |
| 407 | const unsigned char* |
| 408 | parse_cbor_value( const unsigned char* first, const unsigned char* last, value& v ) |
| 409 | { |
| 410 | ensure( 1, first, last ); |
| 411 | const unsigned char ch = *first++; |
| 412 | |
| 413 | switch( ch >> 5 ) |
| 414 | { |
| 415 | case 0: |
| 416 | return parse_cbor_unsigned( first, last, ch, v ); |
| 417 | |
| 418 | case 1: |
| 419 | return parse_cbor_signed( first, last, ch, v ); |
| 420 | |
| 421 | case 2: |
| 422 | throw_format_error( "Binary strings aren't supported" ); |
| 423 | |
| 424 | case 3: |
| 425 | return parse_cbor_string( first, last, ch, v ); |
| 426 | |
| 427 | case 4: |
| 428 | return parse_cbor_array( first, last, ch, v ); |
| 429 | |
| 430 | case 5: |
| 431 | return parse_cbor_object( first, last, ch, v ); |
| 432 | |
| 433 | case 6: |
| 434 | return parse_cbor_semantic_tag( first, last, ch, v ); |
| 435 | |
| 436 | case 7: |
| 437 | return parse_cbor_type7( first, last, ch, v ); |
| 438 | |
| 439 | default: |
| 440 | BOOST_JSON_UNREACHABLE(); |
| 441 | } |
| 442 | } |
| 443 | |
| 444 | int |
| 445 | main(int argc, const char** argv) |
no test coverage detected