How to visualize data from google protocol buffer?

前端 未结 8 1876
时光说笑
时光说笑 2021-02-04 02:38

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

相关标签:
8条回答
  • 2021-02-04 02:46

    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.

    0 讨论(0)
  • 2021-02-04 02:46

    To resolve binary representation without schema is hard. But if you'd like just to have a better view of pb's text format or DebugString(), you can try the Protobuf Visualizer:

    http://codingstory.com/pv

    0 讨论(0)
  • 2021-02-04 02:52

    One option is Protocol Buffer Workbench. A nice feature with this tool is that you can use it to easily convert JSON to an encoded protocol buffer and vice versa.

    0 讨论(0)
  • 2021-02-04 02:54

    Hope this app can help you [Only for macOS]

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

    0 讨论(0)
  • 2021-02-04 02:56

    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

    0 讨论(0)
  • 2021-02-04 02:57

    If you want you can use web ui to compose a protobuf message

    https://github.com/Groterik/protobuf-webui

    It is python project and it has a sample that executes http server composing desired message type of imported protobuf module. But it is python, so you can write simple workaround that imports compiled protobuf module dynamically and chooses message type in runtime.

    You can overload postprocessing method so it would do some useful work with message (store to file, send by network, etc)

    0 讨论(0)
提交回复
热议问题