Xalan-C++ API Reference 1.12.0
XercesToXalanNodeMap.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#if !defined(XERCESTOXALANNODEMAP_HEADER_GUARD_1357924680)
19#define XERCESTOXALANNODEMAP_HEADER_GUARD_1357924680
20
21
22
24
25
26
27#include <map>
28
29
30
31#if XERCES_VERSION_MAJOR >= 2
32#include <xercesc/dom/deprecated/DOM_Node.hpp>
33#else
34#include <xercesc/dom/DOM_Node.hpp>
35#endif
36
37
38
40
41
42
43namespace XERCES_CPP_NAMESPACE
44{
45 class NodeImpl;
46}
47
48
49
50namespace XALAN_CPP_NAMESPACE {
51
52
53
54class XalanNode;
55
56
57/**
58 * This class is deprecated.
59 *
60 * @deprecated This class works with the deprecated Xerces DOM bridge.
61 */
63{
64public:
65
66 typedef xercesc::DOM_Node DOM_NodeType;
67 typedef xercesc::NodeImpl NodeImplType;
68
69 typedef std::map<XalanNode*, NodeImplType*> XalanNodeMapType;
70
71 typedef std::map<NodeImplType*, XalanNode*> XercesNodeMapType;
72
74
76
77 void
81
82 void
84
87 {
88 return getNode(XercesDOM_NodeHack::getImpl(theXercesNode));
89 }
90
93 {
94 const XercesNodeMapType::const_iterator i =
95 m_xercesMap.find(theXercesNodeImpl);
96
97 if (i == m_xercesMap.end())
98 {
99 return 0;
100 }
101 else
102 {
103 return (*i).second;
104 }
105 }
106
109 {
110 return XercesDOM_NodeHack(getNodeImpl(theXalanNode));
111 }
112
115
117 {
118 public:
119
121 m_value(theXalanNode)
122 {
123 }
124
125 bool
126 operator()(const XercesNodeMapType::value_type& thePair) const
127 {
128 return m_value == thePair.second;
129 }
130
131 private:
132
133 const XalanNode* m_value;
134 };
135
138 {
139 return XercesDOM_NodeHack::getImpl(theXercesNode);
140 }
141
142private:
143
144 XalanNodeMapType m_xalanMap;
145
146 XercesNodeMapType m_xercesMap;
147};
148
149
150
151}
152
153
154
155#endif // !defined(XERCESTOXALANNODEMAP_HEADER_GUARD_1357924680)
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
#define XALAN_XERCESPARSERLIAISON_EXPORT
This class is deprecated.
bool operator()(const XercesNodeMapType::value_type &thePair) const
XalanNode * getNode(const DOM_NodeType &theXercesNode) const
std::map< XalanNode *, NodeImplType * > XalanNodeMapType
void addAssociation(const DOM_NodeType &theXercesNode, XalanNode *theXalanNode)
std::map< NodeImplType *, XalanNode * > XercesNodeMapType
XalanNode * getNode(NodeImplType *theXercesNodeImpl) const
NodeImplType * getNodeImpl(const DOM_NodeType &theXercesNode) const
DOM_NodeType getNode(const XalanNode *theXalanNode) const
NodeImplType * getNodeImpl(const XalanNode *theXalanNode) const
xercesc::NodeImpl NodeImplType
xercesc::DOM_Node DOM_NodeType