Xerces-C++ 3.2.4

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
25#include <xercesc/framework/psvi/XSObject.hpp>
26#include <xercesc/internal/XSerializable.hpp>
27
28 XERCES_CPP_NAMESPACE_BEGIN
29
37// forward declarations
38 class DOMNode;
39 class ContentHandler;
40
41 class XMLPARSER_EXPORT XSAnnotation : public XSerializable, public XSObject
42{
43 public:
44
45 // TargetType
46 enum ANNOTATION_TARGET {
50 W3C_DOM_ELEMENT = 1,
54 W3C_DOM_DOCUMENT = 2
55 };
56
57 // Constructors and Destructor
58 // -----------------------------------------------------------------------
61
68 XSAnnotation
69 (
70 const XMLCh* const contents
71 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
72 );
73
75
78 ~XSAnnotation();
80
81 //---------------------
85
96 void writeAnnotation(DOMNode* node, ANNOTATION_TARGET targetType);
97
105 void writeAnnotation(ContentHandler* handler);
106
110 const XMLCh *getAnnotationString() const;
111 XMLCh *getAnnotationString();
112
114
115 //----------------------------------
118 void setNext(XSAnnotation* const nextAnnotation);
119 XSAnnotation* getNext();
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)
140 XSAnnotation(MemoryManager* const manager);
141
142private:
143
144 // -----------------------------------------------------------------------
145 // Unimplemented constructors and operators
146 // -----------------------------------------------------------------------
147 XSAnnotation(const XSAnnotation&);
148 XSAnnotation & operator=(const XSAnnotation &);
149
150protected:
151
152 // -----------------------------------------------------------------------
153 // data members
154 // -----------------------------------------------------------------------
155 XMLCh* fContents;
156 XSAnnotation* fNext;
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
171 inline XMLCh *XSAnnotation::getAnnotationString()
172{
173 return fContents;
174}
175
176 inline void XSAnnotation::getLineCol(XMLFileLoc& line, XMLFileLoc& col) const
177{
178 line = fLine;
179 col = fCol;
180}
181
182 inline const XMLCh* XSAnnotation::getSystemId() const
183{
184 return fSystemId;
185}
186
187 inline void XSAnnotation::setLineCol(XMLFileLoc line, XMLFileLoc col)
188{
189 fLine = line;
190 fCol = col;
191}
192
193 XERCES_CPP_NAMESPACE_END
194
195#endif
XSObject.hpp
XMLPARSER_EXPORT
#define XMLPARSER_EXPORT
Definition: XercesDefs.hpp:163
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition: XercesDefs.hpp:112
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition: XercesDefs.hpp:113
XMLCh
uint16_t XMLCh
Definition: Xerces_autoconf_config.hpp:120
XMLFileLoc
XMLUInt64 XMLFileLoc
Definition: Xerces_autoconf_config.hpp:144
ContentHandler
Receive notification of general document events.
Definition: ContentHandler.hpp:61
DOMNode
The DOMNode interface is the primary datatype for the entire Document Object Model.
Definition: DOMNode.hpp:139
MemoryManager
Configurable memory manager.
Definition: MemoryManager.hpp:40
XMLPlatformUtils::fgMemoryManager
static MemoryManager * fgMemoryManager
The configurable memory manager.
Definition: PlatformUtils.hpp:121
XSAnnotation
Definition: XSAnnotation.hpp:42
XSAnnotation::~XSAnnotation
~XSAnnotation()
XSAnnotation::setSystemId
void setSystemId(const XMLCh *const systemId)
XSAnnotation::getSystemId
const XMLCh * getSystemId() const
Definition: XSAnnotation.hpp:182
XSAnnotation::writeAnnotation
void writeAnnotation(ContentHandler *handler)
Write contents of the annotation to the specified object.
XSAnnotation::getAnnotationString
const XMLCh * getAnnotationString() const
A text representation of annotation.
Definition: XSAnnotation.hpp:166
XSAnnotation::getNext
XSAnnotation * getNext()
XSAnnotation::writeAnnotation
void writeAnnotation(DOMNode *node, ANNOTATION_TARGET targetType)
Write contents of the annotation to the specified DOM object.
XSAnnotation::XSAnnotation
XSAnnotation(const XMLCh *const contents, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
The default constructor.
XSAnnotation::ANNOTATION_TARGET
ANNOTATION_TARGET
Definition: XSAnnotation.hpp:46
XSAnnotation::setNext
void setNext(XSAnnotation *const nextAnnotation)
methods needed by implementation
XSAnnotation::setLineCol
void setLineCol(XMLFileLoc line, XMLFileLoc col)
Setter.
Definition: XSAnnotation.hpp:187
XSAnnotation::getLineCol
void getLineCol(XMLFileLoc &line, XMLFileLoc &col) const
Getter.
Definition: XSAnnotation.hpp:176
XSObject
Definition: XSObject.hpp:43