[protobuf] should i commit *.pb.cc and *.pb.h to my source code repository?

2017-06-05 Thread Koo Yak
Hi, I'm a little confused. Should I commit *.pb.cc and *.pb.h files to my source code repository, or generate them just before compile? Which is the best practice? -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from

Re: [protobuf] Failed to parse map

2017-06-05 Thread Qian Zhang
Thanks Adam. Can you please let me know which API I can use to do reflection on a map? Regards, Qian Zhang On Mon, Jun 5, 2017 at 11:42 PM, Adam Cozzette wrote: > Doing reflection on a map is a little bit tricky, but the way to do it is > to treat it as a repeated field

Re: [protobuf] Replacing 'extensions' in proto3

2017-06-05 Thread Josh Humphries
On Mon, Jun 5, 2017 at 4:48 PM, R.C. wrote: > Hi Bo, > > Thanks for your response. Would using 'Any' in this fashion change the > format on the wire? How can I edit the proto file to maintain the format on > the wire (maintaining backward compatibility with older message

Re: [protobuf] Replacing 'extensions' in proto3

2017-06-05 Thread R.C.
Hi Bo, Thanks for your response. Would using 'Any' in this fashion change the format on the wire? How can I edit the proto file to maintain the format on the wire (maintaining backward compatibility with older message decoders)? Thanks, rc On Monday, June 5, 2017 at 1:21:03 PM UTC-7, Bo Yang

Re: [protobuf] protobuf_c_message_unpack() returns null.

2017-06-05 Thread 'Bo Yang' via Protocol Buffers
I am not aware of that we have protobuf_c_message_unpack. Are you using our implementation? On Sat, Jun 3, 2017 at 5:17 AM shant wrote: > Hi, > > protobuf_c_message_unpack() returns NULL. Is there a way to know why it > has failed. > There doesn't seem to be any issue

Re: [protobuf] Replacing 'extensions' in proto3

2017-06-05 Thread 'Bo Yang' via Protocol Buffers
message Vehicles { Any extending = 1; } // cpp code == Car car = new Car(); UnpackAny(vehicles.extending, ); On Mon, Jun 5, 2017 at 11:48 AM R.C. wrote: > Hi, > > I am looking to move an application written with proto2 to use proto3. I > understand

[protobuf] Replacing 'extensions' in proto3

2017-06-05 Thread R.C.
Hi, I am looking to move an application written with proto2 to use proto3. I understand 'extensions' is disabled in proto3 and am looking for some guidance to change the below to proto3: common.proto: message Vehicles { extensions 1 to max }

Re: [protobuf] Failed to parse map

2017-06-05 Thread 'Adam Cozzette' via Protocol Buffers
Doing reflection on a map is a little bit tricky, but the way to do it is to treat it as a repeated field since that is how it is actually represented on the wire. A map is a stored as a repeated message field, where in each message the key is field 1 and the value is field 2. On Mon, Jun 5, 2017

Re: [protobuf] Failed to parse map

2017-06-05 Thread Qian Zhang
Hi Adam, We are using picojson to parse the JSON file. After more debugging, I think I have found the root cause: In the code here , we are trying to find a field by