~ubuntu-branches/ubuntu/gutsy/soprano/gutsy

« back to all changes in this revision

Viewing changes to soprano/locator.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-10-12 14:43:48 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20071012144348-yajzi51v4k23ahxf
Tags: 1.95.0~beta2-1ubuntu1
* Sync with Debian
* Add versioned build-dep on raptor

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of Soprano Project.
 
3
 *
 
4
 * Copyright (C) 2007 Daniele Galdi <daniele.galdi@gmail.com>
 
5
 *
 
6
 * This library is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU Library General Public
 
8
 * License as published by the Free Software Foundation; either
 
9
 * version 2 of the License, or (at your option) any later version.
 
10
 *
 
11
 * This library is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
 * Library General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU Library General Public License
 
17
 * along with this library; see the file COPYING.LIB.  If not, write to
 
18
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
19
 * Boston, MA 02110-1301, USA.
 
20
 */
 
21
 
 
22
#include "locator.h"
 
23
 
 
24
class Soprano::Error::Locator::Private: public QSharedData {
 
25
public:
 
26
    Private()
 
27
        : line(-1),
 
28
          column(-1),
 
29
          byte(-1)
 
30
    {};
 
31
 
 
32
    int line;
 
33
    int column;
 
34
    int byte;
 
35
    QString fileName;
 
36
};
 
37
 
 
38
Soprano::Error::Locator::Locator()
 
39
{
 
40
    d = new Private();
 
41
}
 
42
 
 
43
Soprano::Error::Locator::Locator( const Locator &other )
 
44
{
 
45
    d = other.d;
 
46
}
 
47
 
 
48
Soprano::Error::Locator::Locator( int line, int column, int byte, const QString& filename )
 
49
    : d( new Private() )
 
50
{
 
51
    d->line = line;
 
52
    d->column = column;
 
53
    d->byte = byte;
 
54
    d->fileName = filename;
 
55
}
 
56
 
 
57
Soprano::Error::Locator::~Locator()
 
58
{
 
59
}
 
60
 
 
61
Soprano::Error::Locator& Soprano::Error::Locator::operator=( const Locator &other )
 
62
{
 
63
    d = other.d;
 
64
    return *this;
 
65
}
 
66
 
 
67
int Soprano::Error::Locator::line() const
 
68
{
 
69
    return d->line;
 
70
}
 
71
 
 
72
void Soprano::Error::Locator::setLine( int line )
 
73
{
 
74
    d->line = line;
 
75
}
 
76
 
 
77
int Soprano::Error::Locator::column() const
 
78
{
 
79
    return d->column;
 
80
}
 
81
 
 
82
void Soprano::Error::Locator::setColumn( int column )
 
83
{
 
84
    d->column = column;
 
85
}
 
86
 
 
87
int Soprano::Error::Locator::byte() const
 
88
{
 
89
    return d->byte;
 
90
}
 
91
 
 
92
void Soprano::Error::Locator::setByte( int byte )
 
93
{
 
94
   d->byte = byte;
 
95
}
 
96
 
 
97
QString Soprano::Error::Locator::fileName() const
 
98
{
 
99
    return d->fileName;
 
100
}
 
101
 
 
102
void Soprano::Error::Locator::setFileName( const QString& fileName )
 
103
{
 
104
    d->fileName = fileName;
 
105
}