Line data Source code
1 : /**
2 : * @file
3 : *
4 : * @brief Interactive merge strategy asking for user input at each step
5 : *
6 : * @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
7 : *
8 : */
9 :
10 : #ifndef ELEKTRA_LIBTOOL_INTERACTIVEMERGESTRATEGY_HPP
11 : #define ELEKTRA_LIBTOOL_INTERACTIVEMERGESTRATEGY_HPP
12 :
13 : #include <merging/mergeconflictstrategy.hpp>
14 :
15 : namespace kdb
16 : {
17 :
18 : namespace tools
19 : {
20 :
21 : namespace merging
22 : {
23 :
24 : // This strategy can be used to interactively merging keys. It will ask
25 : // the user for each conflict which key version should be used. All
26 : // questions will be asked via the supplied input stream and results
27 : // will only be printed to the supplied outputstream.
28 0 : class InteractiveMergeStrategy : public MergeConflictStrategy
29 : {
30 : public:
31 0 : InteractiveMergeStrategy (std::istream & input, std::ostream & output) : inputStream (input), outputStream (output)
32 : {
33 : }
34 :
35 : virtual void resolveConflict (const MergeTask & task, Key & conflictKey, MergeResult & result) override;
36 :
37 : private:
38 : std::istream & inputStream;
39 : std::ostream & outputStream;
40 : };
41 : } // namespace merging
42 : } // namespace tools
43 : } // namespace kdb
44 :
45 : #endif
|