How to visualize data from google protocol buffer?

31,955

Solution 1

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

Solution 2

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/

Solution 3

Hope this app can help you [Only for macOS]

https://apps.apple.com/ca/app/protobuf-viewer/id1165908879?mt=12

enter image description here

Solution 4

If you want to write it yourself, one option could be to use Python/PySide together with QML, process your data and store it in a QAbstractListModel which is connected to your QML ListView. Depending on the complexity of your data, the list view delegate should hopefully be able to visualize it.

This question might be useful in that case: How to provide data from PySide QAbstractItemModel subclass to QML ListView?

If XML is an option, the QML XmlListModel is very neat and easy to use.

Solution 5

I was working on such a solution last year using Qt. Unfortunately, the application is not yet complete, but I think I was at the point where one could more or less successfully visualize data from a generic protocol buffer stream. You can check out the code at

https://github.com/oneamtu/QProtoViewer

Again this is not a out-of-the-box solution, and you'll have to work to make it fit your own needs/project. I'd be more than happy to help if you choose to do so.

Share:
31,955

Related videos on Youtube

hrr
Author by

hrr

Updated on May 17, 2020

Comments

  • hrr
    hrr about 4 years

    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?

  • Neil G
    Neil G about 13 years
    I was just going to suggest this. Either PySide or PyQt would work. Not sure if there's any reason to prefer one or the other.
  • hrr
    hrr about 13 years
    Thanks for pointing out to the relevant Qt classes! The detour via python does not seem necessary, I might just use them from C++, no?
  • fejd
    fejd about 13 years
    Yes, you could just as well use C++ for it and it's probably the better alternative as even though PySide is pretty mature, you might still run into the odd issue.
  • watbywbarif
    watbywbarif over 7 years
    You may need to add protoc.exe to your path if you only have .proto file.
  • TonySalimi
    TonySalimi about 6 years
    What is the name of this app? Is it still available in iTunes?
  • Danyun Liu
    Danyun Liu about 6 years
    @hsalimi hey, you can search mac App Store with "protobuf viewer'
  • Dario
    Dario about 4 years
    Nice! this app just saved me hours of work, thanks! Updated link: apps.apple.com/ca/app/protobuf-viewer/id1165908879?mt=12