I believe there's `msg->file()->options()->getExtensions(...)`

On Wednesday, September 14, 2022 at 2:09:16 PM UTC-7 [email protected] 
wrote:

> I know how to read an option within Message by using GetExtension on the 
> Message, but can I do that for a global option that is not encapsulated 
> within a message?
>
> So in C++, how would I read the "my_file_name" option from the proto below?
>
> extend google.protobuf.FileOptions {
>   string my_file_name = 1001;
> }
>
> extend google.protobuf.MessageOptions {
>   optional string my_option = 51234;
> }
>
> option (my_file_name) = "filename.txt";
>
> message MyMessage {
>   option (my_option) = "Hello world!";
> }
>
>

-- 
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/3d8c46e5-4a05-4dec-afdc-182d30f615acn%40googlegroups.com.

Reply via email to