Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.8

Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

OutputContextStack.hpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 1999-2004 The Apache Software Foundation.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 #if !defined(XALAN_OUTPUTCONTEXTSTACK_HEADER_GUARD)
00017 #define XALAN_OUTPUTCONTEXTSTACK_HEADER_GUARD
00018 
00019 
00020 
00021 // Base include file.  Must be first.
00022 #include <xalanc/XSLT/XSLTDefinitions.hpp>
00023 
00024 
00025 
00026 #include <deque>
00027 
00028 
00029 
00030 #include <xalanc/XalanDOM/XalanDOMString.hpp>
00031 
00032 
00033 
00034 #include <xalanc/PlatformSupport/AttributeListImpl.hpp>
00035 #include <xalanc/PlatformSupport/DOMStringHelper.hpp>
00036 
00037 
00038 
00039 XALAN_CPP_NAMESPACE_BEGIN
00040 
00041 
00042 
00043 class FormatterListener;
00044 
00045 
00046 
00047 class XALAN_XSLT_EXPORT OutputContextStack
00048 {
00049 public:
00050 
00051     struct OutputContext
00052     {
00053         OutputContext(FormatterListener*    theListener = 0) :
00054             m_flistener(theListener),
00055             m_pendingAttributes(),
00056             m_pendingElementName(),
00057             m_hasPendingStartDocument(false),
00058             m_mustFlushPendingStartDocument(false)
00059         {
00060         }
00061 
00062         ~OutputContext()
00063         {
00064         }
00065 
00066         void
00067         reset()
00068         {
00069             m_flistener = 0;
00070 
00071             m_pendingAttributes.clear();
00072 
00073             m_pendingElementName.clear();
00074 
00075             m_hasPendingStartDocument = false;
00076 
00077             m_mustFlushPendingStartDocument = false;
00078         }
00079 
00080         FormatterListener*  m_flistener;
00081 
00082         AttributeListImpl   m_pendingAttributes;
00083 
00084         XalanDOMString      m_pendingElementName;
00085 
00086         bool                m_hasPendingStartDocument;
00087 
00088         bool                m_mustFlushPendingStartDocument;
00089     };
00090 
00091 #if defined(XALAN_NO_STD_NAMESPACE)
00092     typedef deque<OutputContext>            OutputContextStackType;
00093 #else
00094     typedef std::deque<OutputContext>       OutputContextStackType;
00095 #endif
00096 
00097     typedef OutputContextStackType::size_type   size_type;
00098 
00099     explicit
00100     OutputContextStack();
00101 
00102     ~OutputContextStack();
00103 
00104     void
00105     pushContext(FormatterListener*  theListener = 0);
00106 
00107     void
00108     popContext();
00109 
00110     FormatterListener*
00111     getFormatterListener() const
00112     {
00113         return (*m_stackPosition).m_flistener;
00114     }
00115 
00116     FormatterListener*&
00117     getFormatterListener()
00118     {
00119         return (*m_stackPosition).m_flistener;
00120     }
00121 
00122     const AttributeListImpl&
00123     getPendingAttributes() const
00124     {
00125         return (*m_stackPosition).m_pendingAttributes;
00126     }
00127 
00128     AttributeListImpl&
00129     getPendingAttributes()
00130     {
00131         return (*m_stackPosition).m_pendingAttributes;
00132     }
00133 
00134     const XalanDOMString&
00135     getPendingElementName() const
00136     {
00137         return (*m_stackPosition).m_pendingElementName;
00138     }
00139 
00140     XalanDOMString&
00141     getPendingElementName()
00142     {
00143         return (*m_stackPosition).m_pendingElementName;
00144     }
00145 
00146     const bool&
00147     getHasPendingStartDocument() const
00148     {
00149         return (*m_stackPosition).m_hasPendingStartDocument;
00150     }
00151 
00152     bool&
00153     getHasPendingStartDocument()
00154     {
00155         return (*m_stackPosition).m_hasPendingStartDocument;
00156     }
00157 
00158     const bool&
00159     getMustFlushPendingStartDocument() const
00160     {
00161         return (*m_stackPosition).m_mustFlushPendingStartDocument;
00162     }
00163 
00164     bool&
00165     getMustFlushPendingStartDocument()
00166     {
00167         return (*m_stackPosition).m_mustFlushPendingStartDocument;
00168     }
00169 
00170     size_type
00171     size() const
00172     {
00173         // Since we always keep one dummy entry at the beginning,
00174         // subtract one from the size
00175         assert(m_stackSize == size_type(OutputContextStackType::const_iterator(m_stackPosition) - m_stack.begin()));
00176 
00177         return m_stackSize;
00178     }
00179 
00180     bool
00181     empty() const
00182     {
00183         return size() == 0 ? true : false;
00184     }
00185 
00186     void
00187     clear();
00188 
00189     void
00190     reset();
00191 
00192 private:
00193 
00194     // not implemented
00195     OutputContextStack(const OutputContextStack&);
00196 
00197     bool
00198     operator==(const OutputContextStack&) const;
00199 
00200     OutputContextStack&
00201     operator=(const OutputContextStack&);
00202 
00206     OutputContextStackType              m_stack;
00207 
00208     OutputContextStackType::iterator    m_stackPosition;
00209 
00210     size_type                           m_stackSize;
00211 };
00212 
00213 
00214 
00215 XALAN_CPP_NAMESPACE_END
00216 
00217 
00218 
00219 #endif  // XALAN_RESULTNAMESPACESSTACK_HEADER_GUARD

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.8
Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.