[protobuf] Re: Variable-Width Integer Encoding

2018-01-05 Thread 'Josh Haberman' via Protocol Buffers
I believe the encoding you mentioned here is the same as PrefixVarint. See some more info here when WebAssembly was evaluating which varint scheme to use: https://github.com/WebAssembly/design/issues/601 Our existing varint encoding wins on simplicity, and WebAssembly chose it even though they

[protobuf] Re: Arranging protobuf files

2018-01-05 Thread 'Josh Haberman' via Protocol Buffers
I think it is totally up to you, and how you want your builds to work. The only thing I would advise is: make the file path of each .proto file consistent. If you import a file once as "foo/bar/baz.proto", always refer to it as "foo/bar/baz.proto". Don't try to sometimes import it as "bar/baz.p

[protobuf] Re: How can i copy pointer to each message??

2018-01-05 Thread 'Josh Haberman' via Protocol Buffers
On Thursday, January 4, 2018 at 4:14:31 AM UTC-8, 기준 wrote: > > I'm testing protocol buffers, but encountered segment fault that i can't > understand. > > My protocol buffer is below > > ``` > message Sub { > string value = 1; > } > > message Wrapping { > int32 key = 1; > repeated Sub sub =

[protobuf] Re: Does protobuf support : ParseFromArray without typeName ??

2018-01-05 Thread 'Josh Haberman' via Protocol Buffers
In your C struct example, you know the type "T" that has "int v" as a member. If you know that, you can do the same thing with protobuf: // foo.proto message T { optional int32 v = 1; } // main.cc T a; a.set_v(5); a.SerializeToString(&str); T b; b.ParseFromString(str); On Thursday, Januar

Re: [protobuf] Compile protobuf to use Java primitive classes instead of well-known types

2018-01-05 Thread Renatas M
Hi Josh, thank you a lot for informative answer. 2018 m. sausis 4 d., ketvirtadienis 15:34:37 UTC, Josh Humphries rašė: > > What you're asking for is not currently do-able. There is an existing > request to add this functionality though: > https://github.com/google/protobuf/issues/2055 > > In