I'm trying to do some work using dynamic message, working from a
FileDescriptorSet produced by protoc. The heuristic I've come up with is
something like:
Parse the binary in to a FileDescriptorSet
for each FileDescriptorProto in the set
    create the FileDescriptor from the FileDescriptorProto
    invoke FindMessageTypeByName on the FileDescriptor
    if I got a non-null answer, break from the loop
If I have no Descriptor ant this point, FAIL
Create a DynamicMessageFactory.
Get a Message by invoking GetPrototype on the message factory, while passing
the Descriptor

YEAH! We can now use the Message to parse new messages.

This seems fairly involved. Am I doing the right thing or is there an easier
way to do it? If not, does it make sense to maybe add methods to
FileDescriptorSet to simplify this (something like:
FileDescriptorSet.GetMessageByTypeName(String,DynamicMessageFactory))?

-- 
Chris

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to