Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


ResultNamespacesStack.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(XALAN_RESULTNAMESPACESSTACK_HEADER_GUARD)
19 #define XALAN_RESULTNAMESPACESSTACK_HEADER_GUARD
20 
21 
22 
23 // Base include file. Must be first.
25 
26 
27 
29 
30 
31 
33 
34 
35 
37 
38 
39 
40 XALAN_CPP_NAMESPACE_BEGIN
41 
42 
43 
45 {
46 public:
47 
48 
49 #if defined(XALAN_USE_DEQUE_FOR_VECTOR_BOOL)
50  #if defined(XALAN_NO_STD_NAMESPACE)
51  typedef deque<bool> BoolVectorType;
52  #else
53  typedef std::deque<bool> BoolVectorType;
54  #endif
55 #else
57 #endif
58 
61 
63 
64 
65  explicit
66  ResultNamespacesStack(MemoryManager& theManager);
67 
69 
70  void
72  const XalanDOMString& thePrefix,
73  const XalanDOMString& theNamespaceURI)
74  {
75  addDeclaration(
76  thePrefix,
77  theNamespaceURI.c_str(),
78  theNamespaceURI.length());
79  }
80 
81  void
83  const XalanDOMString& thePrefix,
84  const XalanDOMChar* theNamespaceURI)
85  {
86  addDeclaration(
87  thePrefix,
88  theNamespaceURI,
89  length(theNamespaceURI));
90  }
91 
92  void
94  const XalanDOMString& thePrefix,
95  const XalanDOMChar* theNamespaceURI,
96  XalanDOMString::size_type theLength);
97 
98  void
100 
101  void
103 
104  const XalanDOMString*
105  getNamespaceForPrefix(const XalanDOMString& thePrefix) const;
106 
107  const XalanDOMString*
108  getPrefixForNamespace(const XalanDOMString& theNamespaceURI) const;
109 
110  /**
111  * See if the prefix has been mapped to a namespace in the current
112  * context, without looking down the stack of namespaces.
113  */
114  bool
116 
117  void
118  clear();
119 
120  size_type
121  size() const
122  {
123  return m_resultNamespaces.size() - 1;
124  }
125 
126  bool
127  empty() const
128  {
129  return NamespacesStackType::const_iterator(m_stackPosition) == m_resultNamespaces.begin() ? true : false;
130  }
131 
132 private:
133 
134  // not implemented
136 
137  bool
138  operator==(const ResultNamespacesStack&) const;
139 
141  operator=(const ResultNamespacesStack&);
142 
143  enum { eDefaultCreateNewContextStackSize = 25 };
144 
145  /**
146  * A stack to keep track of the result tree namespaces.
147  */
148  NamespacesStackType m_resultNamespaces;
149 
150  NamespacesStackType::iterator m_stackBegin;
151 
152  NamespacesStackType::iterator m_stackPosition;
153 
154  BoolVectorType m_createNewContextStack;
155 };
156 
157 
158 
159 XALAN_CPP_NAMESPACE_END
160 
161 
162 
163 #endif // XALAN_RESULTNAMESPACESSTACK_HEADER_GUARD
ResultNamespacesStack::empty
bool empty() const
Definition: ResultNamespacesStack.hpp:127
ResultNamespacesStack::size_type
NamespacesStackType::size_type size_type
Definition: ResultNamespacesStack.hpp:62
length
XalanDOMString::size_type length(const XalanDOMString &theString)
Get the length of a XalanDOMString.
Definition: DOMStringHelper.hpp:239
XalanDOMString::size_type
XalanSize_t size_type
Definition: XalanDOMString.hpp:57
ResultNamespacesStack::clear
void clear()
ResultNamespacesStack::getPrefixForNamespace
const XalanDOMString * getPrefixForNamespace(const XalanDOMString &theNamespaceURI) const
ResultNamespacesStack::pushContext
void pushContext()
operator==
bool operator==(const ElemAttributeSet &theLHS, const ElemAttributeSet &theRHS)
Definition: ElemAttributeSet.hpp:111
XalanDeque
Xalan implementation of deque.
Definition: XalanDeque.hpp:201
ResultNamespacesStack
Definition: ResultNamespacesStack.hpp:45
XalanDOMString.hpp
ResultNamespacesStack::prefixIsPresentLocal
bool prefixIsPresentLocal(const XalanDOMString &thePrefix)
See if the prefix has been mapped to a namespace in the current context, without looking down the sta...
ResultNamespacesStack::NamespacesStackType
XalanQName::NamespacesStackType NamespacesStackType
Definition: ResultNamespacesStack.hpp:60
XALAN_XSLT_EXPORT
#define XALAN_XSLT_EXPORT
Definition: XSLTDefinitions.hpp:27
XalanVector.hpp
ResultNamespacesStack::addDeclaration
void addDeclaration(const XalanDOMString &thePrefix, const XalanDOMChar *theNamespaceURI)
Definition: ResultNamespacesStack.hpp:82
XalanQName.hpp
ResultNamespacesStack::NamespaceVectorType
XalanQName::NamespaceVectorType NamespaceVectorType
Definition: ResultNamespacesStack.hpp:59
XalanDOMString::c_str
const XalanDOMChar * c_str() const
Definition: XalanDOMString.hpp:348
ResultNamespacesStack::popContext
void popContext()
ResultNamespacesStack::getNamespaceForPrefix
const XalanDOMString * getNamespaceForPrefix(const XalanDOMString &thePrefix) const
ResultNamespacesStack::ResultNamespacesStack
ResultNamespacesStack(MemoryManager &theManager)
XalanVector< bool >
XalanDOMString
Definition: XalanDOMString.hpp:46
ResultNamespacesStack::addDeclaration
void addDeclaration(const XalanDOMString &thePrefix, const XalanDOMString &theNamespaceURI)
Definition: ResultNamespacesStack.hpp:71
XalanDequeIterator
Definition: XalanDeque.hpp:58
ResultNamespacesStack::~ResultNamespacesStack
~ResultNamespacesStack()
XSLTDefinitions.hpp
ResultNamespacesStack::size
size_type size() const
Definition: ResultNamespacesStack.hpp:121
XalanDeque::size_type
size_t size_type
Definition: XalanDeque.hpp:204
ResultNamespacesStack::addDeclaration
void addDeclaration(const XalanDOMString &thePrefix, const XalanDOMChar *theNamespaceURI, XalanDOMString::size_type theLength)
ResultNamespacesStack::BoolVectorType
XalanVector< bool > BoolVectorType
Definition: ResultNamespacesStack.hpp:56
XalanDOMString::length
size_type length() const
Definition: XalanDOMString.hpp:213

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSLT Processor Version 1.11
Copyright © 1999-2012 The Apache Software Foundation.
All Rights Reserved.

Apache Logo