mbarbon / google-protobuf-dynamic

Fast and complete Perl protobuf implementation using uPB and Google .proto parser
35 stars 18 forks source link

Install enum reverse lookup constants #4

Closed maros closed 8 years ago

maros commented 8 years ago

This change adds enum_# constants to all enum classes. These methods can be used to lookup an enum key bases on the enum index. Will add docs and tests once you tell me which method name pattern to use.

mbarbon commented 8 years ago

Sorry, I completely missed this pull request (I have not been paying attention to my e-mail).

I think the same functionality could be implemented in a cleaner way using https://github.com/mbarbon/google-protobuf-dynamic/blob/master/lib/Google/ProtocolBuffers/Dynamic/Introspection.pod#googleprotocolbuffersdynamicenumdef (added yesterday).

I would just add an enum_descriptor() method to the mapped enum package.

maros commented 8 years ago

yes, that's definitely much better. Introspection was the top feature on my "wishlist" for this distribution. Thank you & keep up the great work!