-
-
Notifications
You must be signed in to change notification settings - Fork 190
Closed
Labels
Description
My workarounds (for simple data) so far ...
Encoding example:
vector<uint8_t> data;
cbor::cbor_bytes_encoder encoder(data);
encoder.begin_array(1);
encoder.flush();
data.push_back(0xC1); // tag value
encoder.uint64_value(1); // actual data value
encoder.end_array();
encoder.flush();
Decoding (simplified) example:
cbor::cbor_bytes_cursor cursor(data);
cursor.next();
if (*(data.data() + cursor.column() - 2) == 0xC1) {
// expected tag
uint64_t myDataValue = cursor.current().get<uint64_t>();
}
I don't know whether there is a better way to deal with it, for me this seems to be sufficient at the moment.
Originally posted by @Pique7 in #567 (reply in thread)