Re: [protobuf] generic message editor? parse .proto files?

2009-12-01 Thread Kenton Varda
using google::protobuf; class MyErrorCollector : public protobuf::compiler::MultiFileErrorCollector { // Implementation of MultiFileErrorCollector interface. // Should probably just print errors to stderr. }; // Set up the importer. protobuf::compiler::DiskSourceTree source_tree; source_tree.

Re: [protobuf] generic message editor? parse .proto files?

2009-12-01 Thread David McClurg
Thanks! Any chance for a C++ code snippet? Even an un-tested one would get me going in the right direction. On Tue, Dec 1, 2009 at 1:34 PM, Kenton Varda wrote: > To parse protos at runtime you will either need to use C++, or you will > need to invoke protoc as a subprocess and have it output a

Re: [protobuf] generic message editor? parse .proto files?

2009-12-01 Thread Kenton Varda
To parse protos at runtime you will either need to use C++, or you will need to invoke protoc as a subprocess and have it output a FileDecsriptorSet which you can use in Java or other languages. I'll assume C++. Be sure to get familiar with the API documentation here: http://code.google.com/apis

Re: [protobuf] generic message editor? parse .proto files?

2009-12-01 Thread David McClurg
That's true. Adding a new type is like adding a new game feature. Requiring a tool update for content people (non-programmers) might be acceptable. I just thought that with reflection and the compiler parser, it would be a snap. Thanks, David On Tue, Dec 1, 2009 at 12:13 PM, Peter Keen wrote:

Re: [protobuf] generic message editor? parse .proto files?

2009-12-01 Thread Peter Keen
Oh, that was just curiosity by the way. The real answer (in c++) is to look at DescriptorPool, DescriptorDatabase, and DynamicMessage. I started going down this path yesterday but it was taking too long to figure out how it all goes together so I just wrote a quick and dirty tool and compiled the m

Re: [protobuf] generic message editor? parse .proto files?

2009-12-01 Thread Peter Keen
Is there a reason why you can't compile the message types into the message editor? It seems like they're pretty intimately tied together as it is. --Pete On Tue, Dec 1, 2009 at 10:27 AM, David McClurg wrote: > I'm trying to rebuild a message editor for a game engine using > protocol buffers.  Cu

[protobuf] generic message editor? parse .proto files?

2009-12-01 Thread David McClurg
I'm trying to rebuild a message editor for a game engine using protocol buffers. Currently we are using an XML template to describe the message type and XML to store the message. I like the protocol buffer language ( .proto files ) as well as the memory and performance advantages over XML. The t