Odczytaj wartość rozszerzenia enum w buforze protokołu

po prostu zapytałemto pytanie i postanowiłem napisać rozszerzenie dla wartości wyliczeniowych w moim buforze protokołu. Jednak mam bardzo trudny czas, aby faktycznie odczytać wartości, nawet w przypadku tego prostego pliku .proto:

package test;

import "google/protobuf/descriptor.proto";

extend google.protobuf.EnumValueOptions {
  optional string abbr = 54321;
}

message Person {
    required string name = 1;
    required int32 id = 2;
    optional string email = 3;
    enum PhoneType { MOBILE = 0 [(abbr)="Mobile ph"]; HOME = 1 [(abbr)="HomePhone"]; WORK = 2 [(abbr)="Work number"]; }

    message PhoneNumber {
        required string number = 1;
        optional PhoneType type = 2 [default = HOME];
    }

    repeated PhoneNumber phone = 4;
}

message AddressBook {
    repeated Person person = 1;
}

Próbowałem tych i innych wariantów:

test::Person::PhoneNumber::descriptor()->options().GetExtension(test::abbr);
test::Person::PhoneNumber::descriptor().GetExtension(test::abbr);
test::Person::descriptor()->options().GetExtension(test::abbr);

const google::protobuf::Descriptor* message = test::Person::PhoneNumber::descriptor();
const google::protobuf::Descriptor* desc = phone2.descriptor();
desc->options().GetExtension(test::abbr); //D.N.E.

google::protobuf::MessageOptions opts = message->options();
opts.GetExtension(test::abbr);

const google::protobuf::EnumDescriptor* enm = message->FindEnumTypeByName("PhoneNumber"); // null, not found
google::protobuf::EnumValueOptions opts2 = enm->value(1)->options();
opts2.GetExtension(test::abbr);

test::Person::PhoneNumber::descriptor()->options().GetExtension(test::abbr);

Żadna z powyższych czynności nie działa - albo metoda w ogóle nie istnieje, albo nie ma odpowiadającego wywołania tej sygnatury funkcji. Przeglądałem dokumentację od wielu godzin bezskutecznie. Wiem, że powinno być to możliwe, ale jedyne przykłady to zapisywanie plików .proto, a nie odczytywanie z nich - Jak to zrobić? Krótki przykład byłby bardzo mile widziany. Z góry dziękuję.

questionAnswers(1)

yourAnswerToTheQuestion