Hello everyone,

Intro: My company is in the process of migrating schemas from proto2 to 
proto3. I am eliminating extensions as they are not supported. 

Question: I am wondering if it is possible to get a field object using it's 
name.

Example: In proto2, my current code looks like this:

*> Foo.proto*
message Foo {
    message Bar {
        unint32 a = 1;
    }
    extend Foo {
        Bar b = 1;
    }
}

*> in C++*
*Foo::Bar b_val = foo.MutableExtension(Foo::b);*

Now in proto3, I could do this:

*> Foo.proto*
syntax="proto3";
message Foo {
    message Bar {
        unint32 a = 1;
    }
    Bar b = 1;
}

*> in C++*
*Foo::Bar b_val = foo.mutable_b();*

However, I want to use the name Foo::b to get a Foo::Bar object. Is there a 
way to do this? If there is, which one is recommended?

Thanks,
Mihir

-- 
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 protobuf+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/4b958fe0-5ec9-4fd9-99a9-cf096e6ff289n%40googlegroups.com.

Reply via email to