[protobuf] Re: Issue 515 in protobuf: More intelligent enums

2014-01-31 Thread protobuf


Comment #7 on issue 515 by peterhan...@yahoo.com: More intelligent enums
http://code.google.com/p/protobuf/issues/detail?id=515


The proposed solution doesn't work because:
1. The name of the enum type is changed from Foo to Foo::Enum which  
will be confusing to the users.


The proposal text says the new option is  .. well, optional. So if you  
don't specify it protobuf compiler will (regardless of target language)  
generate exactly same code as today. How can that be confusing ? .. except  
for those who explicitly put in the new proposed option in the .proto  
file .. but then those people have made a conscious choice to use the new  
proposed feature.


2. For enums nested in a message you simply can't nest a namespace in a  
class.


Not sure I understand.

In any case, if you really believe so,  we could say in the documentation  
that the proposed new option has no effect for C++ and make sure that's  
what is happening. This would still bring great benefits to anyone else  
(most languages has the notion of namespace for enums) just not to C++  
users.


There are already options in .proto files that only benefit some languages  
but not others so going down that route is not something new. It all  
depends if the design idea of protobuf is to be bound by the lowest common  
denominator, in this case C++ ? I certainly understand and appreciate the  
desire to keep protobuf design lean and mean so I would sympathize  
(somewhat reluctantly :-)) with such a conscious choice.


the value of allowing duplicated enum value names is also very limited.  
It doesn't seem to be a worthwhile effort to me.


What?  Perhaps we're just different but we run into these issues all the  
time in particular with enum values such  
as YES, NO, NONE, UNDEFINED, words that are likely to be used in  
different enums. Yes, there are ways around it .. but they just make  
protobuf code harder to read and make your setup more convoluted than what  
it needs to. And I love protobuf for the exact opposite reasons.


Cheers.



--
You received this message because this project is configured to send all  
issue notifications to this address.

You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
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 this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/groups/opt_out.


[protobuf] Re: Decoding protobuf buffer

2014-01-31 Thread adeel yousaf


 how u have decodeed first mesage?

neded help
 

-- 
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 this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/groups/opt_out.


[protobuf] Error while trying to compile one of Chrome's proto files

2014-01-31 Thread Ik Si
Hi,

I'm trying to compile one of Chrome's proto files:
https://chromium.googlesource.com/experimental/chromium/src/+/master/sync/protocol/sync_enums.proto
using exe from protoc-2.5.0-win32.zip
and I get the following error:

sync_enums.proto:13:8: Option retain_unknown_fields unknown

Anybody knows what this option is meant to do, and how can I compile this 
file ?
Or what will be the implications of removing it ?
Thanks for any help.

Ik.


-- 
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 this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [protobuf] Error while trying to compile one of Chrome's proto files

2014-01-31 Thread Feng Xiao
On Thu, Jan 30, 2014 at 6:56 AM, Ik Si user42...@gmail.com wrote:

 Hi,

 I'm trying to compile one of Chrome's proto files:

 https://chromium.googlesource.com/experimental/chromium/src/+/master/sync/protocol/sync_enums.proto
 using exe from protoc-2.5.0-win32.zip
 and I get the following error:

 sync_enums.proto:13:8: Option retain_unknown_fields unknown

 Anybody knows what this option is meant to do, and how can I compile this
 file ?
 Or what will be the implications of removing it ?

It seems Chrome has branched protobuf code and added some chrome only
features.


 Thanks for any help.

 Ik.


  --
 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 this group at http://groups.google.com/group/protobuf.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/groups/opt_out.