diff options
| author | Devtools Arcadia <[email protected]> | 2022-02-07 18:08:42 +0300 | 
|---|---|---|
| committer | Devtools Arcadia <[email protected]> | 2022-02-07 18:08:42 +0300 | 
| commit | 1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch) | |
| tree | e26c9fed0de5d9873cce7e00bc214573dc2195b7 /library/cpp/protobuf/util/merge.h | |
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'library/cpp/protobuf/util/merge.h')
| -rw-r--r-- | library/cpp/protobuf/util/merge.h | 22 | 
1 files changed, 22 insertions, 0 deletions
diff --git a/library/cpp/protobuf/util/merge.h b/library/cpp/protobuf/util/merge.h new file mode 100644 index 00000000000..924975f141b --- /dev/null +++ b/library/cpp/protobuf/util/merge.h @@ -0,0 +1,22 @@ +#pragma once + +namespace google { +    namespace protobuf { +        class Message; +    } +} + +namespace NProtoBuf { +    using Message = ::google::protobuf::Message; +} + +namespace NProtoBuf { +    // Similiar to Message::MergeFrom, overwrites existing repeated fields +    // and embedded messages completely instead of recursive merging. +    void RewriteMerge(const Message& src, Message& dst); + +    // Does standard MergeFrom() by default, except messages/fields marked with DontMerge or DontMergeField option. +    // Such fields are merged using RewriteMerge() (i.e. destination is cleared before merging anything from source) +    void CustomMerge(const Message& src, Message& dst); + +}  | 
