json-protobuf 2.0.1

Creator: rpa-with-ash

Last updated:

Add to Cart

Description:

jsonprotobuf 2.0.1

json-protobuf provides a Json interface to Google's Protocol Buffers compiled in C++ code.
The idea is that you can convert a protocol buffer object to a json representation which can be used in API:s.
Producing Code
json-protobuf provides a plugin for the protoc protocol buffer compiler (it ships with protocol buffers). This plugin tells protoc to produce a set of C++ output files, which define the JSON interface to protocol buffers using the json-spirit library (other libraries will/coul be supported).
First, obtain a copy of json-protobuf:
$ git clone git@github.com:mickem/json-protobuf.git
$ cd json-protobuf

Next, install json-protobuf:
$ python setup.py install

Finally, launch protoc and tell it to produce Lua output:
$ protoc -I/path/to/your/proto/files --json_out=/output/path file1.proto file2.proto

You simply need to add --json_out to the arguments to protoc to get it to produce the Json output files.
Under the hood, protoc is looking for the program protoc-gen-json somewhere in your PATH.YoucanmodifyPATH in lieux of installing the package, if you desire.
Compiling Produced Files
You should be able to compile the produced .h and .cc files like you would for protocol buffer output files. If you have an existing Makefile, project, etc, just add the produced .h and .cc files to it.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.