1Streaming Encoding
2=============================
3
4`cbor/encoding.h <https://github.com/PJK/libcbor/blob/master/src/cbor/encoding.h>`_
5exposes a low-level encoding API to encode CBOR objects on the fly. Unlike
6:func:`cbor_serialize`, these functions take logical values (integers, floats,
7strings, etc.) instead of :type:`cbor_item_t`. The client is responsible for
8constructing the compound types correctly (e.g. terminating arrays).
9
10Streaming 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
12.. doxygenfunction:: cbor_encode_uint8
13
14.. doxygenfunction:: cbor_encode_uint16
15
16.. doxygenfunction:: cbor_encode_uint32
17
18.. doxygenfunction:: cbor_encode_uint64
19
20.. doxygenfunction:: cbor_encode_uint
21
22.. doxygenfunction:: cbor_encode_negint8
23
24.. doxygenfunction:: cbor_encode_negint16
25
26.. doxygenfunction:: cbor_encode_negint32
27
28.. doxygenfunction:: cbor_encode_negint64
29
30.. doxygenfunction:: cbor_encode_negint
31
32.. doxygenfunction:: cbor_encode_bytestring_start
33
34.. doxygenfunction:: cbor_encode_indef_bytestring_start
35
36.. doxygenfunction:: cbor_encode_string_start
37
38.. doxygenfunction:: cbor_encode_indef_string_start
39
40.. doxygenfunction:: cbor_encode_array_start
41
42.. doxygenfunction:: cbor_encode_indef_array_start
43
44.. doxygenfunction:: cbor_encode_map_start
45
46.. doxygenfunction:: cbor_encode_indef_map_start
47
48.. doxygenfunction:: cbor_encode_tag
49
50.. doxygenfunction:: cbor_encode_bool
51
52.. doxygenfunction:: cbor_encode_null
53
54.. doxygenfunction:: cbor_encode_undef
55
56.. doxygenfunction:: cbor_encode_half
57
58.. doxygenfunction:: cbor_encode_single
59
60.. doxygenfunction:: cbor_encode_double
61
62.. doxygenfunction:: cbor_encode_break
63
64.. doxygenfunction:: cbor_encode_ctrl
65
66