shramov / json2pb Goto Github PK
View Code? Open in Web Editor NEWPython/C++ implementation of JSON to/from Protobuf convertor
License: MIT License
Python/C++ implementation of JSON to/from Protobuf convertor
License: MIT License
static json_t * _field2json(const Message& msg, const FieldDescriptor *field, size_t index)
{
...
json_t *jf = 0;
json_autoptr jf_ptr(jf); // use json_autoptr, line 52
...
}
static json_t * _pb2json(const Message& msg)
{
json_t *jf = 0;
json_autoptr jf_ptr(jf); //the same bug, line 121
}
a float may come out looking like an int, which trips pb2json.cc parsing:
json2pb exception: y: Failed to unpack: Expected real, got integer
std::string pb2json(const Message &msg, const int indentation /* = 0 */)
{
...
json_dump_callback(root, json_dump_std_string, &r, JSON_INDENT(indentation));
}
In file test_json.cc, there is no file test.pb.h.
does this work on osx?
make
cc -Wl,-rpath -Wl,. -o libjson2pb.so json2pb.o -Wl,-soname=libjson2pb.so -Wl,-h -Wl,libjson2pb.so -shared -L. -lcurl -lprotobuf -lstdc++ -ljansson
ld: unknown option: -soname=libjson2pb.so
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libjson2pb.so] Error 1clang -v
Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.2
Thread model: posix
jansson 2.4 is installed here in my /usr/local area ... i do see the json2pb.o so that might just mean it's failing on the unix
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.