MCPcopy Create free account
hub / github.com/boostorg/json / parse_cbor_value

Function parse_cbor_value

example/cbor.cpp:407–442  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

405}
406
407const unsigned char*
408parse_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
444int
445main(int argc, const char** argv)

Callers 4

parse_cbor_arrayFunction · 0.85
parse_cbor_objectFunction · 0.85
parse_cbor_semantic_tagFunction · 0.85
mainFunction · 0.85

Calls 9

ensureFunction · 0.85
parse_cbor_unsignedFunction · 0.85
parse_cbor_signedFunction · 0.85
throw_format_errorFunction · 0.85
parse_cbor_stringFunction · 0.85
parse_cbor_arrayFunction · 0.85
parse_cbor_objectFunction · 0.85
parse_cbor_semantic_tagFunction · 0.85
parse_cbor_type7Function · 0.85

Tested by

no test coverage detected