On Wed, Sep 10, 2014 at 10:23 PM, Jan Kyjovský <[email protected]> wrote:
> Hi, >> > > Thank you that was one thing I tried but was not successful up until now. > Also one more issue was that i had to ask for type by full name. It took me > some time to figure it our. > > Now I got different sort of questions. Since I can now progress further I > am finding new "problems". As you suggested i will be using ParseFromString > method. Although I am not entirely sure what this string is. Is it > represented by hexdump or is it some other format? > ParseFromString() accepts protobuf wire-format data (which is the output of protobuf serialization routines). > > I am also wondering about imports. If one proto file imports other do I > have to take that consideration and manually handle that file as well or is > it done automatically while processing file I have provided? In my > implementation all proto files are in one folder with possible imports > between each other. > You can use the DescriptorDatabase implementation we use for protocol compiler: https://github.com/google/protobuf/blob/master/src/google/protobuf/compiler/importer.h#L76 Basically rather than adding individual files to the pool, you provide a DescriptorDatabase to the pool and the pool will use this DescriptorDatabase to get the FileDescriptorProtos it needs. One culprit of this approach is that, you need to call DescriptorPool::FindFileByName() on the .proto files before you can use DescriptorPool::FindMessageTypeByName() to search for types. > > Thank you in advance for your response. > > > -- > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/protobuf. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.
