xref: /freebsd-src/contrib/libcbor/doc/source/api/streaming_encoding.rst (revision 5d3e7166f6a0187fa3f8831b16a06bd9955c21ff)
1*5d3e7166SEd MasteStreaming Encoding
2*5d3e7166SEd Maste=============================
3*5d3e7166SEd Maste
4*5d3e7166SEd Maste`cbor/encoding.h <https://github.com/PJK/libcbor/blob/master/src/cbor/encoding.h>`_
5*5d3e7166SEd Masteexposes a low-level encoding API to encode CBOR objects on the fly. Unlike
6*5d3e7166SEd Maste:func:`cbor_serialize`, these functions take logical values (integers, floats,
7*5d3e7166SEd Mastestrings, etc.) instead of :type:`cbor_item_t`. The client is responsible for
8*5d3e7166SEd Masteconstructing the compound types correctly (e.g. terminating arrays).
9*5d3e7166SEd Maste
10*5d3e7166SEd MasteStreaming encoding is typically used to create an streaming (indefinite length) CBOR :doc:`strings <type_2>`, :doc:`byte strings <type_3>`, :doc:`arrays <type_4>`, and :doc:`maps <type_5>`. Complete example: `examples/streaming_array.c <https://github.com/PJK/libcbor/blob/master/examples/streaming_array.c>`_
11*5d3e7166SEd Maste
12*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_uint8
13*5d3e7166SEd Maste
14*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_uint16
15*5d3e7166SEd Maste
16*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_uint32
17*5d3e7166SEd Maste
18*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_uint64
19*5d3e7166SEd Maste
20*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_uint
21*5d3e7166SEd Maste
22*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_negint8
23*5d3e7166SEd Maste
24*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_negint16
25*5d3e7166SEd Maste
26*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_negint32
27*5d3e7166SEd Maste
28*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_negint64
29*5d3e7166SEd Maste
30*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_negint
31*5d3e7166SEd Maste
32*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_bytestring_start
33*5d3e7166SEd Maste
34*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_indef_bytestring_start
35*5d3e7166SEd Maste
36*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_string_start
37*5d3e7166SEd Maste
38*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_indef_string_start
39*5d3e7166SEd Maste
40*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_array_start
41*5d3e7166SEd Maste
42*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_indef_array_start
43*5d3e7166SEd Maste
44*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_map_start
45*5d3e7166SEd Maste
46*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_indef_map_start
47*5d3e7166SEd Maste
48*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_tag
49*5d3e7166SEd Maste
50*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_bool
51*5d3e7166SEd Maste
52*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_null
53*5d3e7166SEd Maste
54*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_undef
55*5d3e7166SEd Maste
56*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_half
57*5d3e7166SEd Maste
58*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_single
59*5d3e7166SEd Maste
60*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_double
61*5d3e7166SEd Maste
62*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_break
63*5d3e7166SEd Maste
64*5d3e7166SEd Maste.. doxygenfunction:: cbor_encode_ctrl
65*5d3e7166SEd Maste
66