libcbor 0.12.0
libcbor is a C library for parsing and generating CBOR, the general-purpose schema-less binary data format.
|
Streaming decoder result. More...
#include <data.h>
Data Fields | |
size_t | read |
Input bytes read/consumed. | |
enum cbor_decoder_status | status |
The decoding status. | |
size_t | required |
Number of bytes in the input buffer needed to resume parsing. | |
size_t cbor_decoder_result::read |
Input bytes read/consumed.
If this is less than the size of input buffer, the client will likely resume parsing starting at the next byte (e.g. buffer + result.read
).
Set to 0 if the status is not CBOR_DECODER_FINISHED.
size_t cbor_decoder_result::required |
Number of bytes in the input buffer needed to resume parsing.
Set to 0 unless the result status is CBOR_DECODER_NEDATA. If it is, then:
If at least one byte was passed, required will be set to the minimum number of bytes needed to invoke a decoded callback on the current prefix.
For example: Attempting to decode a 1B buffer containing 0x19
will set required to 3 as 0x19
signals a 2B integer item, so we need at least 3B to continue (the 0x19
MTB byte and two bytes of data needed to invoke cbor_callbacks.uint16).
enum cbor_decoder_status cbor_decoder_result::status |