The custom options are in the EnumValueOptions' extension. Example: https://github.com/protocolbuffers/protobuf/blob/5eafa23c98b93386319a3a9d6c1c2894174b5fb0/src/google/protobuf/descriptor_unittest.cc#L3192 在2022年8月11日星期四 UTC-7 06:05:09<[email protected]> 写道:
> Hi all - > Is there anyway to access custom options added to fields at compile time? > As I understand it, and from looking at the generated code, it only seems > possible to look up Options via an appropriate Descriptor, and I'm not sure > it's possible to get a constexpr one? > I'm looking at an EnumValueOptions specifically, and adding a "name" > option generates a "name_default" but no constexpr lookup it seems. > > If this is not possible, is there any suggested workaround? > Thanks > -- 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/602e841e-098b-415d-a015-532b184a75ebn%40googlegroups.com.
