Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

ResultNamespacesStack.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_RESULTNAMESPACESSTACK_HEADER_GUARD)
00017 #define XALAN_RESULTNAMESPACESSTACK_HEADER_GUARD
00018 
00019 
00020 
00021 // Base include file.  Must be first.
00022 #include <xalanc/XSLT/XSLTDefinitions.hpp>
00023 
00024 
00025 
00026 #include <xalanc/Include/XalanVector.hpp>
00027 
00028 
00029 
00030 #include <xalanc/XalanDOM/XalanDOMString.hpp>
00031 
00032 
00033 
00034 #include <xalanc/XPath/XalanQName.hpp>
00035 
00036 
00037 
00038 XALAN_CPP_NAMESPACE_BEGIN
00039 
00040 
00041 
00042 class XALAN_XSLT_EXPORT ResultNamespacesStack
00043 {
00044 public:
00045 
00046 
00047 #if defined(XALAN_USE_DEQUE_FOR_VECTOR_BOOL)
00048     #if defined(XALAN_NO_STD_NAMESPACE)
00049     typedef deque<bool>         BoolVectorType;
00050     #else
00051     typedef std::deque<bool>    BoolVectorType;
00052     #endif
00053 #else
00054     typedef XalanVector<bool>       BoolVectorType;
00055 #endif
00056 
00057     typedef XalanQName::NamespaceVectorType     NamespaceVectorType;
00058     typedef XalanQName::NamespacesStackType     NamespacesStackType;
00059 
00060     typedef NamespacesStackType::size_type      size_type;
00061 
00062 
00063     explicit
00064     ResultNamespacesStack(MemoryManagerType& theManager);
00065 
00066     ~ResultNamespacesStack();
00067 
00068     void
00069     addDeclaration(
00070             const XalanDOMString&   thePrefix,
00071             const XalanDOMString&   theNamespaceURI)
00072     {
00073         addDeclaration(
00074             thePrefix,
00075             theNamespaceURI.c_str(),
00076             theNamespaceURI.length());
00077     }
00078 
00079     void
00080     addDeclaration(
00081             const XalanDOMString&   thePrefix,
00082             const XalanDOMChar*     theNamespaceURI)
00083     {
00084         addDeclaration(
00085             thePrefix,
00086             theNamespaceURI,
00087             length(theNamespaceURI));
00088     }
00089 
00090     void
00091     addDeclaration(
00092             const XalanDOMString&       thePrefix,
00093             const XalanDOMChar*         theNamespaceURI,
00094             XalanDOMString::size_type   theLength);
00095 
00096     void
00097     pushContext();
00098 
00099     void
00100     popContext();
00101 
00102     const XalanDOMString*
00103     getNamespaceForPrefix(const XalanDOMString&     thePrefix) const;
00104 
00105     const XalanDOMString*
00106     getPrefixForNamespace(const XalanDOMString&     theNamespaceURI) const;
00107 
00112     bool
00113     prefixIsPresentLocal(const XalanDOMString&  thePrefix);
00114 
00115     void
00116     clear();
00117 
00118     size_type
00119     size() const
00120     {
00121         return m_resultNamespaces.size() - 1;
00122     }
00123 
00124     bool
00125     empty() const
00126     {
00127         return NamespacesStackType::const_iterator(m_stackPosition) == m_resultNamespaces.begin() ? true : false;
00128     }
00129 
00130 private:
00131 
00132     // not implemented
00133     ResultNamespacesStack(const ResultNamespacesStack&);
00134 
00135     bool
00136     operator==(const ResultNamespacesStack&) const;
00137 
00138     ResultNamespacesStack&
00139     operator=(const ResultNamespacesStack&);
00140 
00141     enum { eDefaultCreateNewContextStackSize = 25 };
00142 
00146     NamespacesStackType             m_resultNamespaces;
00147 
00148     NamespacesStackType::iterator   m_stackBegin;
00149 
00150     NamespacesStackType::iterator   m_stackPosition;
00151 
00152     BoolVectorType                  m_createNewContextStack;
00153 };
00154 
00155 
00156 
00157 XALAN_CPP_NAMESPACE_END
00158 
00159 
00160 
00161 #endif  // XALAN_RESULTNAMESPACESSTACK_HEADER_GUARD

Interpreting class diagrams

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

dot

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

Apache Logo