Xerces-C++ 3.3.0
XSAnnotation.hpp
Go to the documentation of this file.
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$
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_XSANNOTATION_HPP)
23#define XERCESC_INCLUDE_GUARD_XSANNOTATION_HPP
24
26#include <xercesc/internal/XSerializable.hpp>
27
29
37// forward declarations
38class DOMNode;
39class ContentHandler;
40
41class XMLPARSER_EXPORT XSAnnotation : public XSerializable, public XSObject
42{
43public:
44
45 // TargetType
50 W3C_DOM_ELEMENT = 1,
54 W3C_DOM_DOCUMENT = 2
55 };
56
57 // Constructors and Destructor
58 // -----------------------------------------------------------------------
61
69 (
70 const XMLCh* const contents
72 );
73
75
80
81 //---------------------
85
96 void writeAnnotation(DOMNode* node, ANNOTATION_TARGET targetType);
97
106
110 const XMLCh *getAnnotationString() const;
111 XMLCh *getAnnotationString();
112
114
115 //----------------------------------
118 void setNext(XSAnnotation* const nextAnnotation);
121
122 //-----------------------------
125 inline void getLineCol(XMLFileLoc& line, XMLFileLoc& col) const;
126 inline const XMLCh* getSystemId() const;
128
129 //-----------------------------
132 inline void setLineCol(XMLFileLoc line, XMLFileLoc col);
133 void setSystemId(const XMLCh* const systemId);
135
136 /***
137 * Support for Serialization/De-serialization
138 ***/
139 DECL_XSERIALIZABLE(XSAnnotation)
141
142private:
143
144 // -----------------------------------------------------------------------
145 // Unimplemented constructors and operators
146 // -----------------------------------------------------------------------
148 XSAnnotation & operator=(const XSAnnotation &);
149
150protected:
151
152 // -----------------------------------------------------------------------
153 // data members
154 // -----------------------------------------------------------------------
155 XMLCh* fContents;
157
158private:
159
160 XMLCh* fSystemId;
161 XMLFileLoc fLine;
162 XMLFileLoc fCol;
163
164};
165
166inline const XMLCh *XSAnnotation::getAnnotationString() const
167{
168 return fContents;
169}
170
172{
173 return fContents;
174}
175
176inline void XSAnnotation::getLineCol(XMLFileLoc& line, XMLFileLoc& col) const
177{
178 line = fLine;
179 col = fCol;
180}
181
182inline const XMLCh* XSAnnotation::getSystemId() const
183{
184 return fSystemId;
185}
186
188{
189 fLine = line;
190 fCol = col;
191}
192
194
195#endif
#define XMLPARSER_EXPORT
Definition XercesDefs.hpp:163
#define XERCES_CPP_NAMESPACE_BEGIN
Definition XercesDefs.hpp:112
#define XERCES_CPP_NAMESPACE_END
Definition XercesDefs.hpp:113
char16_t XMLCh
Definition Xerces_autoconf_config.hpp:120
XMLUInt64 XMLFileLoc
Definition Xerces_autoconf_config.hpp:144
Receive notification of general document events.
Definition ContentHandler.hpp:61
The DOMNode interface is the primary datatype for the entire Document Object Model.
Definition DOMNode.hpp:139
Configurable memory manager.
Definition MemoryManager.hpp:40
static MemoryManager * fgMemoryManager
The configurable memory manager.
Definition PlatformUtils.hpp:121
Definition XSAnnotation.hpp:42
void setSystemId(const XMLCh *const systemId)
const XMLCh * getSystemId() const
Definition XSAnnotation.hpp:182
void writeAnnotation(ContentHandler *handler)
Write contents of the annotation to the specified object.
const XMLCh * getAnnotationString() const
A text representation of annotation.
Definition XSAnnotation.hpp:166
XSAnnotation * getNext()
void writeAnnotation(DOMNode *node, ANNOTATION_TARGET targetType)
Write contents of the annotation to the specified DOM object.
XSAnnotation(const XMLCh *const contents, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
The default constructor.
ANNOTATION_TARGET
Definition XSAnnotation.hpp:46
void setNext(XSAnnotation *const nextAnnotation)
methods needed by implementation
void setLineCol(XMLFileLoc line, XMLFileLoc col)
Setter.
Definition XSAnnotation.hpp:187
void getLineCol(XMLFileLoc &line, XMLFileLoc &col) const
Getter.
Definition XSAnnotation.hpp:176
Definition XSObject.hpp:43