This content originally appeared on DEV Community and was authored by sarritesh
I have a proto3 file. There is a message in the proto file that contains a map field.
proto3
package abc.xyz.testproto
message abc
{
map mapfield = 1;
}
Suppose as a c++ consumer i want to read this map field, what would be the api call necessary for me to read these key and value from this map field into a string and int field in c++ ?
I tried to look for it here : https://developers.google.com/protocol-buffers/docs/reference/cpp-generated#map-fields but could not find how the code on how to consume the map fields. Can someone help me with it ?
This content originally appeared on DEV Community and was authored by sarritesh
sarritesh | Sciencx (2022-03-24T14:15:17+00:00) Reading key and value from a map field in protobuf message using c++ API call. Retrieved from https://www.scien.cx/2022/03/24/reading-key-and-value-from-a-map-field-in-protobuf-message-using-c-api-call/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.