Xalan-C++ API Reference 1.12.0
OutputContextStack.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_OUTPUTCONTEXTSTACK_HEADER_GUARD)
19#define XALAN_OUTPUTCONTEXTSTACK_HEADER_GUARD
20
21
22
23// Base include file. Must be first.
25
26
27
29
30
31
33
34
35
38
39
40
41namespace XALAN_CPP_NAMESPACE {
42
43
44
45class FormatterListener;
46
47
48
50{
51public:
52
54 {
55 OutputContext(MemoryManager& theManager,
57 m_flistener(theListener),
58 m_pendingAttributes(theManager),
59 m_pendingElementName(theManager),
60 m_hasPendingStartDocument(false),
61 m_mustFlushPendingStartDocument(false)
62 {
63 }
64
66 MemoryManager& theManager) :
67 m_flistener(other.m_flistener),
68 m_pendingAttributes(other.m_pendingAttributes , theManager),
69 m_pendingElementName(other.m_pendingElementName , theManager),
70 m_hasPendingStartDocument(other.m_hasPendingStartDocument),
71 m_mustFlushPendingStartDocument(other.m_mustFlushPendingStartDocument)
72 {
73 }
74
76 {
77 }
78
79 void
81 {
82 m_flistener = 0;
83
84 m_pendingAttributes.clear();
85
86 m_pendingElementName.clear();
87
88 m_hasPendingStartDocument = false;
89
90 m_mustFlushPendingStartDocument = false;
91 }
92
94
96
98
100
102 };
103
105
107
108 explicit
110
112
113 void
115
116 void
118
121 {
122 return (*m_stackPosition).m_flistener;
123 }
124
127 {
128 return (*m_stackPosition).m_flistener;
129 }
130
131 const AttributeListImpl&
133 {
134 return (*m_stackPosition).m_pendingAttributes;
135 }
136
139 {
140 return (*m_stackPosition).m_pendingAttributes;
141 }
142
143 const XalanDOMString&
145 {
146 return (*m_stackPosition).m_pendingElementName;
147 }
148
151 {
152 return (*m_stackPosition).m_pendingElementName;
153 }
154
155 const bool&
157 {
158 return (*m_stackPosition).m_hasPendingStartDocument;
159 }
160
161 bool&
163 {
164 return (*m_stackPosition).m_hasPendingStartDocument;
165 }
166
167 const bool&
169 {
170 return (*m_stackPosition).m_mustFlushPendingStartDocument;
171 }
172
173 bool&
175 {
176 return (*m_stackPosition).m_mustFlushPendingStartDocument;
177 }
178
180 size() const
181 {
182 // Since we always keep one dummy entry at the beginning,
183 // subtract one from the size
184 assert(m_stackSize == size_type(OutputContextStackType::const_iterator(m_stackPosition) - m_stack.begin()));
185
186 return m_stackSize;
187 }
188
189 bool
190 empty() const
191 {
192 return size() == 0 ? true : false;
193 }
194
195 void
197
198 void
200
201private:
202
203 // not implemented
205
206 bool
207 operator==(const OutputContextStack&) const;
208
210 operator=(const OutputContextStack&);
211
212 /**
213 * A stack to hold the output contexts...
214 */
216
217 OutputContextStackType::iterator m_stackPosition;
218
219 size_type m_stackSize;
220};
221
222
223
224}
225
226
227
228#endif // XALAN_RESULTNAMESPACESSTACK_HEADER_GUARD
#define XALAN_XSLT_EXPORT
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
A SAX-based formatter interface for the XSL processor.
const AttributeListImpl & getPendingAttributes() const
XalanDOMString & getPendingElementName()
void pushContext(FormatterListener *theListener=0)
OutputContextStack(MemoryManager &theManager)
const bool & getHasPendingStartDocument() const
const bool & getMustFlushPendingStartDocument() const
FormatterListener *& getFormatterListener()
OutputContextStackType::size_type size_type
FormatterListener * getFormatterListener() const
const XalanDOMString & getPendingElementName() const
AttributeListImpl & getPendingAttributes()
XalanDeque< OutputContext, ConstructWithMemoryManagerTraits< OutputContext > > OutputContextStackType
size_t size_type
Definition XalanMap.hpp:46
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)
OutputContext(MemoryManager &theManager, FormatterListener *theListener=0)
OutputContext(const OutputContext &other, MemoryManager &theManager)