1 // TortoiseMerge - a Diff/Patch program
\r
3 // Copyright (C) 2007-2008 - TortoiseSVN
\r
5 // This program is free software; you can redistribute it and/or
\r
6 // modify it under the terms of the GNU General Public License
\r
7 // as published by the Free Software Foundation; either version 2
\r
8 // of the License, or (at your option) any later version.
\r
10 // This program is distributed in the hope that it will be useful,
\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 // GNU General Public License for more details.
\r
15 // You should have received a copy of the GNU General Public License
\r
16 // along with this program; if not, write to the Free Software Foundation,
\r
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\r
20 #include "DiffStates.h"
\r
26 * \ingroup TortoiseMerge
\r
27 * Holds the information which is required to define a single line of text.
\r
38 * \ingroup TortoiseMerge
\r
39 * Handles the view and diff data a TortoiseMerge view needs.
\r
47 void AddData(const CString& sLine, DiffStates state, int linenumber, EOL ending);
\r
48 void AddData(const viewdata& data);
\r
49 void InsertData(int index, const CString& sLine, DiffStates state, int linenumber, EOL ending);
\r
50 void InsertData(int index, const viewdata& data);
\r
51 void RemoveData(int index) {m_data.erase(m_data.begin() + index);}
\r
53 const viewdata& GetData(int index) {return m_data[index];}
\r
54 const CString& GetLine(int index) {return m_data[index].sLine;}
\r
55 DiffStates GetState(int index) {return m_data[index].state;}
\r
56 int GetLineNumber(int index) {return m_data.size() ? m_data[index].linenumber : 0;}
\r
57 int FindLineNumber(int number);
\r
58 EOL GetLineEnding(int index) {return m_data[index].ending;}
\r
60 int GetCount() {return m_data.size();}
\r
62 void SetState(int index, DiffStates state) {m_data[index].state = state;}
\r
63 void SetLine(int index, const CString& sLine) {m_data[index].sLine = sLine;}
\r
64 void SetLineNumber(int index, int linenumber) {m_data[index].linenumber = linenumber;}
\r
65 void SetLineEnding(int index, EOL ending) {m_data[index].ending = ending;}
\r
67 void Clear() {m_data.clear();}
\r
68 void Reserve(int length) {m_data.reserve(length);}
\r
71 std::vector<viewdata> m_data;
\r