source: icXML/icXML-devel/src/xercesc/validators/schema/XSDLocator.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.2 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    /** @name The locator interface */
51    //@{
52  /**
53    * Return the public identifier for the current document event.
54    * <p>This will be the public identifier
55    * @return A string containing the public identifier, or
56    *         null if none is available.
57    * @see #getSystemId
58    */
59    virtual const XMLCh* getPublicId() const;
60
61  /**
62    * Return the system identifier for the current document event.
63    *
64    * <p>If the system identifier is a URL, the parser must resolve it
65    * fully before passing it to the application.</p>
66    *
67    * @return A string containing the system identifier, or null
68    *         if none is available.
69    * @see #getPublicId
70    */
71    virtual const XMLCh* getSystemId() const;
72
73  /**
74    * Return the line number where the current document event ends.
75    * Note that this is the line position of the first character
76    * after the text associated with the document event.
77    * @return The line number, or 0 if none is available.
78    * @see #getColumnNumber
79    */
80    virtual XMLFileLoc getLineNumber() const;
81
82  /**
83    * Return the column number where the current document event ends.
84    * Note that this is the column number of the first
85    * character after the text associated with the document
86    * event.  The first column in a line is position 1.
87    * @return The column number, or 0 if none is available.
88    * @see #getLineNumber
89    */
90    virtual XMLFileLoc getColumnNumber() const;
91    //@}
92
93    // -----------------------------------------------------------------------
94    //  Setter methods
95    // -----------------------------------------------------------------------
96    void setValues(const XMLCh* const systemId,
97                   const XMLCh* const publicId,
98                   const XMLFileLoc lineNo, const XMLFileLoc columnNo);
99
100private :
101    // -----------------------------------------------------------------------
102    //  Unimplemented constructors and destructor
103    // -----------------------------------------------------------------------
104    XSDLocator(const XSDLocator&);
105    XSDLocator& operator=(const XSDLocator&);
106
107    // -----------------------------------------------------------------------
108    //  Private data members
109    // -----------------------------------------------------------------------
110    XMLFileLoc fLineNo;
111    XMLFileLoc fColumnNo;
112    const XMLCh* fSystemId;
113    const XMLCh* fPublicId;
114};
115
116// ---------------------------------------------------------------------------
117//  XSDLocator: Getter methods
118// ---------------------------------------------------------------------------
119inline XMLFileLoc XSDLocator::getLineNumber() const
120{
121    return fLineNo;
122}
123
124inline XMLFileLoc XSDLocator::getColumnNumber() const
125{
126    return fColumnNo;
127}
128
129inline const XMLCh* XSDLocator::getPublicId() const
130{
131    return fPublicId;
132}
133
134inline const XMLCh* XSDLocator::getSystemId() const
135{
136    return fSystemId;
137}
138
139XERCES_CPP_NAMESPACE_END
140
141#endif
Note: See TracBrowser for help on using the repository browser.