You can call mutable_data(), which will return a pointer to a google::protobuf::RepeatedPtrField<std::string>, which is similar to a vector of std::string pointers. Here is what the API looks like: https://github.com/protocolbuffers/protobuf/blob/41f94bf372d36e3b21a6f5e6d46526c2937c48ad/src/google/protobuf/repeated_field.h#L775 You probably want to optionally call Reserve() to reserve the number of strings you want to store, and then you can repeatedly call Add() to add strings.
On Wed, Jan 30, 2019 at 2:36 PM <[email protected]> wrote: > I have a protobuf that contains a repeated field of repeated bytes as > described below. It is my understanding that TransferData::data is > essentially a list of vectors(arrays), correct? If so how does one go about > setting the size of data and then populating each array? > > message TransferData > > { > > repeated bytes data = 1; > > } > > > This email and its contents are confidential. If you are not the intended > recipient, please do not disclose or use the information within this email > or its attachments. If you have received this email in error, please report > the error to the sender by return email and delete this communication from > your records. > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/protobuf. > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.
