Encoding¶
The easiest way to encode data items is using the cbor_serialize()
or cbor_serialize_alloc()
functions:
Warning
doxygenfunction: Cannot find file: /tmp/B.5qzRfz/BUILD/libcbor-0.5.0/doc/build/doxygen/xml/index.xml
Warning
doxygenfunction: Cannot find file: /tmp/B.5qzRfz/BUILD/libcbor-0.5.0/doc/build/doxygen/xml/index.xml
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.
Warning
doxygenfunction: Cannot find file: /tmp/B.5qzRfz/BUILD/libcbor-0.5.0/doc/build/doxygen/xml/index.xml
Warning
doxygenfunction: Cannot find file: /tmp/B.5qzRfz/BUILD/libcbor-0.5.0/doc/build/doxygen/xml/index.xml
Warning
doxygenfunction: Cannot find file: /tmp/B.5qzRfz/BUILD/libcbor-0.5.0/doc/build/doxygen/xml/index.xml
Warning
doxygenfunction: Cannot find file: /tmp/B.5qzRfz/BUILD/libcbor-0.5.0/doc/build/doxygen/xml/index.xml
Warning
doxygenfunction: Cannot find file: /tmp/B.5qzRfz/BUILD/libcbor-0.5.0/doc/build/doxygen/xml/index.xml
Warning
doxygenfunction: Cannot find file: /tmp/B.5qzRfz/BUILD/libcbor-0.5.0/doc/build/doxygen/xml/index.xml
Warning
doxygenfunction: Cannot find file: /tmp/B.5qzRfz/BUILD/libcbor-0.5.0/doc/build/doxygen/xml/index.xml
Warning
doxygenfunction: Cannot find file: /tmp/B.5qzRfz/BUILD/libcbor-0.5.0/doc/build/doxygen/xml/index.xml