Getting all field names from a protocol buffer in C++? -
is there way fields of protobuff message using descriptor, in c++?
there's way in python this: getting field names protocol buffer?
just wondering if there's same thing in c++. tried find on descriptor.h, without success.
yes. if have descriptor, number of fields using descriptor::field_count(). then, iterate on fields using descriptor::field(int index), returns fielddescriptor, can find name of each field using fielddescriptor::name().
Comments
Post a Comment