Quark  0.1
DiffTypes.h++
Go to the documentation of this file.
1 
2 #ifndef __libquark_diff_DiffTypes_hxx
3 #define __libquark_diff_DiffTypes_hxx
4 
5 #include <QtGlobal>
6 
7 namespace quark {
8 namespace diff {
9 
10 // The role identifies the component of a 2- or 3-way diff.
12 
13 // The "direction" of a diff. Affects whether the "delete" and "insert" chunk
14 // types are swapped.
15 //
16 // "kDiffFromBase" indicates that we are diffing "from" the base to the other
17 // file(s). This is always the case for 2-way diffs. For 3-way diffs, it
18 // indicates that we consider the base file to be the "old" file. This would
19 // be used to present a 3-way diff to the user which shows how the "theirs"
20 // and "yours" files differ from a "base" file.
21 //
22 // "kDiffToBase" indicates that we are diffing "to" the base from the other
23 // file(s). This is never the case for 2-way diffs. For 3-way diffs, it
24 // indicates that we consider the base file to be the "new" file. This would
25 // be used to present a 3-way merge to the user, in which the "base" file is
26 // the result of the merge between a common ancestor and the "theirs" and
27 // "yours" files; it shows how edits in the "theirs" and "yours" files
28 // have contributed to the resulting merged file.
30 
31 // Simple data structure for storing diff chunk counts.
32 struct DiffCounts
33 {
35  : theirs(0),
36  yours(0),
37  both(0),
38  conflicting(0)
39  {
40  }
41 
42  inline void reset()
43  {
44  theirs = yours = both = conflicting = 0;
45  }
46 
47  uint theirs;
48  uint yours;
49  uint both;
51 };
52 
53 } // namespace diff
54 } // namespace quark
55 
56 #endif // __libquark_diff_DiffTypes_hxx
uint theirs
Definition: DiffTypes.h++:47
Definition: DiffTypes.h++:32
uint both
Definition: DiffTypes.h++:49
Definition: DiffTypes.h++:11
Definition: DiffTypes.h++:11
Definition: BarChartView.h++:6
Definition: DiffTypes.h++:29
uint yours
Definition: DiffTypes.h++:48
DiffDirection
Definition: DiffTypes.h++:29
DiffRole
Definition: DiffTypes.h++:11
uint conflicting
Definition: DiffTypes.h++:50
DiffCounts()
Definition: DiffTypes.h++:34
Definition: DiffTypes.h++:11
Definition: DiffTypes.h++:29
void reset()
Definition: DiffTypes.h++:42