source: icXML/icXML-devel/src/xercesc/validators/schema/XSDLocator.hpp

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

Updates to xercesc sources

File size: 4.5 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: XSDLocator.hpp 672273 2008-06-27 13:57:00Z borisk $
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_XSDLOCATOR_HPP)
23#define XERCESC_INCLUDE_GUARD_XSDLOCATOR_HPP
24
25/**
26  * A Locator implementation
27  */
28
29#include <xercesc/util/XMemory.hpp>
30#include <xercesc/sax/Locator.hpp>
31
32XERCES_CPP_NAMESPACE_BEGIN
33
34class VALIDATORS_EXPORT XSDLocator: public XMemory, public Locator
35{
36public:
37
38    /** @name Constructors and Destructor */
39    //@{
40    /** Default constructor */
41    XSDLocator();
42
43    /** Destructor */
44    virtual ~XSDLocator()
45    {
46    }
47
48    //@}
49
50
51
52    virtual void getLocationInfo(LocationInfo & locationInfo) const;
53
54    /** @name The locator interface */
55    //@{
56  /**
57    * Return the public identifier for the current document event.
58    * <p>This will be the public identifier
59    * @return A string containing the public identifier, or
60    *         null if none is available.
61    * @see #getSystemId
62    */
63    virtual const XMLCh* getPublicId() const;
64
65  /**
66    * Return the system identifier for the current document event.
67    *
68    * <p>If the system identifier is a URL, the parser must resolve it
69    * fully before passing it to the application.</p>
70    *
71    * @return A string containing the system identifier, or null
72    *         if none is available.
73    * @see #getPublicId
74    */
75    virtual const XMLCh* getSystemId() const;
76
77  /**
78    * Return the line number where the current document event ends.
79    * Note that this is the line position of the first character
80    * after the text associated with the document event.
81    * @return The line number, or 0 if none is available.
82    * @see #getColumnNumber
83    */
84    virtual XMLFileLoc getLineNumber() const;
85
86  /**
87    * Return the column number where the current document event ends.
88    * Note that this is the column number of the first
89    * character after the text associated with the document
90    * event.  The first column in a line is position 1.
91    * @return The column number, or 0 if none is available.
92    * @see #getLineNumber
93    */
94    virtual XMLFileLoc getColumnNumber() const;
95    //@}
96
97    // -----------------------------------------------------------------------
98    //  Setter methods
99    // -----------------------------------------------------------------------
100    void setValues(const XMLCh* const systemId,
101                   const XMLCh* const publicId,
102                   const XMLFileLoc lineNo, const XMLFileLoc columnNo);
103
104private :
105    // -----------------------------------------------------------------------
106    //  Unimplemented constructors and destructor
107    // -----------------------------------------------------------------------
108    XSDLocator(const XSDLocator&);
109    XSDLocator& operator=(const XSDLocator&);
110
111    // -----------------------------------------------------------------------
112    //  Private data members
113    // -----------------------------------------------------------------------
114    XMLFileLoc fLineNo;
115    XMLFileLoc fColumnNo;
116    const XMLCh* fSystemId;
117    const XMLCh* fPublicId;
118};
119
120// ---------------------------------------------------------------------------
121//  XSDLocator: Getter methods
122// ---------------------------------------------------------------------------
123inline XMLFileLoc XSDLocator::getLineNumber() const
124{
125    return fLineNo;
126}
127
128inline XMLFileLoc XSDLocator::getColumnNumber() const
129{
130    return fColumnNo;
131}
132
133inline const XMLCh* XSDLocator::getPublicId() const
134{
135    return fPublicId;
136}
137
138inline const XMLCh* XSDLocator::getSystemId() const
139{
140    return fSystemId;
141}
142
143inline void XSDLocator::getLocationInfo(LocationInfo & locationInfo) const
144{
145    locationInfo.systemId = fSystemId;
146    locationInfo.publicId = fPublicId;
147    locationInfo.lineNumber = fLineNo;
148    locationInfo.colNumber = fColumnNo;
149}
150
151XERCES_CPP_NAMESPACE_END
152
153#endif
Note: See TracBrowser for help on using the repository browser.