Reputation: 31
I need to get serializedData
(like in C#) in C++ for google::protobuf::FileDescriptor
object.
In C++ code I have google::protobuf::FileDescriptor
object. And I need to get something like ByteString SerializedData
in C# (The original serialized binary form of this descriptor.)
Does anyone know how to do it? Thank you.
Upvotes: 0
Views: 530
Reputation: 181705
You can use FileDescriptor::CopyTo(FileDescriptorProto * proto)
to copy the contents to a FileDescriptorProto
, which is a regular Message
that you can serialize using any of the SerializeTo...
functions.
Upvotes: 1