KompareDiff2

differencestring.cpp
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#include "differencestring.h"
9#include "differencestring_p.h"
10
11namespace KompareDiff2
12{
13
14DifferenceString::DifferenceString()
15 : d_ptr(new DifferenceStringPrivate())
16{
17// qCDebug(KOMPAREDIFF2_LOG) << "DifferenceString::DifferenceString()";
18}
19
20DifferenceString::DifferenceString(const QString &string, const MarkerList &markerList)
21 : d_ptr(new DifferenceStringPrivate(string, markerList))
22{
23// qCDebug(KOMPAREDIFF2_LOG) << "DifferenceString::DifferenceString( " << string << ", " << markerList << " )";
24}
25
26DifferenceString::DifferenceString(const DifferenceString &ds)
27 : d_ptr(new DifferenceStringPrivate(*ds.d_ptr))
28{
29// qCDebug(KOMPAREDIFF2_LOG) << "DifferenceString::DifferenceString( const DifferenceString& " << ds << " )";
30}
31
32DifferenceString::~DifferenceString() = default;
33
34bool DifferenceString::operator==(const DifferenceString &ks) const
35{
36 Q_D(const DifferenceString);
37
38 return (*d == *ks.d_ptr);
39}
40
41QString DifferenceString::string() const
42{
43 Q_D(const DifferenceString);
44
45 return d->string;
46}
47
48QString DifferenceString::conflictString() const
49{
50 Q_D(const DifferenceString);
51
52 return d->conflict;
53}
54
55MarkerList DifferenceString::markerList() const
56{
57 Q_D(const DifferenceString);
58
59 return d->markerList;
60}
61
62void DifferenceString::setString(const QString &string)
63{
64 Q_D(DifferenceString);
65
66 d->string = string;
67 d->calculateHash();
68}
69
70void DifferenceString::setConflictString(const QString &conflict)
71{
72 Q_D(DifferenceString);
73
74 d->conflict = conflict;
75}
76
77void DifferenceString::setMarkerList(const MarkerList &markerList)
78{
79 Q_D(DifferenceString);
80
81 d->markerList = markerList;
82}
83
84void DifferenceString::prepend(Marker *marker)
85{
86 Q_D(DifferenceString);
87
88 d->markerList.prepend(marker);
89}
90
91}
KompareDiff2 namespace.
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:13:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.