Dan
unread,May 30, 2012, 4:16:27 PM5/30/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to prot...@googlegroups.com
Hi,
In the code below, I've found that the returned Descriptor* is NULL after I call FindMessageTypeByName(), unless I first call FindFileByName() on the .proto which contains the Message I am looking for.
Is this a bug? Is there another way to do this? I would really like to be able to setup a SourceTreeDescriptorDatabase to a directory that contains all of the .proto files I plan to use and not have to search for each file individually.
Any advice is much appreciated.
thanks,
Dan
string sProtoRoot("/home/dan/tests/new-protobuf/protos");
DiskSourceTree dst;
dst.MapPath("", sProtoRoot);
SourceTreeDescriptorDatabase stdb(&dst);
DescriptorPool dp(&stdb);
const FileDescriptor* pfd = dp.FindFileByName("TestMessage.proto");
const Descriptor* pd = dp.FindMessageTypeByName("Test.TestMessage");