use the right case for registry.h and stop using relative paths in the source files
[TortoiseGit.git] / src / TortoiseMerge / DiffData.h
blob5e3fef17c33b045e8e72e2f12c670580956983fe
1 // TortoiseMerge - a Diff/Patch program
3 // Copyright (C) 2006-2008 - TortoiseSVN
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #pragma once
21 #include "svn_diff.h"
22 #include "apr_pools.h"
23 #include "FileTextLines.h"
24 #include "registry.h"
25 #include "WorkingFile.h"
26 #include "ViewData.h"
30 #define DIFF_EMPTYLINENUMBER ((DWORD)-1)
31 /**
32 * \ingroup TortoiseMerge
33 * Main class for handling diffs.
35 class CDiffData
37 public:
38 CDiffData(void);
39 virtual ~CDiffData(void);
42 BOOL Load();
43 void SetBlame(bool bBlame = true) {m_bBlame = bBlame;}
44 int GetLineCount();
45 int GetLineActualLength(int index);
46 LPCTSTR GetLineChars(int index);
47 CString GetError() const {return m_sError;}
49 bool IsBaseFileInUse() const { return m_baseFile.InUse(); }
50 bool IsTheirFileInUse() const { return m_theirFile.InUse(); }
51 bool IsYourFileInUse() const { return m_yourFile.InUse(); }
53 private:
54 bool DoTwoWayDiff(const CString& sBaseFilename, const CString& sYourFilename, DWORD dwIgnoreWS, bool bIgnoreEOL, apr_pool_t * pool);
55 bool DoThreeWayDiff(const CString& sBaseFilename, const CString& sYourFilename, const CString& sTheirFilename, DWORD dwIgnoreWS, bool bIgnoreEOL, bool bIgnoreCase, apr_pool_t * pool);
58 public:
59 CWorkingFile m_baseFile;
60 CWorkingFile m_theirFile;
61 CWorkingFile m_yourFile;
62 CWorkingFile m_mergedFile;
64 CString m_sDiffFile;
65 CString m_sPatchPath;
66 CString m_sPatchOriginal;
67 CString m_sPatchPatched;
69 public:
70 CFileTextLines m_arBaseFile;
71 CFileTextLines m_arTheirFile;
72 CFileTextLines m_arYourFile;
74 CViewData m_YourBaseBoth; ///< one-pane view, diff between 'yours' and 'base' (in three-pane view: right view)
75 CViewData m_YourBaseLeft; ///< two-pane view, diff between 'yours' and 'base', left view
76 CViewData m_YourBaseRight; ///< two-pane view, diff between 'yours' and 'base', right view
78 CViewData m_TheirBaseBoth; ///< one-pane view, diff between 'theirs' and 'base' (in three-pane view: left view)
79 CViewData m_TheirBaseLeft; ///< two-pane view, diff between 'theirs' and 'base', left view
80 CViewData m_TheirBaseRight; ///< two-pane view, diff between 'theirs' and 'base', right view
82 CViewData m_Diff3; ///< thee-pane view, bottom pane
84 // the following three arrays are used to check for conflicts even in case the
85 // user has ignored spaces/eols.
86 CStdDWORDArray m_arDiff3LinesBase;
87 CStdDWORDArray m_arDiff3LinesYour;
88 CStdDWORDArray m_arDiff3LinesTheir;
90 CString m_sError;
92 static int abort_on_pool_failure (int retcode);
93 protected:
94 bool m_bBlame;