aboutsummaryrefslogtreecommitdiffhomepage
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.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/google/protobuf/util/message_differencer.h b/src/google/protobuf/util/message_differencer.h
index b7d4de00..11d6cc03 100644
--- a/src/google/protobuf/util/message_differencer.h
+++ b/src/google/protobuf/util/message_differencer.h
@@ -64,6 +64,7 @@ class Printer;
namespace util {
+class DefaultFieldComparator;
class FieldContext; // declared below MessageDifferencer
// A basic differencer that can be used to determine
@@ -372,7 +373,7 @@ class LIBPROTOBUF_EXPORT MessageDifferencer {
// repeated fields have different numbers of elements, the
// unpaired elements are reported using ReportAdded() or
// ReportDeleted().
- AS_SET, // Treat all the repeated fields as sets by default.
+ AS_SET, // Treat all the repeated fields as sets.
// See TreatAsSet(), as below.
};
@@ -386,6 +387,11 @@ class LIBPROTOBUF_EXPORT MessageDifferencer {
// the only differences between the compared messages is that some fields
// have been moved, then the comparison returns true.
//
+ // Note that despite the name of this method, this is really
+ // comparison as multisets: if one side of the comparison has a duplicate
+ // in the repeated field but the other side doesn't, this will count as
+ // a mismatch.
+ //
// If the scope of comparison is set to PARTIAL, then in addition to what's
// above, extra values added to repeated fields of the second message will
// not cause the comparison to fail.
@@ -470,6 +476,10 @@ class LIBPROTOBUF_EXPORT MessageDifferencer {
const FieldDescriptor* field,
const MapKeyComparator* key_comparator);
+ // Initiates and returns a new instance of MultipleFieldsMapKeyComparator.
+ MapKeyComparator* CreateMultipleFieldsMapKeyComparator(
+ const std::vector<std::vector<const FieldDescriptor*> >& key_field_paths);
+
// Add a custom ignore criteria that is evaluated in addition to the
// ignored fields added with IgnoreField.
// Takes ownership of ignore_criteria.
@@ -660,6 +670,8 @@ class LIBPROTOBUF_EXPORT MessageDifferencer {
};
private:
+ friend class DefaultFieldComparator;
+
// A MapKeyComparator to be used in TreatAsMapUsingKeyComparator.
// Implementation of this class needs to do field value comparison which
// relies on some private methods of MessageDifferencer. That's why this