Re: [protobuf] Re: Will ByteSize() return a fixed size for fixed object bype if I upgrade Google Protocol Buffer?

2016-09-27 Thread job4charlie
thanks a lot! that's exactly the thing(delimited serialization) I have been looking for, though not supported by build-in fun in c++, which is great! all the best, Charlie 发自我的小米手机在 Adam Cozzette ,2016年9月27日 上午11:39写道:I see, if you're just writing length delimiters then

[protobuf] Re: How to describe in the proto file a json format with a double array?

2016-09-27 Thread Kostiantyn Shchepanovskyi
There is no way to workaround this. "key3" looks like a two-dimensional string array - it is not supported by protobuf. On Monday, September 26, 2016 at 8:56:12 PM UTC+3, Michael Leonard wrote: > > Hi > > I'm developing a golang server that will receive json in the following > format. I can't

Re: [protobuf] Re: How to describe in the proto file a json format with a double array?

2016-09-27 Thread 'Feng Xiao' via Protocol Buffers
There is actually a new proto type designed to parse/represent arbitrary JSON data: https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto#L63 So you can define your proto as: message MyObject { string key1 = 1; int32 key2 = 2; google.protobuf.ListValue key3

[protobuf] encoding rule about field_number

2016-09-27 Thread yanxi9928
where can i see about encoding rule about field_number, in https://developers.google.com/protocol-buffers/docs/encoding is too simple fixed64 a = 16 varint b = 30 81 01 00 00 00 00 00 00 F0 BF F0 01 00 81 01 -> 1000 0001 0001 -> 000 0001 000 0 -> 16 F0 01 -> 0001 0001 -> 111

Re: [protobuf] encoding rule about field_number

2016-09-27 Thread 'Adam Cozzette' via Protocol Buffers
Just to make this more concrete let's assume we're working with a message like this: syntax = "proto2"; message MyMessage { optional fixed64 a = 16; optional int32 b = 30; }; I think the problem is that varints are encoded with the least-significant 7-bit groups first, and you got the order