diff options
author | Adam Cozzette <acozzette@google.com> | 2017-12-01 10:05:10 -0800 |
---|---|---|
committer | Adam Cozzette <acozzette@google.com> | 2017-12-01 10:05:10 -0800 |
commit | 92a7e778e7394386f413cec28d67a07630f784b1 (patch) | |
tree | cb5673c7c09b0d3905b48a24765d07e423bc5b30 /src/google/protobuf/util/field_comparator.h | |
parent | ce0a53273a400369932ba788d17500336a6ecaad (diff) | |
download | protobuf-92a7e778e7394386f413cec28d67a07630f784b1.tar.gz protobuf-92a7e778e7394386f413cec28d67a07630f784b1.tar.bz2 protobuf-92a7e778e7394386f413cec28d67a07630f784b1.zip |
Integrated internal changes from Google
Diffstat (limited to 'src/google/protobuf/util/field_comparator.h')
-rw-r--r-- | src/google/protobuf/util/field_comparator.h | 11 |
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 { |