Open lrosenthol opened 3 years ago
It's on the list. It may take a while, though.
You might find this interesting/useful - it's Python that produces C code based on a CDDL description - https://github.com/NordicSemiconductor/cddl-gen
I think before looking at CDDL I need to revisit some aspects of the CBOR implementation. Currently it transforms CBOR events into jsoncons events during parsing, feeding those events into a json_visitor
. I think I need another layer so we have a cbor_visitor
that is first to receive raw CBOR events, and which users can intercept if they wish. I think I also need a big_decimal
class for subsequent mapping of CBOR big decimal numbers. Other languages have this easier, standard C++ lacks so many types, no big integer, no big decimal, no portable int128, no portable float128. I'll probably get to CBOR Diagnostic Notation before CDDL.
I think I need another layer so we have a
cbor_visitor
that is first to receive raw CBOR events, and which users can intercept if they wish.
That would indeed be helpful for a number of cases.
I think I also need a big_decimal class for subsequent mapping of CBOR big decimal numbers.
Yes and others, as you note. It's also important to make sure that the original CBOR type is available to this new cbor_visitor
to improve handling of custom tags or simply adding support for other types not natively supported in jsoncons.
I'll probably get to CBOR Diagnostic Notation before CDDL.
That works for me!
Describe the proposed feature
CDDL is the notational convention for describing CBOR data structures (https://datatracker.ietf.org/doc/html/rfc8610) - think JSON Schema for CBOR - though it is also useful for JSON as well.
What other libraries (C++ or other) have this feature?
None :(. This page (https://github.com/cbor-wg/cddl/issues/29) tracks implementations and there seem to be none in C/C++. So you could be the first!