Re: [protobuf] how to know whether field has options while converting proto to other language

2019-12-06 Thread LakshmiKanth Gupta
Finally I have figured out whether a field has options or not. Unfortunately every field in message is associated with FieldOptions. By default, each field has DefaultOptions .So I could make pointer comparision and say whether a field has Custom field options or not. Final question remains:

Re: [protobuf] how to know whether field has options while converting proto to other language

2019-12-06 Thread 'Adam Cozzette' via Protocol Buffers
FieldOptions is just a proto message defined in descriptor.proto: https://github.com/protocolbuffers/protobuf/blob/2220670ed97fb5d52868a0316054748e6354b6aa/src/google/protobuf/descriptor.proto#L509 On Fri, Dec 6, 2019 at 5:33 AM LakshmiKanth Gupta wrote: > Finally I have figured out whether a

Re: [protobuf] how to know whether field has options while converting proto to other language

2019-12-06 Thread Nadav Samet
KakshmiKanth, in addition, please take a look at HasExtension and GetExtension: https://developers.google.com/protocol-buffers/docs/reference/cpp-generated#extension to get your extension field from FieldOptions. On Fri, Dec 6, 2019 at 10:26 AM 'Adam Cozzette' via Protocol Buffers <