[2674] | 1 | #ifndef DOMLocator_HEADER_GUARD_ |
---|
| 2 | #define DOMLocator_HEADER_GUARD_ |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * Licensed to the Apache Software Foundation (ASF) under one or more |
---|
| 6 | * contributor license agreements. See the NOTICE file distributed with |
---|
| 7 | * this work for additional information regarding copyright ownership. |
---|
| 8 | * The ASF licenses this file to You under the Apache License, Version 2.0 |
---|
| 9 | * (the "License"); you may not use this file except in compliance with |
---|
| 10 | * the License. You may obtain a copy of the License at |
---|
| 11 | * |
---|
| 12 | * http://www.apache.org/licenses/LICENSE-2.0 |
---|
| 13 | * |
---|
| 14 | * Unless required by applicable law or agreed to in writing, software |
---|
| 15 | * distributed under the License is distributed on an "AS IS" BASIS, |
---|
| 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
| 17 | * See the License for the specific language governing permissions and |
---|
| 18 | * limitations under the License. |
---|
| 19 | */ |
---|
| 20 | |
---|
| 21 | /* |
---|
| 22 | * $Id: DOMLocator.hpp 568078 2007-08-21 11:43:25Z amassari $ |
---|
| 23 | */ |
---|
| 24 | |
---|
| 25 | #include <xercesc/util/XercesDefs.hpp> |
---|
| 26 | |
---|
| 27 | XERCES_CPP_NAMESPACE_BEGIN |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | class DOMNode; |
---|
| 31 | |
---|
| 32 | |
---|
| 33 | /** |
---|
| 34 | * DOMLocator is an interface that describes a location. (e.g. where an error |
---|
| 35 | * occured). |
---|
| 36 | * |
---|
| 37 | * @see DOMError#DOMError |
---|
| 38 | * @since DOM Level 3 |
---|
| 39 | */ |
---|
| 40 | |
---|
| 41 | class CDOM_EXPORT DOMLocator |
---|
| 42 | { |
---|
| 43 | protected: |
---|
| 44 | // ----------------------------------------------------------------------- |
---|
| 45 | // Hidden constructors |
---|
| 46 | // ----------------------------------------------------------------------- |
---|
| 47 | /** @name Hidden constructors */ |
---|
| 48 | //@{ |
---|
| 49 | DOMLocator() {}; |
---|
| 50 | //@} |
---|
| 51 | |
---|
| 52 | private: |
---|
| 53 | // ----------------------------------------------------------------------- |
---|
| 54 | // Unimplemented constructors and operators |
---|
| 55 | // ----------------------------------------------------------------------- |
---|
| 56 | /** @name Unimplemented constructors and operators */ |
---|
| 57 | //@{ |
---|
| 58 | DOMLocator(const DOMLocator &); |
---|
| 59 | DOMLocator & operator = (const DOMLocator &); |
---|
| 60 | //@} |
---|
| 61 | |
---|
| 62 | public: |
---|
| 63 | // ----------------------------------------------------------------------- |
---|
| 64 | // All constructors are hidden, just the destructor is available |
---|
| 65 | // ----------------------------------------------------------------------- |
---|
| 66 | /** @name Destructor */ |
---|
| 67 | //@{ |
---|
| 68 | /** |
---|
| 69 | * Destructor |
---|
| 70 | * |
---|
| 71 | */ |
---|
| 72 | virtual ~DOMLocator() {}; |
---|
| 73 | //@} |
---|
| 74 | |
---|
| 75 | // ----------------------------------------------------------------------- |
---|
| 76 | // Virtual DOMLocator interface |
---|
| 77 | // ----------------------------------------------------------------------- |
---|
| 78 | /** @name Functions introduced in DOM Level 3 */ |
---|
| 79 | //@{ |
---|
| 80 | // ----------------------------------------------------------------------- |
---|
| 81 | // Getter methods |
---|
| 82 | // ----------------------------------------------------------------------- |
---|
| 83 | /** |
---|
| 84 | * Get the line number where the error occured. The value is -1 if there is |
---|
| 85 | * no line number available. |
---|
| 86 | * |
---|
| 87 | * <p><b>"Experimental - subject to change"</b></p> |
---|
| 88 | * |
---|
| 89 | * @see #setLineNumber |
---|
| 90 | * @since DOM Level 3 |
---|
| 91 | */ |
---|
| 92 | virtual XMLSSize_t getLineNumber() const = 0; |
---|
| 93 | |
---|
| 94 | /** |
---|
| 95 | * Get the column number where the error occured. The value is -1 if there |
---|
| 96 | * is no column number available. |
---|
| 97 | * |
---|
| 98 | * <p><b>"Experimental - subject to change"</b></p> |
---|
| 99 | * |
---|
| 100 | * @see #setColumnNumber |
---|
| 101 | * @since DOM Level 3 |
---|
| 102 | */ |
---|
| 103 | virtual XMLSSize_t getColumnNumber() const = 0; |
---|
| 104 | |
---|
| 105 | /** |
---|
| 106 | * Get the byte or character offset into the input source, if we're parsing |
---|
| 107 | * a file or a byte stream then this will be the byte offset into that |
---|
| 108 | * stream, but if a character media is parsed then the offset will be the |
---|
| 109 | * character offset. The value is -1 if there is no offset available. |
---|
| 110 | * |
---|
| 111 | * <p><b>"Experimental - subject to change"</b></p> |
---|
| 112 | * |
---|
| 113 | * @see #setOffset |
---|
| 114 | * @since DOM Level 3 |
---|
| 115 | */ |
---|
| 116 | virtual XMLSSize_t getOffset() const = 0; |
---|
| 117 | |
---|
| 118 | /** |
---|
| 119 | * Get the DOMNode where the error occured, or <code>null</code> if there |
---|
| 120 | * is no node available. |
---|
| 121 | * |
---|
| 122 | * <p><b>"Experimental - subject to change"</b></p> |
---|
| 123 | * |
---|
| 124 | * @see #setErrorNode |
---|
| 125 | * @since DOM Level 3 |
---|
| 126 | */ |
---|
| 127 | virtual DOMNode* getErrorNode() const = 0; |
---|
| 128 | |
---|
| 129 | /** |
---|
| 130 | * Get the URI where the error occured, or <code>null</code> if there is no |
---|
| 131 | * URI available. |
---|
| 132 | * |
---|
| 133 | * <p><b>"Experimental - subject to change"</b></p> |
---|
| 134 | * |
---|
| 135 | * @see #setURI |
---|
| 136 | * @since DOM Level 3 |
---|
| 137 | */ |
---|
| 138 | virtual const XMLCh* getURI() const = 0; |
---|
| 139 | |
---|
| 140 | // ----------------------------------------------------------------------- |
---|
| 141 | // Setter methods |
---|
| 142 | // ----------------------------------------------------------------------- |
---|
| 143 | /** |
---|
| 144 | * Set the line number of the error |
---|
| 145 | * |
---|
| 146 | * <p><b>"Experimental - subject to change"</b></p> |
---|
| 147 | * |
---|
| 148 | * @param lineNumber the line number to set |
---|
| 149 | * |
---|
| 150 | * @see #getLinNumner |
---|
| 151 | * @since DOM Level 3 |
---|
| 152 | */ |
---|
| 153 | virtual void setLineNumber(const XMLSSize_t lineNumber) = 0; |
---|
| 154 | |
---|
| 155 | /** |
---|
| 156 | * Set the column number of the error |
---|
| 157 | * |
---|
| 158 | * <p><b>"Experimental - subject to change"</b></p> |
---|
| 159 | * |
---|
| 160 | * @param columnNumber the column number to set. |
---|
| 161 | * |
---|
| 162 | * @see #getColumnNumner |
---|
| 163 | * @since DOM Level 3 |
---|
| 164 | */ |
---|
| 165 | virtual void setColumnNumber(const XMLSSize_t columnNumber) = 0; |
---|
| 166 | |
---|
| 167 | /** |
---|
| 168 | * Set the byte/character offset. |
---|
| 169 | * |
---|
| 170 | * <p><b>"Experimental - subject to change"</b></p> |
---|
| 171 | * |
---|
| 172 | * @param offset the byte/characte offset to set. |
---|
| 173 | * |
---|
| 174 | * @see #getOffset |
---|
| 175 | * @since DOM Level 3 |
---|
| 176 | */ |
---|
| 177 | virtual void setOffset(const XMLSSize_t offset) = 0; |
---|
| 178 | |
---|
| 179 | /** |
---|
| 180 | * Set the DOMNode where the error occured |
---|
| 181 | * |
---|
| 182 | * <p><b>"Experimental - subject to change"</b></p> |
---|
| 183 | * |
---|
| 184 | * @param errorNode the DOMNode to set |
---|
| 185 | * |
---|
| 186 | * @see #getErrorNode |
---|
| 187 | * @since DOM Level 3 |
---|
| 188 | */ |
---|
| 189 | virtual void setErrorNode(DOMNode* const errorNode) = 0; |
---|
| 190 | |
---|
| 191 | /** |
---|
| 192 | * Set the URI where the error occured |
---|
| 193 | * |
---|
| 194 | * <p><b>"Experimental - subject to change"</b></p> |
---|
| 195 | * |
---|
| 196 | * @param uri the URI to set. |
---|
| 197 | * |
---|
| 198 | * @see #getURI |
---|
| 199 | * @since DOM Level 3 |
---|
| 200 | */ |
---|
| 201 | virtual void setURI(const XMLCh* const uri) = 0; |
---|
| 202 | |
---|
| 203 | //@} |
---|
| 204 | }; |
---|
| 205 | |
---|
| 206 | XERCES_CPP_NAMESPACE_END |
---|
| 207 | |
---|
| 208 | #endif |
---|