Re: [protobuf] Re: Issue 269 in protobuf: Would like to have byte or int8 type for the message definition

2013-03-14 Thread Sumit Kumar
No you cant, on C++ bytes translates to string, wont allow for null. Regards, Sumit Kumar On 14 Mar, 2013, at 2:39 AM, Feng Xiao xiaof...@google.com wrote: You can just use bytes field. On Wed, Mar 13, 2013 at 5:38 AM, Giri Guntipalli giri.guntipa...@gmail.com wrote: we need similar

Re: [protobuf] Re: Issue 329 in protobuf: Add support for [deprecated = true] on all types of definitions

2013-03-14 Thread Sumit Kumar
Can we insert compiler warning for C++ builds as well in cases where deprecated field is used ? Regards, Sumit Kumar On 14 Mar, 2013, at 2:36 AM, proto...@googlecode.com wrote: Comment #3 on issue 329 by sergei.s...@gmail.com: Add support for [deprecated = true] on all types of

Re: [protobuf] Re: Issue 269 in protobuf: Would like to have byte or int8 type for the message definition

2013-03-14 Thread Sumit Kumar
Int32 and such will see endianness issues when exchanging messages in-between cross-endian platforms hence only byte type suffices. On how we achieve fixed length string support once byte type is supported - Just create a message with specific number of byte elements and can name it like

Re: [protobuf] Re: Issue 269 in protobuf: Would like to have byte or int8 type for the message definition

2013-03-14 Thread Ilia Mirkin
Really? AFAIK C++ strings handle null's just fine... they're pascal-style strings, not c-style strings. $ cat test.cc #include string #include iostream int main() { std::string a(a\0b, 3); std::cout a.size() std::endl; return 0; } $ g++ -o test test.cc $ ./test 3 Or are you saying that

Re: [protobuf] Re: Issue 269 in protobuf: Would like to have byte or int8 type for the message definition

2013-03-14 Thread Oliver Jowett
On Thu, Mar 14, 2013 at 2:37 AM, Sumit Kumar kumar.su...@hotmail.comwrote: No you cant, on C++ bytes translates to string, wont allow for null. std::string handles NULs just fine, and protobuf's use of it for bytes fields also works fine. (I have code that's been in production for a few years

[protobuf] Bytesize return wrong number - any one sow such phenomena?

2013-03-14 Thread Uri Rotshtain
-- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit

[protobuf] Re: Protocol buffer compatibility across library versions

2013-03-14 Thread Ernest Micklei
And what about a mixture: will (Java) classes generated by 2.4.1 work with the 2.5.0 library ? Op maandag 12 januari 2009 18:42:41 UTC+1 schreef Kenton Varda het volgende: Just to add an official response: Yes, they will be compatible. If they weren't, we would consider that a very serious

Re: [protobuf] Re: Protocol buffer compatibility across library versions

2013-03-14 Thread Feng Xiao
On Thu, Mar 14, 2013 at 1:42 AM, Ernest Micklei ernest.mick...@gmail.comwrote: And what about a mixture: will (Java) classes generated by 2.4.1 work with the 2.5.0 library ? No. Only serialized data is ensured to be wire-compatible across all protobuf versions, not the generated code. The

Re: [protobuf] Re: Protocol buffer compatibility across library versions

2013-03-14 Thread Ernest Micklei
Thank you for confirming this. ^ Ernest Op donderdag 14 maart 2013 21:35:00 UTC+1 schreef Feng Xiao het volgende: On Thu, Mar 14, 2013 at 1:42 AM, Ernest Micklei ernest@gmail.comjavascript: wrote: And what about a mixture: will (Java) classes generated by 2.4.1 work with the

[protobuf] Re: Question about set_allocated_foo/release_foo

2013-03-14 Thread Kevin Regan
Giving this a bump. This might also be considered a feature request (the ability to temporarily assign a string value to a protocol buffer during serialization, rather than copying it). --Kevin On Friday, March 8, 2013 1:49:29 PM UTC-8, Kevin Regan wrote: I often have situations like this:

Re: [protobuf] Re: Question about set_allocated_foo/release_foo

2013-03-14 Thread Feng Xiao
A better solution should be to refactor your code a little bit to pass in a mutable string object directly. You can expect protos to take movable objects in the future, but even when that happens you will still need to refactor your code. I don't think we will change protobuf to share references

Re: [protobuf] Re: Question about set_allocated_foo/release_foo

2013-03-14 Thread Kevin Regan
It is very common to have a const std::string argument. Indeed, just about any API that you would export to the end user would probably support taking aconst std::string key in this case. --Kevin On Thursday, March 14, 2013 6:31:54 PM UTC-7, Feng Xiao wrote: A better solution should be to