diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2018-08-08 17:00:41 -0700 |
---|---|---|
committer | Feng Xiao <xfxyjwf@gmail.com> | 2018-08-08 17:00:41 -0700 |
commit | 6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3 (patch) | |
tree | e575738adf52d24b883cca5e8928a5ded31caba1 /src/google/protobuf/util/field_mask_util.h | |
parent | e7746f487cb9cca685ffb1b3d7dccc5554b618a4 (diff) | |
download | protobuf-6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3.tar.gz protobuf-6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3.tar.bz2 protobuf-6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3.zip |
Down-integrate from google3.
Diffstat (limited to 'src/google/protobuf/util/field_mask_util.h')
-rw-r--r-- | src/google/protobuf/util/field_mask_util.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/google/protobuf/util/field_mask_util.h b/src/google/protobuf/util/field_mask_util.h index f0299de9..6fabc3ec 100644 --- a/src/google/protobuf/util/field_mask_util.h +++ b/src/google/protobuf/util/field_mask_util.h @@ -39,6 +39,8 @@ #include <google/protobuf/field_mask.pb.h> #include <google/protobuf/stubs/stringpiece.h> +#include <google/protobuf/port_def.inc> + namespace google { namespace protobuf { namespace util { @@ -100,7 +102,8 @@ class LIBPROTOBUF_EXPORT FieldMaskUtil { return out; } template <typename T> - PROTOBUF_RUNTIME_DEPRECATED("Use *out = GetFieldMaskForAllFields() instead") + GOOGLE_PROTOBUF_DEPRECATED_MSG( + "Use *out = GetFieldMaskForAllFields() instead") static void GetFieldMaskForAllFields(FieldMask* out) { InternalGetFieldMaskForAllFields(T::descriptor(), out); } @@ -134,21 +137,21 @@ class LIBPROTOBUF_EXPORT FieldMaskUtil { static bool IsPathInFieldMask(StringPiece path, const FieldMask& mask); class MergeOptions; - // Merges fields specified in a FieldMask into another message. See the - // comments in MergeOptions regarding compatibility with - // google/protobuf/field_mask.proto + // Merges fields specified in a FieldMask into another message. static void MergeMessageTo(const Message& source, const FieldMask& mask, const MergeOptions& options, Message* destination); class TrimOptions; // Removes from 'message' any field that is not represented in the given // FieldMask. If the FieldMask is empty, does nothing. - static void TrimMessage(const FieldMask& mask, Message* message); + // Returns true if the message is modified. + static bool TrimMessage(const FieldMask& mask, Message* message); // Removes from 'message' any field that is not represented in the given // FieldMask with customized TrimOptions. // If the FieldMask is empty, does nothing. - static void TrimMessage(const FieldMask& mask, Message* message, + // Returns true if the message is modified. + static bool TrimMessage(const FieldMask& mask, Message* message, const TrimOptions& options); private: @@ -189,10 +192,6 @@ class LIBPROTOBUF_EXPORT FieldMaskUtil { FieldMask* out); }; -// Note that for compatibility with the defined behaviour for FieldMask in -// google/protobuf/field_mask.proto, set replace_message_fields and -// replace_repeated_fields to 'true'. The default options are not compatible -// with google/protobuf/field_mask.proto. class LIBPROTOBUF_EXPORT FieldMaskUtil::MergeOptions { public: MergeOptions() @@ -240,6 +239,8 @@ class LIBPROTOBUF_EXPORT FieldMaskUtil::TrimOptions { } // namespace util } // namespace protobuf - } // namespace google + +#include <google/protobuf/port_undef.inc> + #endif // GOOGLE_PROTOBUF_UTIL_FIELD_MASK_UTIL_H__ |