source: icXML/icXML-devel/src/xercesc/sax/Locator.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: 3.9 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: Locator.hpp 672273 2008-06-27 13:57:00Z borisk $
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_LOCATOR_HPP)
23#define XERCESC_INCLUDE_GUARD_LOCATOR_HPP
24
25#include <xercesc/util/XercesDefs.hpp>
26
27XERCES_CPP_NAMESPACE_BEGIN
28
29/**
30  * Interface for associating a SAX event with a document location.
31  *
32  * <p>If a SAX parser provides location information to the SAX
33  * application, it does so by implementing this interface and then
34  * passing an instance to the application using the document
35  * handler's setDocumentLocator method.  The application can use the
36  * object to obtain the location of any other document handler event
37  * in the XML source document.</p>
38  *
39  * <p>Note that the results returned by the object will be valid only
40  * during the scope of each document handler method: the application
41  * will receive unpredictable results if it attempts to use the
42  * locator at any other time.</p>
43  *
44  * <p>SAX parsers are not required to supply a locator, but they are
45  * very strong encouraged to do so.  If the parser supplies a
46  * locator, it must do so before reporting any other document events.
47  * If no locator has been set by the time the application receives
48  * the startDocument event, the application should assume that a
49  * locator is not available.</p>
50  *
51  * @see DocumentHandler#setDocumentLocator
52  */
53
54class SAX_EXPORT Locator
55{
56public:
57
58    /** @name Constructors and Destructor */
59    //@{
60    /** Default constructor */
61    Locator()
62    {
63    }
64
65    /** Destructor */
66    virtual ~Locator()
67    {
68    }
69
70    //@}
71
72    /** @name The locator interface */
73    //@{
74  /**
75    * Return the public identifier for the current document event.
76    * <p>This will be the public identifier
77    * @return A string containing the public identifier, or
78    *         null if none is available.
79    * @see #getSystemId
80    */
81    virtual const XMLCh* getPublicId() const = 0;
82
83  /**
84    * Return the system identifier for the current document event.
85    *
86    * <p>If the system identifier is a URL, the parser must resolve it
87    * fully before passing it to the application.</p>
88    *
89    * @return A string containing the system identifier, or null
90    *         if none is available.
91    * @see #getPublicId
92    */
93    virtual const XMLCh* getSystemId() const = 0;
94
95  /**
96    * Return the line number where the current document event ends.
97    * Note that this is the line position of the first character
98    * after the text associated with the document event.
99    * @return The line number, or 0 if none is available.
100    * @see #getColumnNumber
101    */
102    virtual XMLFileLoc getLineNumber() const = 0;
103
104  /**
105    * Return the column number where the current document event ends.
106    * Note that this is the column number of the first
107    * character after the text associated with the document
108    * event.  The first column in a line is position 1.
109    * @return The column number, or 0 if none is available.
110    * @see #getLineNumber
111    */
112    virtual XMLFileLoc getColumnNumber() const = 0;
113    //@}
114
115private :
116    /* Copy constructor */
117    Locator(const Locator&);
118
119    /* Assignment operator */
120    Locator& operator=(const Locator&);
121};
122
123XERCES_CPP_NAMESPACE_END
124
125#endif
Note: See TracBrowser for help on using the repository browser.