With google::protobuf::compiler::Importer class you can parse the proto file at run time and get the filedescriptors.
You can even encode/decode proto messages at runtime without compiling .proto files. https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.compiler.importer#Importer https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.descriptor#FileDescriptor On Tuesday, June 11, 2019 at 4:43:49 PM UTC+3, Brett Smith wrote: > > Hello all, I'm brand new to protobufs and I've been following the > AddressBook example given by Google ( > https://developers.google.com/protocol-buffers/docs/cpptutorial). I've > been able to read and write protobufs but I've been wondering if it is > possible to parse a proto file without compiling it beforehand and if you > are still able to access the elements of that file. If it is possible, > would someone be able to give me some assistance on how to do this? I have > attached the proto file that I have been working with for reference. > -- 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 https://groups.google.com/group/protobuf. To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/6d6c4ff5-0f99-404f-a1d4-617e7a03c2d3%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
