1/*
2 * This file is part of KDevelop
3 * Copyright 2011 Dmitry Risenberg <dmitry.risenberg@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Library General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public
16 * License along with this program; if not, write to the
17 * Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21#ifndef MARKER_H
22#define MARKER_H
23
24#include <QList>
25#include "diff2export.h"
26
27namespace Diff2 {
28
29class DIFF2_EXPORT Marker
30{
31public:
32 enum Type { Start = 0, End = 1 };
33
34public:
35 Marker()
36 {
37 m_type = Marker::Start;
38 m_offset = 0;
39 }
40 Marker( enum Marker::Type type, unsigned int offset )
41 {
42 m_type = type;
43 m_offset = offset;
44 }
45 ~Marker() {}
46
47public:
48 enum Marker::Type type() const { return m_type; }
49 unsigned int offset() const { return m_offset; }
50
51 void setType ( enum Marker::Type type ) { m_type = type; }
52 void setOffset( unsigned int offset ) { m_offset = offset; }
53
54 bool operator == (const Marker& rhs) const {
55 return this->type() == rhs.type() && this->offset() == rhs.offset();
56 }
57
58private:
59 enum Marker::Type m_type;
60 unsigned int m_offset;
61};
62
63typedef QList<Marker*> MarkerList;
64typedef QList<Marker*>::iterator MarkerListIterator;
65typedef QList<Marker*>::const_iterator MarkerListConstIterator;
66
67}
68
69#endif // MARKER_H
70