Line data Source code
1 : /**
2 : * @file
3 : *
4 : * @brief A configuration for a simple automerge and guaranteed conflict resolution by one side
5 : *
6 : * @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
7 : *
8 : */
9 :
10 : #ifndef OVERWRITEMERGECONFIGURATION_HPP_
11 : #define OVERWRITEMERGECONFIGURATION_HPP_
12 :
13 : #include <merging/automergeconfiguration.hpp>
14 :
15 : using namespace std;
16 :
17 : namespace kdb
18 : {
19 :
20 : namespace tools
21 : {
22 :
23 : namespace merging
24 : {
25 :
26 : // This configuration is primarily used for importing and simply
27 : // resolves all conflicts by taking one side. This can be used
28 : // during import to overwrite existing keys
29 160 : class OverwriteMergeConfiguration : public AutoMergeConfiguration
30 : {
31 :
32 : private:
33 : ConflictResolutionSide winningSide;
34 :
35 : public:
36 160 : explicit OverwriteMergeConfiguration (ConflictResolutionSide _winningSide) : winningSide (_winningSide)
37 : {
38 : }
39 : virtual void configureMerger (ThreeWayMerge & merger) override;
40 : };
41 : } // namespace merging
42 : } // namespace tools
43 : } // namespace kdb
44 :
45 : #endif /* OVERWRITEMERGECONFIGURATION_HPP_ */
|