aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/util/message_differencer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/util/message_differencer.h')
-rw-r--r--src/google/protobuf/util/message_differencer.h54
1 files changed, 28 insertions, 26 deletions
diff --git a/src/google/protobuf/util/message_differencer.h b/src/google/protobuf/util/message_differencer.h
index b3e65515..0c2174bf 100644
--- a/src/google/protobuf/util/message_differencer.h
+++ b/src/google/protobuf/util/message_differencer.h
@@ -60,7 +60,7 @@ class FieldDescriptor;
namespace io {
class ZeroCopyOutputStream;
class Printer;
-}
+} // namespace io
namespace util {
@@ -533,6 +533,12 @@ class LIBPROTOBUF_EXPORT MessageDifferencer {
report_moves_ = report_moves;
}
+ // Tells the differencer whether or not to report ignored values. This method
+ // must be called before Compare. The default for a new differencer is true.
+ void set_report_ignores(bool report_ignores) {
+ report_ignores_ = report_ignores;
+ }
+
// Sets the scope of the comparison (as defined in the Scope enumeration
// above) that is used by this differencer when determining which fields to
// compare between the messages.
@@ -597,7 +603,7 @@ class LIBPROTOBUF_EXPORT MessageDifferencer {
public:
explicit StreamReporter(io::ZeroCopyOutputStream* output);
explicit StreamReporter(io::Printer* printer); // delimiter '$'
- virtual ~StreamReporter() override;
+ ~StreamReporter() override;
// When set to true, the stream reporter will also output aggregates nodes
// (i.e. messages and groups) whose subfields have been modified. When
@@ -608,28 +614,23 @@ class LIBPROTOBUF_EXPORT MessageDifferencer {
// The following are implementations of the methods described above.
- virtual void ReportAdded(const Message& message1, const Message& message2,
- const std::vector<SpecificField>& field_path) override;
+ void ReportAdded(const Message& message1, const Message& message2,
+ const std::vector<SpecificField>& field_path) override;
- virtual void ReportDeleted(const Message& message1,
- const Message& message2,
- const std::vector<SpecificField>& field_path) override;
+ void ReportDeleted(const Message& message1, const Message& message2,
+ const std::vector<SpecificField>& field_path) override;
- virtual void ReportModified(const Message& message1,
- const Message& message2,
- const std::vector<SpecificField>& field_path) override;
+ void ReportModified(const Message& message1, const Message& message2,
+ const std::vector<SpecificField>& field_path) override;
- virtual void ReportMoved(const Message& message1,
- const Message& message2,
- const std::vector<SpecificField>& field_path) override;
+ void ReportMoved(const Message& message1, const Message& message2,
+ const std::vector<SpecificField>& field_path) override;
- virtual void ReportMatched(const Message& message1,
- const Message& message2,
- const std::vector<SpecificField>& field_path) override;
+ void ReportMatched(const Message& message1, const Message& message2,
+ const std::vector<SpecificField>& field_path) override;
- virtual void ReportIgnored(const Message& message1,
- const Message& message2,
- const std::vector<SpecificField>& field_path) override;
+ void ReportIgnored(const Message& message1, const Message& message2,
+ const std::vector<SpecificField>& field_path) override;
void ReportUnknownFieldIgnored(
const Message& message1, const Message& message2,
@@ -681,8 +682,9 @@ class LIBPROTOBUF_EXPORT MessageDifferencer {
class LIBPROTOBUF_EXPORT MapEntryKeyComparator : public MapKeyComparator {
public:
explicit MapEntryKeyComparator(MessageDifferencer* message_differencer);
- virtual bool IsMatch(const Message& message1, const Message& message2,
- const std::vector<SpecificField>& parent_fields) const override;
+ bool IsMatch(
+ const Message& message1, const Message& message2,
+ const std::vector<SpecificField>& parent_fields) const override;
private:
MessageDifferencer* message_differencer_;
@@ -712,8 +714,7 @@ class LIBPROTOBUF_EXPORT MessageDifferencer {
// Compares all the unknown fields in two messages.
bool CompareUnknownFields(const Message& message1, const Message& message2,
- const google::protobuf::UnknownFieldSet&,
- const google::protobuf::UnknownFieldSet&,
+ const UnknownFieldSet&, const UnknownFieldSet&,
std::vector<SpecificField>* parent_fields);
// Compares the specified messages for the requested field lists. The field
@@ -860,6 +861,7 @@ class LIBPROTOBUF_EXPORT MessageDifferencer {
bool report_matches_;
bool report_moves_;
+ bool report_ignores_;
string* output_string_;
@@ -883,8 +885,8 @@ class LIBPROTOBUF_EXPORT FieldContext {
std::vector<MessageDifferencer::SpecificField>* parent_fields_;
};
-}
-}
-
+} // namespace util
+} // namespace protobuf
} // namespace google
+
#endif // GOOGLE_PROTOBUF_UTIL_MESSAGE_DIFFERENCER_H__