aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/util/field_mask_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/util/field_mask_util.h')
-rw-r--r--src/google/protobuf/util/field_mask_util.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/google/protobuf/util/field_mask_util.h b/src/google/protobuf/util/field_mask_util.h
index 01642c6f..91787bd5 100644
--- a/src/google/protobuf/util/field_mask_util.h
+++ b/src/google/protobuf/util/field_mask_util.h
@@ -94,6 +94,13 @@ class LIBPROTOBUF_EXPORT FieldMaskUtil {
// Creates a FieldMask with all fields of type T. This FieldMask only
// contains fields of T but not any sub-message fields.
template <typename T>
+ static FieldMask GetFieldMaskForAllFields() {
+ FieldMask out;
+ InternalGetFieldMaskForAllFields(T::descriptor(), &out);
+ return out;
+ }
+ template <typename T>
+ PROTOBUF_RUNTIME_DEPRECATED("Use *out = GetFieldMaskForAllFields() instead")
static void GetFieldMaskForAllFields(FieldMask* out) {
InternalGetFieldMaskForAllFields(T::descriptor(), out);
}
@@ -122,6 +129,8 @@ class LIBPROTOBUF_EXPORT FieldMaskUtil {
// Returns true if path is covered by the given FieldMask. Note that path
// "foo.bar" covers all paths like "foo.bar.baz", "foo.bar.quz.x", etc.
+ // Also note that parent paths are not covered by explicit child path, i.e.
+ // "foo.bar" does NOT cover "foo", even if "bar" is the only child.
static bool IsPathInFieldMask(StringPiece path, const FieldMask& mask);
class MergeOptions;