diff options
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__ |