aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/protobuf/util/merge.h
blob: b3543317880c6c99db93011c4305fa1885cabd12 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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); 

}