KompareDiff2

marker.h
1/*
2 SPDX-FileCopyrightText: 2011 Dmitry Risenberg <dmitry.risenberg@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef KOMPAREDIFF2_MARKER_H
8#define KOMPAREDIFF2_MARKER_H
9
10// lib
11#include "komparediff2_export.h"
12// Qt
13#include <QList>
14
15namespace KompareDiff2
16{
17
18/**
19 * @class Marker marker.h <KompareDiff2/Marker>
20 *
21 * A Marker.
22 */
23class KOMPAREDIFF2_EXPORT Marker
24{
25public:
26 enum Type {
27 Start = 0,
28 End = 1,
29 };
30
31public:
32 Marker()
33 {
34 m_type = Marker::Start;
35 m_offset = 0;
36 }
37 Marker(Marker::Type type, unsigned int offset)
38 {
39 m_type = type;
40 m_offset = offset;
41 }
42 ~Marker() = default;
43
44public:
45 Marker::Type type() const
46 {
47 return m_type;
48 }
49 unsigned int offset() const
50 {
51 return m_offset;
52 }
53
54 void setType(Marker::Type type)
55 {
56 m_type = type;
57 }
58 void setOffset(unsigned int offset)
59 {
60 m_offset = offset;
61 }
62
63 bool operator==(const Marker &rhs) const
64 {
65 return this->type() == rhs.type() && this->offset() == rhs.offset();
66 }
67
68private:
69 Marker::Type m_type;
70 unsigned int m_offset;
71};
72
76
77}
78
79#endif // KOMPAREDIFF2_MARKER_H
KompareDiff2 namespace.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:50:47 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.