diff options
Diffstat (limited to 'doc/source/api/encoding.rst')
-rw-r--r-- | doc/source/api/encoding.rst | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/source/api/encoding.rst b/doc/source/api/encoding.rst new file mode 100644 index 000000000000..af6bbbe7b9d3 --- /dev/null +++ b/doc/source/api/encoding.rst @@ -0,0 +1,23 @@ +Encoding +============================= + +The easiest way to encode data items is using the :func:`cbor_serialize` or :func:`cbor_serialize_alloc` functions: + +.. doxygenfunction:: cbor_serialize +.. doxygenfunction:: cbor_serialize_alloc + +Type-specific serializers +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +In case you know the type of the item you want to serialize beforehand, you can use one +of the type-specific serializers. + +.. note:: Unless compiled in debug mode, these do not verify the type. Passing an incorrect item will result in an undefined behavior. + +.. doxygenfunction:: cbor_serialize_uint +.. doxygenfunction:: cbor_serialize_negint +.. doxygenfunction:: cbor_serialize_bytestring +.. doxygenfunction:: cbor_serialize_string +.. doxygenfunction:: cbor_serialize_array +.. doxygenfunction:: cbor_serialize_map +.. doxygenfunction:: cbor_serialize_tag +.. doxygenfunction:: cbor_serialize_float_ctrl |