Re: [protobuf] Unable to perform SetExtension on 'repeated inside extensions'.

2016-11-17 Thread Sachin Puranik
Thanks a lot Adam, It worked. Thanks, Sachin On Thu, Nov 17, 2016 at 12:36 AM, Adam Cozzette wrote: > I think the MutableExtension() method is the way to go; that will return a > pointer to your extension field, so in this case a pointer > to DNSServerNames. Something like this should work: > >

Re: [protobuf] Unable to perform SetExtension on 'repeated inside extensions'.

2016-11-16 Thread 'Adam Cozzette' via Protocol Buffers
I think the MutableExtension() method is the way to go; that will return a pointer to your extension field, so in this case a pointer to DNSServerNames. Something like this should work: i->MutableExtension(dnsServerNames)->add_dnsservers("aaa"); Or you could also do it like this: DNSServerNames

Re: [protobuf] Unable to perform SetExtension on 'repeated inside extensions'.

2016-11-16 Thread sachin . p . puranik
Hi Adam, Please find the below snippet and the associated error: //Code IpInterfaceAddress *i = dynamic_cast (x); //x is of type google::protobuf::Message * if(i != NULL) { DNSServerNames temp; temp.add_dnsservers("aaa"); i->MutableExtension.SetExtension(a); } //E

Re: [protobuf] Unable to perform SetExtension on 'repeated inside extensions'.

2016-11-16 Thread 'Adam Cozzette' via Protocol Buffers
That should work; you should be able to use repeated fields inside your extension submessage field. I think you might just be running into a syntax issue; could you post the code snippet and the error you're getting? On Wed, Nov 16, 2016 at 4:08 AM, wrote: > import "IpInterfaces.proto"; > packag

[protobuf] Unable to perform SetExtension on 'repeated inside extensions'.

2016-11-16 Thread sachin . p . puranik
import "IpInterfaces.proto"; package IpInterfaces; message DNSServerNames{ *repeated* string dnsServers=11;//limited only to optional? } extend IpInterfaceAddress{ optional DNSServerNames dnsServerNames=101; } Unable to perform SetExtension(dnsServers,value). Is this supported or is it limit