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

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 <vector>
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 #if defined(XALAN_NO_STD_NAMESPACE)
00047 #if defined(XALAN_USE_DEQUE_FOR_VECTOR_BOOL)
00048     typedef deque<bool>         BoolVectorType;
00049 #else
00050     typedef vector<bool>        BoolVectorType;
00051 #endif
00052 #else
00053 #if defined(XALAN_USE_DEQUE_FOR_VECTOR_BOOL)
00054     typedef std::deque<bool>    BoolVectorType;
00055 #else
00056     typedef std::vector<bool>   BoolVectorType;
00057 #endif
00058 #endif
00059 
00060     typedef XalanQName::NamespaceVectorType     NamespaceVectorType;
00061     typedef XalanQName::NamespacesStackType     NamespacesStackType;
00062 
00063     typedef NamespacesStackType::size_type      size_type;
00064 
00065 
00066     explicit
00067     ResultNamespacesStack();
00068 
00069     ~ResultNamespacesStack();
00070 
00071     void
00072     addDeclaration(
00073             const XalanDOMString&   thePrefix,
00074             const XalanDOMString&   theNamespaceURI)
00075     {
00076         addDeclaration(
00077             thePrefix,
00078             theNamespaceURI.c_str(),
00079             theNamespaceURI.length());
00080     }
00081 
00082     void
00083     addDeclaration(
00084             const XalanDOMString&   thePrefix,
00085             const XalanDOMChar*     theNamespaceURI)
00086     {
00087         addDeclaration(
00088             thePrefix,
00089             theNamespaceURI,
00090             length(theNamespaceURI));
00091     }
00092 
00093     void
00094     addDeclaration(
00095             const XalanDOMString&       thePrefix,
00096             const XalanDOMChar*         theNamespaceURI,
00097             XalanDOMString::size_type   theLength);
00098 
00099     void
00100     pushContext();
00101 
00102     void
00103     popContext();
00104 
00105     const XalanDOMString*
00106     getNamespaceForPrefix(const XalanDOMString&     thePrefix) const;
00107 
00108     const XalanDOMString*
00109     getPrefixForNamespace(const XalanDOMString&     theNamespaceURI) const;
00110 
00115     bool
00116     prefixIsPresentLocal(const XalanDOMString&  thePrefix);
00117 
00118     void
00119     clear();
00120 
00121     size_type
00122     size() const
00123     {
00124         return m_resultNamespaces.size() - 1;
00125     }
00126 
00127     bool
00128     empty() const
00129     {
00130         return NamespacesStackType::const_iterator(m_stackPosition) == m_resultNamespaces.begin() ? true : false;
00131     }
00132 
00133 private:
00134 
00135     // not implemented
00136     ResultNamespacesStack(const ResultNamespacesStack&);
00137 
00138     bool
00139     operator==(const ResultNamespacesStack&) const;
00140 
00141     ResultNamespacesStack&
00142     operator=(const ResultNamespacesStack&);
00143 
00144     enum { eDefaultCreateNewContextStackSize = 25 };
00145 
00149     NamespacesStackType             m_resultNamespaces;
00150 
00151     NamespacesStackType::iterator   m_stackBegin;
00152 
00153     NamespacesStackType::iterator   m_stackPosition;
00154 
00155     BoolVectorType                  m_createNewContextStack;
00156 };
00157 
00158 
00159 
00160 XALAN_CPP_NAMESPACE_END
00161 
00162 
00163 
00164 #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.