Xalan-C++ API Reference  1.12.0
XercesWrapperNavigator.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(XERCESWRAPPERNAVIGATOR_HEADER_GUARD_1357924680)
19 #define XERCESWRAPPERNAVIGATOR_HEADER_GUARD_1357924680
20 
21 
22 
24 
25 
26 
27 #include <cassert>
28 
29 
30 
31 #include <xercesc/util/XercesDefs.hpp>
32 
33 
34 
37 
38 
39 
41 
42 
43 
44 namespace XALAN_CPP_NAMESPACE {
45 
46 
47 
48 class XercesDocumentWrapper;
49 class XalanAttr;
50 class XalanElement;
51 class XalanText;
52 
53 
54 
56 {
57 public:
58 
60 
61  explicit
62  XercesWrapperNavigator(XercesDocumentWrapper* theOwnerDocument = 0);
63 
65 
66  virtual
68 
69 
72  {
73  return m_ownerDocument;
74  }
75 
76  void
78  {
79  m_ownerDocument = theDocument;
80  }
81 
82  XalanNode*
83  mapNode(const DOMNodeType* theXercesNode) const;
84 
85  XalanAttr*
86  mapNode(const DOMAttrType* theXercesNode) const;
87 
88  const DOMNodeType*
89  mapNode(XalanNode* theXalanNode) const;
90 
91  IndexType
92  getIndex() const
93  {
94  return m_index;
95  }
96 
97  void
98  setIndex(IndexType theIndex)
99  {
100  m_index = theIndex;
101  }
102 
103  XalanNode*
104  getParentNode(const DOMNodeType* theXercesNode) const;
105 
106  XalanNode*
108  {
109  return m_parentNode;
110  }
111 
112  void
114  {
115  m_parentNode = theParent;
116  }
117 
118  XalanNode*
119  getPreviousSibling(const DOMNodeType* theXercesNode) const;
120 
121  XalanNode*
123  {
124  return m_previousSibling;
125  }
126 
127  void
128  setPreviousSibling(XalanNode* thePreviousSibling)
129  {
130  m_previousSibling = thePreviousSibling;
131  }
132 
133  XalanNode*
134  getNextSibling(const DOMNodeType* theXercesNode) const;
135 
136  XalanNode*
138  {
139  return m_nextSibling;
140  }
141 
142  void
143  setNextSibling(XalanNode* theNextSibling)
144  {
145  m_nextSibling = theNextSibling;
146  }
147 
148  XalanNode*
149  getFirstChild(const DOMNodeType* theXercesNode) const;
150 
151  XalanNode*
153  {
154  return m_firstChild;
155  }
156 
157  void
158  setFirstChild(XalanNode* theFirstChild)
159  {
160  m_firstChild = theFirstChild;
161  }
162 
163  XalanNode*
164  getLastChild(const DOMNodeType* theXercesNode) const;
165 
166  XalanNode*
167  getLastChild() const
168  {
169  return m_lastChild;
170  }
171 
172  void
173  setLastChild(XalanNode* theLastChild)
174  {
175  m_lastChild = theLastChild;
176  }
177 
178  XalanElement*
179  getOwnerElement(const DOMAttrType* theXercesAttr) const;
180 
181  /**
182  * Get a pooled string. If the string is not in the pool,
183  * add it.
184  *
185  * @param theString The string to pool.
186  * @return A const reference to the pooled string.
187  */
188  const XalanDOMString&
189  getPooledString(const XMLCh* theString) const;
190 
191 private:
192 
193  // Not implemented...
194  bool
195  operator==(const XercesWrapperNavigator& theRHS) const;
196 
197  // Data members...
198  XercesDocumentWrapper* m_ownerDocument;
199 
200  XalanNode* m_parentNode;
201 
202  XalanNode* m_previousSibling;
203 
204  XalanNode* m_nextSibling;
205 
206  XalanNode* m_firstChild;
207 
208  XalanNode* m_lastChild;
209 
210  IndexType m_index;
211 
212  static const XalanDOMString s_emptyString;
213 };
214 
215 
216 
217 }
218 
219 
220 
221 #endif // !defined(XERCESWRAPPERNAVIGATOR_HEADER_GUARD_1357924680)
xalanc::XercesWrapperNavigator::setIndex
void setIndex(IndexType theIndex)
Definition: XercesWrapperNavigator.hpp:98
XALAN_CPP_NAMESPACE
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Definition: XalanVersion.hpp:76
xalanc::XercesWrapperNavigator::getIndex
IndexType getIndex() const
Definition: XercesWrapperNavigator.hpp:92
xalanc::XalanNode
Definition: XalanNode.hpp:38
xalanc::XercesWrapperNavigator::setParentNode
void setParentNode(XalanNode *theParent)
Definition: XercesWrapperNavigator.hpp:113
xalanc::XercesWrapperNavigator::getNextSibling
XalanNode * getNextSibling() const
Definition: XercesWrapperNavigator.hpp:137
XalanDOMString.hpp
xalanc::XercesWrapperNavigator::setOwnerDocument
void setOwnerDocument(XercesDocumentWrapper *theDocument)
Definition: XercesWrapperNavigator.hpp:77
xalanc::operator==
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)
Definition: XalanVector.hpp:1118
xalanc::XercesWrapperNavigator::getLastChild
XalanNode * getLastChild() const
Definition: XercesWrapperNavigator.hpp:167
xalanc::XercesWrapperNavigator::setLastChild
void setLastChild(XalanNode *theLastChild)
Definition: XercesWrapperNavigator.hpp:173
xalanc::XercesWrapperNavigator::getFirstChild
XalanNode * getFirstChild() const
Definition: XercesWrapperNavigator.hpp:152
xalanc::XercesWrapperNavigator::setFirstChild
void setFirstChild(XalanNode *theFirstChild)
Definition: XercesWrapperNavigator.hpp:158
xalanc::XalanNode::IndexType
unsigned long IndexType
Definition: XalanNode.hpp:64
xalanc::XercesWrapperNavigator::setPreviousSibling
void setPreviousSibling(XalanNode *thePreviousSibling)
Definition: XercesWrapperNavigator.hpp:128
xalanc::XalanAttr
Definition: XalanAttr.hpp:40
XalanNode.hpp
XercesParserLiaisonDefinitions.hpp
xalanc::DOMNodeType
xercesc::DOMNode DOMNodeType
Definition: XercesWrapperTypes.hpp:68
xalanc::XercesWrapperNavigator::getOwnerDocument
XercesDocumentWrapper * getOwnerDocument() const
Definition: XercesWrapperNavigator.hpp:71
XALAN_XERCESPARSERLIAISON_EXPORT
#define XALAN_XERCESPARSERLIAISON_EXPORT
Definition: XercesParserLiaisonDefinitions.hpp:39
xalanc::XercesWrapperNavigator::getParentNode
XalanNode * getParentNode() const
Definition: XercesWrapperNavigator.hpp:107
xalanc::XalanElement
Definition: XalanElement.hpp:44
XercesWrapperTypes.hpp
xalanc::XercesWrapperNavigator
Definition: XercesWrapperNavigator.hpp:55
xalanc::XercesWrapperNavigator::setNextSibling
void setNextSibling(XalanNode *theNextSibling)
Definition: XercesWrapperNavigator.hpp:143
xalanc::XalanDOMString
Definition: XalanDOMString.hpp:45
xalanc::XercesWrapperNavigator::IndexType
XalanNode::IndexType IndexType
Definition: XercesWrapperNavigator.hpp:59
xalanc::XercesDocumentWrapper
Definition: XercesDocumentWrapper.hpp:77
xalanc::DOMAttrType
xercesc::DOMAttr DOMAttrType
Definition: XercesWrapperTypes.hpp:56
xalanc::XercesWrapperNavigator::getPreviousSibling
XalanNode * getPreviousSibling() const
Definition: XercesWrapperNavigator.hpp:122