[protobuf] protobuf maximum value for float, double, int

2017-03-20 Thread lucidbee
hello!! What are the maximums ( and minimums) for numeric values that protobuf supports? If so, is there an api to retrieve those limits? I am thinking of something like std::numeric_limits() in c++ standard library. Thanks. lucidbee -- You received this message because you are subscribed

[protobuf] Re: How Do I Build Just the C++ Libraries?

2017-03-20 Thread Doug Lewis
Thanks for the suggestion Josh! I tried executing the make in the src directory and it completes successfully but I'm not sure I trust the .la files it created, they are only 923 bytes in size. Regards, Doug On Friday, March 17, 2017 at 7:18:47 PM UTC-5, Josh Haberman wrote: > > Try: > > $ cd

Re: [protobuf] Error/problem using constants! ("Expected top-level statement (e.g. "message")")

2017-03-20 Thread 'Adam Cozzette' via Protocol Buffers
The compiler doesn't support that syntax (DataType = DataOther | DataTest). Maybe a oneof field is what you are looking for; that would look something like this: message DataType { oneof data_type { DataOther data_other = 1; DataTest data_test = 2; } } On Mon, Mar 20, 2017 at 10:08

[protobuf] Error/problem using constants! ("Expected top-level statement (e.g. "message")")

2017-03-20 Thread Leonardo Toledo
Hi! I am writing my "file.proto" and when i write a constant the compiler give an error called "Expected top-level statement (e.g. "message")" and i do not know why! In my "file.proto" i have the follow: "message Test{ string str1 = 1; DataType data = 2; } DataType = DataOther | DataTest;"

Re: [protobuf] Re: why protobuf optional field does not take null

2017-03-20 Thread Josh Humphries
In a past life, we used a protoc plugin that just added these setOrClear* to every builder for each non-repeated field (as well as getOrNull* methods for every message). The standard generated java code has insertion points that make this a fairly trivial plugin to write. We also experimented with

Re: [protobuf] Re: why protobuf optional field does not take null

2017-03-20 Thread Subin Sebastian
8 years later, still the only solution I have is, *class MyImprovedClass extends MyClass { // MyClass is protoc generated* *public void setOrClearFoo(String value) {* *if(value != null) setFoo(value);* *else clearFoo();* *}* *}* On Tuesday, December 1, 2009 at 7:04:26 AM