KompareDiff2

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

KDE's Doxygen guidelines are available online.