protocol buffers - Reading a protobuf3 custom option from C# -


tl;dr

according doc, if doing c++, read value of custom option using string value = mymessage::descriptor()->options().getextension(my_option);. there similar examples java , python. i'm doing c# , find equivalent. can it, , if yes, how?

more details

i'm manipulating classes generated protobuf3. schemas declaring custom option. looks this:

import "google/protobuf/descriptor.proto";  extend google.protobuf.messageoptions {   string my_option = 51234; }  message mymessage {   option (my_option) = "hello world!"; } 

my code being provided object generated mymessage, , i'd read value of option (here hello world!)


update: i'm not using protobuf-net. c# natively supported protobuf, i'm using google's protobuf3 c# library.

looks feature hasn't been implemented yet: https://github.com/google/protobuf/issues/1603

it looks it's matter of time , they're open pull requests. depending on how need it, 1 doing implementation :)


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -