Xerces-C++  3.1.2
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: XSAnnotation.hpp 672273 2008-06-27 13:57:00Z borisk $
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
38 class DOMNode;
39 class ContentHandler;
40 
41 class XMLPARSER_EXPORT XSAnnotation : public XSerializable, public XSObject
42 {
43 public:
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 
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 
142 private:
143 
144  // -----------------------------------------------------------------------
145  // Unimplemented constructors and operators
146  // -----------------------------------------------------------------------
147  XSAnnotation(const XSAnnotation&);
148  XSAnnotation & operator=(const XSAnnotation &);
149 
150 protected:
151 
152  // -----------------------------------------------------------------------
153  // data members
154  // -----------------------------------------------------------------------
155  XMLCh* fContents;
156  XSAnnotation* fNext;
157 
158 private:
159 
160  XMLCh* fSystemId;
161  XMLFileLoc fLine;
162  XMLFileLoc fCol;
163 
164 };
165 
166 inline const XMLCh *XSAnnotation::getAnnotationString() const
167 {
168  return fContents;
169 }
170 
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 
188 {
189  fLine = line;
190  fCol = col;
191 }
192 
194 
195 #endif
const XMLCh * getSystemId() const
Definition: XSAnnotation.hpp:182
static MemoryManager * fgMemoryManager
The configurable memory manager.
Definition: PlatformUtils.hpp:121
XMLUInt64 XMLFileLoc
Definition: Xerces_autoconf_config.borland.hpp:116
#define XMLPARSER_EXPORT
Definition: XercesDefs.hpp:163
ANNOTATION_TARGET
Definition: XSAnnotation.hpp:46
Definition: XSAnnotation.hpp:41
Configurable memory manager.
Definition: MemoryManager.hpp:39
Receive notification of general document events.
Definition: ContentHandler.hpp:60
#define XERCES_CPP_NAMESPACE_BEGIN
Definition: XercesDefs.hpp:112
wchar_t XMLCh
Definition: Xerces_autoconf_config.borland.hpp:92
Definition: XSObject.hpp:42
#define XERCES_CPP_NAMESPACE_END
Definition: XercesDefs.hpp:113
The DOMNode interface is the primary datatype for the entire Document Object Model.
Definition: DOMNode.hpp:139
const XMLCh * getAnnotationString() const
A text representation of annotation.
Definition: XSAnnotation.hpp:166
void getLineCol(XMLFileLoc &line, XMLFileLoc &col) const
Getter.
Definition: XSAnnotation.hpp:176
void setLineCol(XMLFileLoc line, XMLFileLoc col)
Setter.
Definition: XSAnnotation.hpp:187