KompareDiff2

diffhunk.h
1/*
2SPDX-FileCopyrightText: 2001-2004,2009 Otto Bruggeman <bruggie@gmail.com>
3SPDX-FileCopyrightText: 2001-2003 John Firebaugh <jfirebaugh@kde.org>
4
5SPDX-License-Identifier: GPL-2.0-or-later
6*/
7
8#ifndef KOMPAREDIFF2_DIFFHUNK_H
9#define KOMPAREDIFF2_DIFFHUNK_H
10
11#include "difference.h"
12
13
14namespace Diff2
15{
16
17class Difference;
18
19/**
20 * DiffHunk
21 */
23{
24public:
25 enum Type { Normal, AddedByBlend };
26
27public:
28 DiffHunk(int sourceLine, int destinationLine, const QString& function = QString(), Type type = Normal);
29 ~DiffHunk();
30
31 const DifferenceList& differences() const { return m_differences; };
32 const QString& function() const { return m_function; };
33
34 int sourceLineNumber() const { return m_sourceLine; };
35 int destinationLineNumber() const { return m_destinationLine; };
36
37 int sourceLineCount() const;
38 int destinationLineCount() const;
39
40 Type type() const { return m_type; }
41 void setType(Type type) { m_type = type; }
42
43 void add(Difference* diff);
44
45 QString recreateHunk() const;
46
47private:
48 int m_sourceLine;
49 int m_destinationLine;
50 DifferenceList m_differences;
51 QString m_function;
52 Type m_type;
53};
54
56using DiffHunkListIterator = QList<DiffHunk*>::iterator;
57using DiffHunkListConstIterator = QList<DiffHunk*>::const_iterator;
58
59} // End of namespace Diff2
60
61#endif
DiffHunk.
Definition diffhunk.h:23
A difference.
Definition difference.h:124
Diff2 namespace.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Apr 27 2024 22:10:24 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.