Spiffy decode -- major new decode features
Spiffy decode is an additional decoding API layered on top of the previous. It supports searching maps by label and duplicate label detection. It supports fetching items by type. It has internal error tracking. It is easier to use and code for decoding a protocol parallels the code for encoding a protocol.
While many new encode functions are added for tag encoding, no changes were made to the core of the decoder.
Introduces the QCBORDecode_GetXxxx functions to get a data item of a specific type with internal error tracking. Allows writing a CBOR protocol decoder with many times fewer lines of code. The protocol decoder mirrors the protocol encoder and is easier to read.
Map searching by label with duplicate detection and type matching is added.
Ability to enter and exit arrays and maps as a clean way to decode these. The same code will work for definite length and indefinite length maps and arrays.
Ability to decode many different number formats with conversion. For example, decimal fractions and big numbers can be fetched and converted into doubles. This however brings in a lot of object code.
A pretty example is added showing various ways of decoding a map.
Ability to encode floats and doubles with or without preferred encoding (conversion to half-precision or single-precision)
Handling of tags is revised to much better align with the intended CBOR design (this design is much more clear in the CBORbis document than in RFC 7049). The new design is simpler to use, though it has a hard limit of four levels of tag nesting.
New methods for UsefulInputBuf to manipulate the input buffer length.
Reorganized error codes so they are 1) separate from decode and encode, 2) not well-formed are contiguous so it is easy to check for them 3) unrecoverable decode errors are together so it is easy to check for them
Added the newly defined standard CBOR invalid tags.
Full support for decoding of all tags described in RFC 7049. (only encoding was previously supported).
Added QCBORDecode_VGetNext() which is QCBORDecode_GetNext with spiffy decode style error handling.
Fixes bugs when decoding combinations of definite and indefinite length maps and arrays.
Uses tag 257 to encode MIME messages rather than 36. This is a non-backwards compatible change.