Line data Source code
1 : /**
2 : * @file
3 : *
4 : * @brief A strategy which always takes the value from one side
5 : *
6 : * @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
7 : *
8 : */
9 :
10 : #ifndef NEWKEYSTRATEGY_HPP_
11 : #define NEWKEYSTRATEGY_HPP_
12 :
13 : #include <merging/mergeconflictstrategy.hpp>
14 :
15 : namespace kdb
16 : {
17 :
18 : namespace tools
19 : {
20 :
21 : namespace merging
22 : {
23 : // This strategy is basically a subset of the AutoMergeStrategy. It resolves
24 : // only conflicts where one side added key, while the other side did nothing.
25 8 : class NewKeyStrategy : public MergeConflictStrategy
26 : {
27 : public:
28 : NewKeyStrategy ()
29 8 : {
30 : }
31 :
32 : virtual void resolveConflict (const MergeTask & task, Key & conflictKey, MergeResult & result) override;
33 : };
34 : } // namespace merging
35 : } // namespace tools
36 : } // namespace kdb
37 :
38 : #endif /* NEWKEYSTRATEGY_HPP_ */
|