[protobuf] how to know whether field has options while converting proto to other language

2019-12-05 Thread LakshmiKanth Gupta
Hi, Currently I am writing a convertor from proto format to ttcn3 format. Messages which I have defined has some custom Field options. How can I check whether a field has custom options or not. syntax="proto3"; import "google/protobuf/descriptor.proto" extend google.protobuf.FieldOptions{

Re: [protobuf] how to know whether field has options while converting proto to other language

2019-12-05 Thread LakshmiKanth Gupta
t. The details depend on the language you are using, though. > > On Thu, Dec 5, 2019 at 12:26 PM LakshmiKanth Gupta > wrote: > >> Hi, >> >> Currently I am writing a convertor from proto format to ttcn3 format. >> >> Messages which I have defined has some custo

Re: [protobuf] how to know whether field has options while converting proto to other language

2019-12-06 Thread LakshmiKanth Gupta
: How do I know the attributes of FieldOptions. On Friday, December 6, 2019 at 5:01:49 AM UTC+1, LakshmiKanth Gupta wrote: > > Yes.I am developing protoc plugin using c++.But I didn't find any function > to do that. Could somebody help me with that. Also couldn't find the >

Re: [protobuf] how to know whether field has options while converting proto to other language

2019-12-07 Thread LakshmiKanth Gupta
https://github.com/protocolbuffers/protobuf/blob/2220670ed97fb5d52868a0316054748e6354b6aa/src/google/protobuf/descriptor.proto#L509 >> >> On Fri, Dec 6, 2019 at 5:33 AM LakshmiKanth Gupta > > wrote: >> >>> Finally I have figured out whether a field has options or not. >>>

[protobuf] how does encoding of custom fieldoptions work

2019-12-08 Thread LakshmiKanth Gupta
syntax="proto3"; import "google/protobuf/descriptor.proto" extend google.protobuf.FieldOptions{ bool presence=50001; } message Mymessage { int32 foo=1[(presence)=true]; string bar=2; } I wrote following code and encoded: Mymessage l_message; l_message.set_foo(1);

Re: [protobuf] Skip certain indices while encoding

2022-11-28 Thread LakshmiKanth Gupta
required" > in proto2, which doesn't appear to be the case), or b) create a new > EmployeeDataMinimal message that *doesn't have a salary*, and serialize that > > (I can't comment on 2; not a C++ person) > > On Mon, 28 Nov 2022 at 08:14, LakshmiKanth Gupta > wrote: > >

[protobuf] Skip certain indices while encoding

2022-11-28 Thread LakshmiKanth Gupta
Hello All, message EmployeeData { string name =1; string address = 2; integer salary =3; } 1. When I transmit the EmployeeData., I would like to skip "salary" from encoding. Is that possible? 2. Is it possible to tag a void pointer with employeedata object in c++ code? Some

[protobuf] GetArenaNoVirtual is returning no Arena even after creating the message using Arena

2022-12-02 Thread LakshmiKanth Gupta
message MyRec1 { int32 a=1; } message MyRec { MyRec1 rec = 1; } auto *rec= google::protobuf::Arena::Create(arena); rec->mutable_rec()->set_a(100); mtable_rec() is creating memory using new...Arena which I have used for creating MyRec is not used. Please help. -- You received this