| Index: third_party/protobuf/src/google/protobuf/util/field_mask_util.h
|
| diff --git a/third_party/protobuf/src/google/protobuf/util/field_mask_util.h b/third_party/protobuf/src/google/protobuf/util/field_mask_util.h
|
| index 644161b940190735e6956c0cedbf1c3aff63c933..396c9aea599f3897b8a3a954c8ae00277ac691c5 100644
|
| --- a/third_party/protobuf/src/google/protobuf/util/field_mask_util.h
|
| +++ b/third_party/protobuf/src/google/protobuf/util/field_mask_util.h
|
| @@ -28,6 +28,8 @@
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| +// Defines utilities for the FieldMask well known type.
|
| +
|
| #ifndef GOOGLE_PROTOBUF_UTIL_FIELD_MASK_UTIL_H__
|
| #define GOOGLE_PROTOBUF_UTIL_FIELD_MASK_UTIL_H__
|
|
|
| @@ -107,10 +109,16 @@ class LIBPROTOBUF_EXPORT FieldMaskUtil {
|
| static bool IsPathInFieldMask(StringPiece path, const FieldMask& mask);
|
|
|
| class MergeOptions;
|
| - // Merges fields specified in a FieldMask into another message.
|
| + // Merges fields specified in a FieldMask into another message. See the
|
| + // comments in MergeOptions regarding compatibility with
|
| + // google/protobuf/field_mask.proto
|
| static void MergeMessageTo(const Message& source, const FieldMask& mask,
|
| const MergeOptions& options, Message* destination);
|
|
|
| + // 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);
|
| +
|
| private:
|
| friend class SnakeCaseCamelCaseTest;
|
| // Converts a field name from snake_case to camelCase:
|
| @@ -148,6 +156,10 @@ 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()
|
|
|