Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I format a Google Protocol Buffers object in XML and parse from XML

I'm going to pass GPB objects over the wire but in the local application I need to save them locally in XML (customer demands XML, no editing tool, don't ask me why) so the customer can edit the XML (which brings me to the other part of my question - parsing GPB from XML). Is anyone aware of a framework which does this? I need this code in C++ on Windows.

like image 998
Guy Aloni Avatar asked Nov 05 '22 07:11

Guy Aloni


1 Answers

There is no C++ implementaion for this as far as I am aware. You can port this code from Java http://code.google.com/p/protostuff/ if you want we can port it togeather I also need the same as you!

One of the problems is that pb are not self describing so you need to whole the schema outside which is not ideal.

The documentaion on reflections which onbody uses inside of Google is a little confusing for me. http://code.google.com/apis/protocolbuffers/docs/reference/cpp/google.protobuf.message.html#Message.

Also see here Show all elements in a protocol buffer message

like image 192
Damian Avatar answered Nov 07 '22 20:11

Damian