]> err.no Git - sope/blob - sope-xml/SaxObjC/SaxLocator.m
fixed a header file
[sope] / sope-xml / SaxObjC / SaxLocator.m
1 /*
2   Copyright (C) 2000-2004 SKYRIX Software AG
3
4   This file is part of OpenGroupware.org.
5
6   OGo is free software; you can redistribute it and/or modify it under
7   the terms of the GNU Lesser General Public License as published by the
8   Free Software Foundation; either version 2, or (at your option) any
9   later version.
10
11   OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12   WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
14   License for more details.
15
16   You should have received a copy of the GNU Lesser General Public
17   License along with OGo; see the file COPYING.  If not, write to the
18   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19   02111-1307, USA.
20 */
21 // $Id$
22
23 #include "SaxLocator.h"
24 #include "common.h"
25
26 @implementation SaxLocator
27
28 - (id)init {
29   return self;
30 }
31 - (id)initWithLocator:(id<SaxLocator>)_locator {
32   if ((self = [self init])) {
33     self->column = [_locator columnNumber];
34     self->line   = [_locator lineNumber];
35     self->pubId  = [[_locator publicId] copy];
36     self->sysId  = [[_locator systemId] copy];
37   }
38   return self;
39 }
40
41 - (void)dealloc {
42   [self->pubId release];
43   [self->sysId release];
44   [super dealloc];
45 }
46
47 /* accessors */
48
49 - (void)setColumnNumber:(int)_col {
50   self->column = _col;
51 }
52 - (int)columnNumber {
53   return self->column;
54 }
55
56 - (void)setLineNumber:(int)_line {
57   self->line = _line;
58 }
59 - (int)lineNumber {
60   return self->line;
61 }
62
63 - (void)setPublicId:(NSString *)_pubId {
64   id o = self->pubId;
65   self->pubId = [_pubId copy];
66   [o release];
67 }
68 - (NSString *)publicId {
69   return self->pubId;
70 }
71
72 - (void)setSystemId:(NSString *)_sysId {
73   id o = self->sysId;
74   self->sysId = [_sysId copy];
75   [o release];
76 }
77 - (NSString *)systemId {
78   return self->sysId;
79 }
80
81 /* NSCopying */
82
83 - (id)copyWithZone:(NSZone *)_zone {
84   return [[[self class] allocWithZone:_zone] initWithLocator:self];
85 }
86
87 @end /* SaxLocator */