Yes.I am developing protoc plugin using c++.But I didn't find any function 
to do that. Could somebody help me with that. Also couldn't find the 
information of the options.

I am using following code:

FieldOptions l_options= m_record->field(i)->options();

>From here I couldn't figure out how I can look at these options.




On Thursday, December 5, 2019 at 11:43:37 PM UTC+1, Adam Cozzette wrote:
>
> I assume your converter is set up as a protoc plugin? In that case you can 
> examine the descriptor for each field to see if it has a custom option 
> defined or not. The details depend on the language you are using, though.
>
> On Thu, Dec 5, 2019 at 12:26 PM LakshmiKanth Gupta <[email protected] 
> <javascript:>> wrote:
>
>> Hi,
>>
>> Currently I am writing a convertor from proto format to ttcn3 format.
>>
>> Messages which I have defined has some custom Field options. How can I 
>> check whether a field has custom options or not.
>>
>>
>> syntax="proto3";
>> import "google/protobuf/descriptor.proto"
>> extend google.protobuf.FieldOptions{
>>    bool presence=50001;
>> }
>>
>> message Mymessage
>> {
>>     int32 foo=1[(presence)=true];
>>     string bar=2;
>> }
>>
>> This is my file. I would like to know when my convertor is invoked using 
>> protoc whether a field has options defined or not.
>>
>> Thanks in advance,
>>
>> with best regards,
>>   Gupta
>>
>> -- 
>> 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 [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/protobuf/87e492fa-3535-4ee3-b391-f1bb6362f9ad%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/protobuf/87e492fa-3535-4ee3-b391-f1bb6362f9ad%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/d2f6e289-8b16-4374-af70-3f62d0c93c2b%40googlegroups.com.

Reply via email to