aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/util/field_comparator.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/util/field_comparator.h')
-rw-r--r--src/google/protobuf/util/field_comparator.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/google/protobuf/util/field_comparator.h b/src/google/protobuf/util/field_comparator.h
index 26a7ba4d..27ef4c77 100644
--- a/src/google/protobuf/util/field_comparator.h
+++ b/src/google/protobuf/util/field_comparator.h
@@ -35,6 +35,7 @@
#include <map>
#include <string>
+#include <vector>
#include <google/protobuf/stubs/common.h>
@@ -48,6 +49,7 @@ class FieldDescriptor;
namespace util {
class FieldContext;
+class MessageDifferencer;
// Base class specifying the interface for comparing protocol buffer fields.
// Regular users should consider using or subclassing DefaultFieldComparator
@@ -153,6 +155,15 @@ class LIBPROTOBUF_EXPORT DefaultFieldComparator : public FieldComparator {
// REQUIRES: float_comparison_ == APPROXIMATE
void SetDefaultFractionAndMargin(double fraction, double margin);
+ protected:
+ // Compare using the provided message_differencer. For example, a subclass can
+ // use this method to compare some field in a certain way using the same
+ // message_differencer instance and the field context.
+ bool Compare(MessageDifferencer* differencer,
+ const google::protobuf::Message& message1,
+ const google::protobuf::Message& message2,
+ const google::protobuf::util::FieldContext* field_context);
+
private:
// Defines the tolerance for floating point comparison (fraction and margin).
struct Tolerance {