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 <klkvgu...@gmail.com>
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 protobuf+unsubscr...@googlegroups.com.
> 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 protobuf+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/CADqAXr4w3rOHHUJ2zhS-MyrjD4cFj%2BeqFrjEz-xtRF0mw0JiGw%40mail.gmail.com.

Reply via email to