summaryrefslogtreecommitdiffstats
path: root/src/merger.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-10 01:27:27 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-10 01:27:27 +0000
commit76718abdb2138623102398a10f3228e576dd0ae8 (patch)
treeddb098baac9689b9e661a41c2a28a8a23ef246d4 /src/merger.h
downloadkdiff3-76718abdb2138623102398a10f3228e576dd0ae8.tar.gz
kdiff3-76718abdb2138623102398a10f3228e576dd0ae8.zip
Added abandoned KDE3 version of kdiff3
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kdiff3@1088041 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/merger.h')
-rw-r--r--src/merger.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/merger.h b/src/merger.h
new file mode 100644
index 0000000..3712a2f
--- /dev/null
+++ b/src/merger.h
@@ -0,0 +1,61 @@
+/***************************************************************************
+ merger.h - description
+ -------------------
+ begin : Sun Mar 24 2002
+ copyright : (C) 2002-2007 by Joachim Eibl
+ email : joachim.eibl at gmx.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef MERGER_H
+#define MERGER_H
+
+#include "diff.h"
+
+
+class Merger
+{
+public:
+
+ Merger( const DiffList* pDiffList1, const DiffList* pDiffList2 );
+
+ /** Go one step. */
+ void next();
+
+ /** Information about what changed. Can be used for coloring.
+ The return value is 0 if nothing changed here,
+ bit 1 is set if a difference from pDiffList1 was detected,
+ bit 2 is set if a difference from pDiffList2 was detected.
+ */
+ int whatChanged();
+
+ /** End of both diff lists reached. */
+ bool isEndReached();
+private:
+
+ struct MergeData
+ {
+ DiffList::const_iterator it;
+ const DiffList* pDiffList;
+ Diff d;
+ int idx;
+
+ MergeData( const DiffList* p, int i );
+ bool eq();
+ void update();
+ bool isEnd();
+ };
+
+ MergeData md1;
+ MergeData md2;
+};
+
+#endif