Skip to content

Latest commit

 

History

History
65 lines (35 loc) · 1.9 KB

streaming_encoding.rst

File metadata and controls

65 lines (35 loc) · 1.9 KB

Streaming Encoding

cbor/encoding.h exposes a low-level encoding API to encode CBOR objects on the fly. Unlike cbor_serialize, these functions take logical values (integers, floats, strings, etc.) instead of cbor_item_t. The client is responsible for constructing the compound types correctly (e.g. terminating arrays).

Streaming encoding is typically used to create an streaming (indefinite length) CBOR strings <type_2_byte_strings>, byte strings <type_3_strings>, arrays <type_4_arrays>, and maps <type_5_maps>. Complete example: examples/streaming_array.c

cbor_encode_uint8

cbor_encode_uint16

cbor_encode_uint32

cbor_encode_uint64

cbor_encode_uint

cbor_encode_negint8

cbor_encode_negint16

cbor_encode_negint32

cbor_encode_negint64

cbor_encode_negint

cbor_encode_bytestring_start

cbor_encode_indef_bytestring_start

cbor_encode_string_start

cbor_encode_indef_string_start

cbor_encode_array_start

cbor_encode_indef_array_start

cbor_encode_map_start

cbor_encode_indef_map_start

cbor_encode_tag

cbor_encode_bool

cbor_encode_null

cbor_encode_undef

cbor_encode_half

cbor_encode_single

cbor_encode_double

cbor_encode_break

cbor_encode_ctrl