Re:Show HN: Cdefs, extract function prototypes in C files to...
by aninteger on Sunday August 30, 2015 @02:57PM
(#10144167)
Would there be something that goes the other way? Given a JSON input generates C structs and efficient serialization/deserialization for given input? It could be useful for C++ too but generate classes instead. I'm aware of gsoap which did this for wsdl and generated code for use by SOAP xml clients and servers but not sure if anyone has done this for json
[ Parent
| on HN ]
Re:Show HN: Cdefs, extract function prototypes in C files to...
by kylebgorman on Sunday August 30, 2015 @04:10PM
(#10144347)
While it's not quite what you want (as the specification language is not JSON---it's more like C declarations), "protobufs" allow you to generate serializers and de-serializers in a number of languages.
Re:Show HN: Cdefs, extract function prototypes in C files to...
by arknave on Sunday August 30, 2015 @05:23PM
(#10144526)
There's thrift, but they have a custom specification with types. It shouldn't be too hard to go from JSON to thrift though.
Re:Show HN: Cdefs, extract function prototypes in C files to...
by TMSZ on Sunday August 30, 2015 @03:11PM
(#10144203)
JSONedit has (experimental) C++ code generator that serializes and deserializes JSON to/from object (default name for class is "Settings" and it uses json-cpp 0.5 as parser and generator): http://tomeko.net/software/JSONedit/cpp_class_generator.php