Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to visualize data from google protocol buffer?

Tags:

I would like to store data using google protocol buffers (another serialized format would work, too), and then have an UI to browse that data. Is there a C++ framework/API that would allow me to do this?

For example, it could use the reflection interface of protobuf, and then fill in the data into Qt's QTableView (or from another toolkit). I could write such code myself -- however, much rather I would re-use existing code, which is why I am asking for advice here!

Or are there more general UI toolkits that can visualize data which is accessible via some reflection API?

like image 578
hrr Avatar asked May 17 '11 14:05

hrr


People also ask

How do Google protocol buffers work?

Protocol buffers provide a language-neutral, platform-neutral, extensible mechanism for serializing structured data in a forward-compatible and backward-compatible way. It's like JSON, except it's smaller and faster, and it generates native language bindings.

How do I open a protobuf file?

If you cannot open your PROTO file correctly, try to right-click or long-press the file. Then click "Open with" and choose an application. You can also display a PROTO file directly in the browser: Just drag the file onto this browser window and drop it.

Does Google use protobuf?

Protocol buffers, or Protobuf, is a binary format created by Google to serialize data between different services. Google made this protocol open source and now it provides support, out of the box, to the most common languages, like JavaScript, Java, C#, Ruby and others.

Does protobuf support map?

According to Google protobuf doc, proto 2 does support map type https://developers.google.com/protocol-buffers/docs/proto#maps . As I quote, Maps cannot be repeated, optional, or required.


2 Answers

One GUI I just came across is protobufeditor -- it seems pretty powerful for browsing generic data. It is written in Java, so one cannot easily use/extend it from C++. (And it is not particularly polished at this point, e.g., one needs to maximize the main window to get a semi-useful layout of the sub-windows.) So this is a rather temporary solution.

Screenshot protobufeditor

like image 66
hrr Avatar answered Oct 20 '22 01:10

hrr


Wireshark has a protobuf plugin that lets you visualize the contents of protobuf messages. I'd also dig in to the DebugString() in google/protobuf/message.h or message_lite.h (I forget which off the top of my head) and see if you can easily dress that up for presentation to a user.

http://code.google.com/p/protobuf-wireshark/

like image 38
Sean Avatar answered Oct 20 '22 00:10

Sean