Xalan-C++ API Reference 1.12.0
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
40namespace XALAN_CPP_NAMESPACE {
41
42
43
45{
46public:
47
48
49#if defined(XALAN_USE_DEQUE_FOR_VECTOR_BOOL)
50 typedef std::deque<bool> BoolVectorType;
51#else
53#endif
54
57
59
60
61 explicit
63
65
66 void
70 {
71 addDeclaration(
73 theNamespaceURI.c_str(),
74 theNamespaceURI.length());
75 }
76
77 void
81 {
82 addDeclaration(
86 }
87
88 void
93
94 void
96
97 void
99
100 const XalanDOMString*
102
103 const XalanDOMString*
105
106 /**
107 * See if the prefix has been mapped to a namespace in the current
108 * context, without looking down the stack of namespaces.
109 */
110 bool
112
113 void
115
117 size() const
118 {
119 return m_resultNamespaces.size() - 1;
120 }
121
122 bool
123 empty() const
124 {
125 return NamespacesStackType::const_iterator(m_stackPosition) == m_resultNamespaces.begin() ? true : false;
126 }
127
128private:
129
130 // not implemented
132
133 bool
134 operator==(const ResultNamespacesStack&) const;
135
137 operator=(const ResultNamespacesStack&);
138
139 enum { eDefaultCreateNewContextStackSize = 25 };
140
141 /**
142 * A stack to keep track of the result tree namespaces.
143 */
144 NamespacesStackType m_resultNamespaces;
145
146 NamespacesStackType::iterator m_stackBegin;
147
148 NamespacesStackType::iterator m_stackPosition;
149
150 BoolVectorType m_createNewContextStack;
151};
152
153
154
155}
156
157
158
159#endif // XALAN_RESULTNAMESPACESSTACK_HEADER_GUARD
#define XALAN_XSLT_EXPORT
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
void addDeclaration(const XalanDOMString &thePrefix, const XalanDOMChar *theNamespaceURI)
void addDeclaration(const XalanDOMString &thePrefix, const XalanDOMChar *theNamespaceURI, XalanDOMString::size_type theLength)
const XalanDOMString * getNamespaceForPrefix(const XalanDOMString &thePrefix) const
XalanQName::NamespacesStackType NamespacesStackType
NamespacesStackType::size_type size_type
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(MemoryManager &theManager)
void addDeclaration(const XalanDOMString &thePrefix, const XalanDOMString &theNamespaceURI)
XalanQName::NamespaceVectorType NamespaceVectorType
const XalanDOMString * getPrefixForNamespace(const XalanDOMString &theNamespaceURI) const
Xalan implementation of deque.
XalanDOMString::size_type length(const XalanDOMString &theString)
Get the length of a XalanDOMString.
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)