merge.h 681 B

12345678910111213141516171819202122
  1. #pragma once
  2. namespace google {
  3. namespace protobuf {
  4. class Message;
  5. }
  6. }
  7. namespace NProtoBuf {
  8. using Message = ::google::protobuf::Message;
  9. }
  10. namespace NProtoBuf {
  11. // Similiar to Message::MergeFrom, overwrites existing repeated fields
  12. // and embedded messages completely instead of recursive merging.
  13. void RewriteMerge(const Message& src, Message& dst);
  14. // Does standard MergeFrom() by default, except messages/fields marked with DontMerge or DontMergeField option.
  15. // Such fields are merged using RewriteMerge() (i.e. destination is cleared before merging anything from source)
  16. void CustomMerge(const Message& src, Message& dst);
  17. }