I want to compare two Messages or (two sub parameters) of Google protocol buffers. I don't find an API to achieve it.
Any ideas?
You can use the class google::protobuf::util::MessageDifferencer for this. I think it's only available since v3.0.2:
Introduced new utility functions/classes in the google/protobuf/util directory:
- MessageDifferencer: compare two proto messages and report their differences.
#include <google/protobuf/util/message_differencer.h>
MessageDifferencer::Equals(msg1, msg2);