Re: [protobuf] Dynamic/run-time decoding

2016-05-18 Thread osuciu
At least in Java, you can do everything fully dynamically at runtime. The native API can get quite confusing (between all the protos/descriptors/files...). I distilled following wrapper to make it easier: https://github.com/os72/protobuf-dynamic On Friday, April 1, 2016 at 4:32:29 PM UTC-7,

Re: [protobuf] Dynamic/run-time decoding

2016-04-01 Thread 'Josh Haberman' via Protocol Buffers
Hi Mike, Python indeed has descriptor classes that you can use to build proto definitions at runtime. However it does not have a parser for .proto files built in. So if you want to load .proto files at runtime, you'll need to use protoc to build a descriptor (for example, you could shell out

Re: [protobuf] Dynamic/run-time decoding

2016-03-21 Thread Mike Trienis
Hi, Do you know if it's possible do dynamic decoding at run-time using the Python API? - https://developers.google.com/protocol-buffers/docs/reference/python/ Indeed there is a descriptor.FileDescriptor, however I'm not sure what the other classes correspond to? Thanks, Mike. On

Re: [protobuf] Dynamic/run-time decoding

2015-07-20 Thread Jan Kyjovský
Hello, have you any luck finding where there may be problem? On Monday, 15 June 2015 08:27:30 UTC+2, Jan Kyjovský wrote: It has grown a bit since I started so I will attach zipped whole project. On Friday, 12 June 2015 08:47:59 UTC+2, 肖锋 wrote: On Wednesday, June 10, 2015 at 9:49:03 PM

Re: [protobuf] Dynamic/run-time decoding

2015-06-12 Thread 肖锋
On Wednesday, June 10, 2015 at 9:49:03 PM UTC-7, Jan Kyjovský wrote: I did as you told me. And tried to compile my proto files with protoc. Well it eat them up without any problem so I guess that clear that there is no problem with them but in that case why is it causing such error to me.

Re: [protobuf] Dynamic/run-time decoding

2015-06-10 Thread Jan Kyjovský
I did as you told me. And tried to compile my proto files with protoc. Well it eat them up without any problem so I guess that clear that there is no problem with them but in that case why is it causing such error to me. As I gave some hint before problem is happening when I am trying to do

Re: [protobuf] Dynamic/run-time decoding

2015-06-09 Thread 'Feng Xiao' via Protocol Buffers
On Mon, Jun 8, 2015 at 10:23 PM, Jan Kyjovský jan.kyjov...@tieto.com wrote: I have remade code so I now add into descriptor database all protofiles specified by directory. There is but little problem with error handling. From nature how I am handling errors it seems that message is possible to

Re: [protobuf] Dynamic/run-time decoding

2015-06-08 Thread Jan Kyjovský
I have remade code so I now add into descriptor database all protofiles specified by directory. There is but little problem with error handling. From nature how I am handling errors it seems that message is possible to decode but there is one error in error collector which is bothering me:

Re: [protobuf] Dynamic/run-time decoding

2015-06-03 Thread Jan Kyjovský
HI, I somehow understand what you mean but still I lack in experience with it. I tried to switch to descriptor database but still I got some problems. C_ProtoDecoder::C_ProtoDecoder(std::string strFile) { m_strProtoFile = strFile; // Build the descriptor pool m_bConstructed =

Re: [protobuf] Dynamic/run-time decoding

2015-06-03 Thread 'Feng Xiao' via Protocol Buffers
On Wed, Jun 3, 2015 at 12:40 AM, Jan Kyjovský jan.kyjov...@tieto.com wrote: HI, I somehow understand what you mean but still I lack in experience with it. I tried to switch to descriptor database but still I got some problems. C_ProtoDecoder::C_ProtoDecoder(std::string strFile) {

Re: [protobuf] Dynamic/run-time decoding

2015-06-02 Thread 'Feng Xiao' via Protocol Buffers
On Mon, Jun 1, 2015 at 9:55 PM, Jan Kyjovský jan.kyjov...@tieto.com wrote: Hi again, As I have stated before I am done with decoding, but now I am solving different type of problem. As I have mentioned before imports may prove problematic to our implementation. Let me describe use-case how

Re: [protobuf] Dynamic/run-time decoding

2015-06-01 Thread Jan Kyjovský
Hi again, As I have stated before I am done with decoding, but now I am solving different type of problem. As I have mentioned before imports may prove problematic to our implementation. Let me describe use-case how it will be used. There will be configuration stating for which data (message

Re: [protobuf] Dynamic/run-time decoding

2015-05-28 Thread 'Feng Xiao' via Protocol Buffers
On Thu, May 28, 2015 at 12:02 AM, Jan Kyjovský jan.kyjov...@tieto.com wrote: Hi, yes thank you for that hint. I was able to get enough references to go through decoded data. I am more or less efficiently able to get values (in case of ENUM also original value not only symbolic meaning) but

Re: [protobuf] Dynamic/run-time decoding

2015-05-28 Thread Jan Kyjovský
Never mind then. We can provide results in two formats. Offsets and sizes are requirement of one of these and after giving it some thought I get the feeling that it would be better to use d second format (formatted text), also it would require much less work. Thank you very much four your

Re: [protobuf] Dynamic/run-time decoding

2015-05-28 Thread Jan Kyjovský
Hi, yes thank you for that hint. I was able to get enough references to go through decoded data. I am more or less efficiently able to get values (in case of ENUM also original value not only symbolic meaning) but now I would require some auxiliary information which I am not sure are contained

Re: [protobuf] Dynamic/run-time decoding

2015-05-07 Thread Jan Kyjovský
Hi, sorry for asking for advice so soon again. I have progressed a bit futher and I am now trying to display decoded data. For that purpose I have prepared some data and tried to decode them but I have encountered problem with repeated structures and with nested messages. I dont know how to

Re: [protobuf] Dynamic/run-time decoding

2015-05-07 Thread 'Feng Xiao' via Protocol Buffers
On Thu, May 7, 2015 at 2:29 AM, Jan Kyjovský jan.kyjov...@tieto.com wrote: Hi, sorry for asking for advice so soon again. I have progressed a bit futher and I am now trying to display decoded data. For that purpose I have prepared some data and tried to decode them but I have encountered

Re: [protobuf] Dynamic/run-time decoding

2015-05-06 Thread Jan Kyjovský
Hi, This is most likely last post. After converting these example data to binary and making sure that that parsing was successful (return true), I am finally getting decoded data. From this point on I can finish what was requested. Once again thank you for all your advices and patience. On

Re: [protobuf] Dynamic/run-time decoding

2015-05-05 Thread Jan Kyjovský
Hi, so we are somehow back in game. And now I am getting familiar what I have done more then half a year ago. So for now I got some basic structure of code that will later be as a starting point for real implementation. I am trying to do some simple experiments to see how it works. Though I

Re: [protobuf] Dynamic/run-time decoding

2015-05-05 Thread 'Feng Xiao' via Protocol Buffers
On Mon, May 4, 2015 at 11:36 PM, Jan Kyjovský jan.kyjov...@tieto.com wrote: Hi, so we are somehow back in game. And now I am getting familiar what I have done more then half a year ago. So for now I got some basic structure of code that will later be as a starting point for real

Re: [protobuf] Dynamic/run-time decoding

2014-10-15 Thread Jan Kyjovský
Hi, due to organization changes and budget costs this task is put on hold. Thank you for all your guidance up until now. If any further help is needed regarding this issue in the future me or someone else will continue with this thread. On Thursday, 11 September 2014 20:00:52 UTC+2, Feng Xiao

Re: [protobuf] Dynamic/run-time decoding

2014-10-15 Thread Jan Kyjovský
Hi, due to organization changes and budget cuts this task is put on hold. Thank you for all your guidance up until now. If any further help is needed regarding this issue in the future me or someone else will continue with this thread. On Thursday, 11 September 2014 20:00:52 UTC+2, Feng Xiao

Re: [protobuf] Dynamic/run-time decoding

2014-09-11 Thread 'Feng Xiao' via Protocol Buffers
On Wed, Sep 10, 2014 at 10:23 PM, Jan Kyjovský jan.kyjov...@tieto.com 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

Re: [protobuf] Dynamic/run-time decoding

2014-09-10 Thread Jan Kyjovský
Variable proto contains some information about structure although proto.name is blank (don't know why). BuildFile returns NULL as well as FindMessageTypeByName. Whey I went deeper in debugging I noticed that BuildFile is trying to look up for that file I provide in its tables but these are

Re: [protobuf] Dynamic/run-time decoding

2014-09-10 Thread 'Feng Xiao' via Protocol Buffers
On Tue, Sep 9, 2014 at 11:03 PM, Jan Kyjovský jan.kyjov...@tieto.com wrote: Variable proto contains some information about structure although proto.name is blank (don't know why). You need to set the proto.name yourself:

Re: [protobuf] Dynamic/run-time decoding

2014-09-09 Thread 'Feng Xiao' via Protocol Buffers
On Mon, Sep 8, 2014 at 10:32 PM, Jan Kyjovský jan.kyjov...@tieto.com wrote: Hi, sorry for delay. I've been experimenting with that eve since I could return to this issue. Mostly about composition of project since whenever I try separate your sources from projects and use them individually

Re: [protobuf] Dynamic/run-time decoding

2014-09-08 Thread Jan Kyjovský
Hi, sorry for delay. I've been experimenting with that eve since I could return to this issue. Mostly about composition of project since whenever I try separate your sources from projects and use them individually I§ve been getting tons of errors (linking one included). In the end I get along

Re: [protobuf] Dynamic/run-time decoding

2014-08-12 Thread 'Feng Xiao' via Protocol Buffers
Protobuf supports creating message types dynamically at runtime and use them for parsing/serialization/etc. First you need to build up a DescriptorPool https://code.google.com/p/protobuf/source/browse/trunk/src/google/protobuf/descriptor.h#1141 that contains all types that you may want to use.

Re: [protobuf] Dynamic/run-time decoding

2014-08-12 Thread Jan Kyjovský
Thank you for advice. I'll try it as soon as I am done with other task currently at hand. On Tuesday, 12 August 2014 19:36:13 UTC+2, Feng Xiao wrote: Protobuf supports creating message types dynamically at runtime and use them for parsing/serialization/etc. First you need to build up a