4 ms·
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 b
by aninteger 11y ago
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
- TMSZ 11y agoJSONedit 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 http://tomeko.net/software/JSONedit/cpp_class_generator.php
- kylebgorman 11y agoWhile 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. http://github.com/google/protobuf http://github.com/google/protobuf
- arknave 11y agoThere's thrift, but they have a custom specification with types. It shouldn't be too hard to go from JSON to thrift though. https://thrift.apache.org/ https://thrift.apache.org/
- deleted 11y ago[deleted]