I have written a C++ class for comparing two Google Protocol Buffer messages. It takes two GPB objects and returns whether the two GPB messages are exactly same or not. This class also has another API which returns even the attributes that got modified between the two messages. The C++ API (simple case of just return true/false) looks like below. It takes Google Protobuf base class "Message" objects as input. So this API can be called to compare any type of protobuf messages as long as firstMsg and secondMsg are of same type. i.e. can be used to compare message of type Student, or message of type Teacher.
bool get_diff(google::protobuf::Message* firstMsg,
google::protobuf::Message* secondMsg)This works fine for me to use from a C++ code. However, now I have a new use case where I need to call this API from a C code. My C code also has protobuf messages that are generated with protoc-c compiler. I am having difficulty in generating google::protobuf::Message from a protobuf-c message to call this API.
Any suggestions on how to move forward ?
--
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 protobuf+u...@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/ae2866da-ed59-4a23-a3fa-e68035e4359d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.