I want to compare two *Message*s or (two sub parameters) of Google protocol buffers. I don't find an API do achieve it.
Any ideas?
I want to compare two *Message*s or (two sub parameters) of Google protocol buffers. I don't find an API do achieve it.
Any ideas?
This might not be the ideal solution, but I think it could be done by:
messageA.DebugString() == messageB.DebugString();
Other than that, I think the only solution would be to create your own Message
child class and implement a bool operator==(const Message&)
.
Well, a protocol buffer is just a serialization format for some object type. Why not use the protocol buffer to reconstruct the original objects, and then allow those objects to compare themselves, using whatever comparison logic you've built into the class?