Google协议缓冲区比较 [英] Google protocol buffers compare
本文介绍了Google协议缓冲区比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要比较邮件或(两个子参数)。 html> Google协议缓冲区。
我找不到一个API来实现它。
I want to compare two Messages or (two sub parameters) of Google protocol buffers. I don't find an API to achieve it.
任何想法?
推荐答案
您可以使用 google :: protobuf :: util :: MessageDifferencer 。我认为只有自 v3.0.0-beta-1 可用:
You can use the class google::protobuf::util::MessageDifferencer for this. I think it's only available since v3.0.0-beta-1:
在google / protobuf / util
目录中引入了新的效用函数/类:
Introduced new utility functions/classes in the google/protobuf/util directory:
- MessageDifferencer:比较两个proto讯息并报告其差异。
MessageDifferencer.Equals(msg1,msg2);
这篇关于Google协议缓冲区比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文