source: icXML/icXML-devel/src/xercesc/dom/impl/DOMLocatorImpl.hpp @ 2722

Last change on this file since 2722 was 2722, checked in by cameron, 6 years ago

Original Xerces files with import mods for icxercesc

File size: 4.8 KB
Line 
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements.  See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License.  You may obtain a copy of the License at
8 *
9 *      http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/*
19 * $Id: DOMLocatorImpl.hpp 676853 2008-07-15 09:58:05Z borisk $
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_DOMLOCATORIMPL_HPP)
23#define XERCESC_INCLUDE_GUARD_DOMLOCATORIMPL_HPP
24
25#include <xercesc/dom/DOMLocator.hpp>
26
27XERCES_CPP_NAMESPACE_BEGIN
28
29/**
30  * Introduced in DOM Level 3
31  *
32  * Implementation of a DOMLocator interface.
33  *
34  * @see DOMLocator#DOMLocator
35  */
36
37class CDOM_EXPORT DOMLocatorImpl : public DOMLocator
38{
39public:
40    /** @name Constructors and Destructor */
41    //@{
42
43    /** Constructor */
44    DOMLocatorImpl();
45
46    DOMLocatorImpl
47    (
48          const XMLFileLoc lineNum
49        , const XMLFileLoc columnNum
50        , DOMNode* const errorNode
51        , const XMLCh* const uri
52        , const XMLFilePos offset = ~(XMLFilePos(0))
53        , const XMLFilePos utf16Offset = ~(XMLFilePos(0))
54    );
55
56    /** Desctructor */
57    virtual ~DOMLocatorImpl();
58
59    //@}
60
61    // DOMLocator interface
62    virtual XMLFileLoc getLineNumber() const;
63    virtual XMLFileLoc getColumnNumber() const;
64    virtual XMLFilePos getByteOffset() const;
65    virtual XMLFilePos getUtf16Offset() const;
66    virtual DOMNode* getRelatedNode() const;
67    virtual const XMLCh* getURI() const;
68
69    // Setter functions
70    void setLineNumber(const XMLFileLoc lineNumber);
71    void setColumnNumber(const XMLFileLoc columnNumber);
72    void setByteOffset(const XMLFilePos offset);
73    void setUtf16Offset(const XMLFilePos offset);
74    void setRelatedNode(DOMNode* const errorNode);
75    void setURI(const XMLCh* const uri);
76
77
78private :
79    /* Unimplemented constructors and operators */
80
81    /* Copy constructor */
82    DOMLocatorImpl(const DOMLocatorImpl&);
83
84    /* Assignment operator */
85    DOMLocatorImpl& operator=(const DOMLocatorImpl&);
86
87protected:
88    // -----------------------------------------------------------------------
89    //  Private data members
90    //
91    //  fLineNum
92    //  fColumnNum
93    //      Track line/column number of where the error occured
94    //
95    //  fByteOffset
96    //      Track byte offset in the input source where the error
97    //      occured
98    //
99    //  fUtf16Offset
100    //      Track character offset in the input source where the error
101    //      occured
102    //
103    //  fRelatedNode
104    //      Current node where the error occured
105    //
106    //  fURI
107    //      The uri where the error occured
108    // -----------------------------------------------------------------------
109    XMLFileLoc       fLineNum;
110    XMLFileLoc       fColumnNum;
111    XMLFilePos      fByteOffset;
112    XMLFilePos      fUtf16Offset;
113    DOMNode*        fRelatedNode;
114    const XMLCh*    fURI;
115};
116
117
118// ---------------------------------------------------------------------------
119//  DOMLocatorImpl: Getter methods
120// ---------------------------------------------------------------------------
121inline XMLFileLoc DOMLocatorImpl::getLineNumber() const
122{
123    return fLineNum;
124}
125
126inline XMLFileLoc DOMLocatorImpl::getColumnNumber() const
127{
128    return fColumnNum;
129}
130
131inline XMLFilePos DOMLocatorImpl::getByteOffset() const
132{
133    return fByteOffset;
134}
135
136inline XMLFilePos DOMLocatorImpl::getUtf16Offset() const
137{
138    return fUtf16Offset;
139}
140
141inline DOMNode* DOMLocatorImpl::getRelatedNode() const
142{
143    return fRelatedNode;
144}
145
146inline const XMLCh* DOMLocatorImpl::getURI() const
147{
148    return fURI;
149}
150
151
152// ---------------------------------------------------------------------------
153//  DOMLocatorImpl: Setter methods
154// ---------------------------------------------------------------------------
155inline void DOMLocatorImpl::setLineNumber(const XMLFileLoc lineNumber)
156{
157    fLineNum = lineNumber;
158}
159
160inline void DOMLocatorImpl::setColumnNumber(const XMLFileLoc columnNumber)
161{
162    fColumnNum = columnNumber;
163}
164
165inline void DOMLocatorImpl::setByteOffset(const XMLFilePos offset)
166{
167    fByteOffset = offset;
168}
169
170inline void DOMLocatorImpl::setUtf16Offset(const XMLFilePos offset)
171{
172    fUtf16Offset = offset;
173}
174
175inline void DOMLocatorImpl::setRelatedNode(DOMNode* const errorNode)
176{
177    fRelatedNode = errorNode;
178}
179
180inline void DOMLocatorImpl::setURI(const XMLCh* const uri)
181{
182    fURI = uri;
183}
184
185XERCES_CPP_NAMESPACE_END
186
187#endif
Note: See TracBrowser for help on using the repository browser.