Xalan-C++ API Reference  1.12.0
XercesDOM_NodeHack.hpp
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #if !defined(XERCESDOM_NODEHACK_HEADER_GUARD_1357924680)
20 #define XERCESDOM_NODEHACK_HEADER_GUARD_1357924680
21 
22 
23 
25 
26 
27 
28 #if XERCES_VERSION_MAJOR >= 2
29 #include <xercesc/dom/deprecated/DOM_Node.hpp>
30 #include <xercesc/dom/deprecated/DOM_Attr.hpp>
31 #include <xercesc/dom/deprecated/DOM_Element.hpp>
32 #include <xercesc/dom/deprecated/DOM_Text.hpp>
33 #else
34 #include <xercesc/dom/DOM_Node.hpp>
35 #include <xercesc/dom/DOM_Attr.hpp>
36 #include <xercesc/dom/DOM_Element.hpp>
37 #include <xercesc/dom/DOM_Text.hpp>
38 #endif
39 
40 
41 
43 
44 
45 
46 namespace XALAN_CPP_NAMESPACE {
47 
48 
49 /**
50  * This class is deprecated.
51  *
52  * An evil class to hack the Xerces smart-pointer class. I'm
53  * only doing this because I have to...
54  *
55  * @deprecated This class is part of the deprecated Xerces DOM bridge.
56  */
57 class XALAN_XERCESPARSERLIAISON_EXPORT XercesDOM_NodeHack : public xercesc::DOM_Node
58 {
59 public:
60 
61  typedef xercesc::DOM_Node ParentType;
62 
63  XercesDOM_NodeHack(NodeImplType* theImpl = 0);
64 
66 
68  getImpl() const
69  {
70  return fImpl;
71  }
72 
73  static NodeImplType*
74  getImpl(const ParentType& theNode)
75  {
76  return static_cast<const XercesDOM_NodeHack&>(theNode).getImpl();
77  }
78 };
79 
80 
81 
82 class XALAN_XERCESPARSERLIAISON_EXPORT XercesDOM_AttrHack : public xercesc::DOM_Attr
83 {
84 public:
85 
86  typedef xercesc::DOM_Attr ParentType;
87 
88  XercesDOM_AttrHack(AttrImplType* theImpl = 0);
89 
90  XercesDOM_AttrHack(const ParentType& theSource);
91 
93 };
94 
95 
96 
97 class XALAN_XERCESPARSERLIAISON_EXPORT XercesDOM_ElementHack : public xercesc::DOM_Element
98 {
99 public:
100 
101  typedef xercesc::DOM_Element ParentType;
102 
104 
105  XercesDOM_ElementHack(const ParentType& theSource);
106 
108 
109 
110  const DOMStringType
111  getNodeNameImpl() const;
112 
113  const DOMStringType
114  getNodeValueImpl() const;
115 
116  const DOMStringType
117  getNamespaceURIImpl() const;
118 
119  const DOMStringType
120  getPrefixImpl() const;
121 
122  const DOMStringType
123  getLocalNameImpl() const;
124 
125  const DOMStringType
126  getTagNameImpl() const;
127 
128  const DOMStringType
129  getAttributeImpl(const DOMStringType& name) const;
130 
131  const DOMStringType
132  getAttributeNSImpl(
133  const DOMStringType& namespaceURI,
134  const DOMStringType& localName) const;
135 
137  getImpl() const
138  {
139  return reinterpret_cast<ElementImplType*>(fImpl);
140  }
141 
142  static ElementImplType*
143  getImpl(const ParentType& theNode)
144  {
145  return static_cast<const XercesDOM_ElementHack&>(theNode).getImpl();
146  }
147 };
148 
149 
150 
151 class XALAN_XERCESPARSERLIAISON_EXPORT XercesDOM_TextHack : public xercesc::DOM_Text
152 {
153 public:
154 
155  typedef xercesc::DOM_Text ParentType;
156 
157  XercesDOM_TextHack(TextImplType* theImpl = 0);
158 
159  XercesDOM_TextHack(const ParentType& theSource);
160 
162 
163 
164  const DOMStringType
165  getNodeNameImpl() const;
166 
167  const DOMStringType
168  getNodeValueImpl() const;
169 
170  const DOMStringType
171  getNamespaceURIImpl() const;
172 
173  const DOMStringType
174  getPrefixImpl() const;
175 
176  const DOMStringType
177  getLocalNameImpl() const;
178 
179  const DOMStringType
180  getDataImpl() const;
181 
182  TextImplType*
183  getImpl() const
184  {
185  return reinterpret_cast<TextImplType*>(fImpl);
186  }
187 
188  static TextImplType*
189  getImpl(const ParentType& theNode)
190  {
191  return static_cast<const XercesDOM_TextHack&>(theNode).getImpl();
192  }
193 };
194 
195 
196 
197 }
198 
199 
200 
201 #endif // !defined(XERCESDOM_NODEHACK_HEADER_GUARD_1357924680)
xalanc::XercesDOM_TextHack
Definition: XercesDOM_NodeHack.hpp:151
xalanc::XercesDOM_TextHack::ParentType
xercesc::DOM_Text ParentType
Definition: XercesDOM_NodeHack.hpp:155
xalanc::XercesDOM_NodeHack
This class is deprecated.
Definition: XercesDOM_NodeHack.hpp:57
XALAN_CPP_NAMESPACE
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Definition: XalanVersion.hpp:76
xalanc::XercesDOM_TextHack::getImpl
TextImplType * getImpl() const
Definition: XercesDOM_NodeHack.hpp:183
xalanc::XercesDOM_AttrHack
Definition: XercesDOM_NodeHack.hpp:82
xalanc::NodeImplType
xercesc::NodeImpl NodeImplType
Definition: XercesBridgeTypes.hpp:84
xalanc::TextImplType
xercesc::TextImpl TextImplType
Definition: XercesBridgeTypes.hpp:85
xalanc::XercesDOM_NodeHack::ParentType
xercesc::DOM_Node ParentType
Definition: XercesDOM_NodeHack.hpp:61
xalanc::XercesDOM_TextHack::getImpl
static TextImplType * getImpl(const ParentType &theNode)
Definition: XercesDOM_NodeHack.hpp:189
xalanc::XercesDOM_ElementHack
Definition: XercesDOM_NodeHack.hpp:97
xalanc::XercesDOM_NodeHack::getImpl
static NodeImplType * getImpl(const ParentType &theNode)
Definition: XercesDOM_NodeHack.hpp:74
XercesParserLiaisonDefinitions.hpp
xalanc::XercesDOM_ElementHack::getImpl
static ElementImplType * getImpl(const ParentType &theNode)
Definition: XercesDOM_NodeHack.hpp:143
xalanc::XercesDOM_ElementHack::getImpl
ElementImplType * getImpl() const
Definition: XercesDOM_NodeHack.hpp:137
XALAN_XERCESPARSERLIAISON_EXPORT
#define XALAN_XERCESPARSERLIAISON_EXPORT
Definition: XercesParserLiaisonDefinitions.hpp:39
xalanc::DOMStringType
xercesc::DOMString DOMStringType
Definition: XercesBridgeTypes.hpp:86
xalanc::ElementImplType
xercesc::ElementImpl ElementImplType
Definition: XercesBridgeTypes.hpp:83
xalanc::AttrImplType
xercesc::AttrImpl AttrImplType
Definition: XercesBridgeTypes.hpp:82
xalanc::XercesDOM_ElementHack::ParentType
xercesc::DOM_Element ParentType
Definition: XercesDOM_NodeHack.hpp:101
XercesBridgeTypes.hpp
xalanc::XercesDOM_AttrHack::ParentType
xercesc::DOM_Attr ParentType
Definition: XercesDOM_NodeHack.hpp:86
xalanc::XercesDOM_NodeHack::getImpl
NodeImplType * getImpl() const
Definition: XercesDOM_NodeHack.hpp:68