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  

NameSpace.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(NAMESPACE_HEADER_GUARD_1357924680)
00017 #define NAMESPACE_HEADER_GUARD_1357924680
00018 
00019 
00020 
00021 // Base header file.  Must be first.
00022 #include <xalanc/XPath/XPathDefinitions.hpp>
00023 
00024 #include <xalanc/Include/XalanMemMgrAutoPtr.hpp>
00025 
00026 #include <xalanc/PlatformSupport/DOMStringHelper.hpp>
00027 
00028 
00029 
00030 XALAN_CPP_NAMESPACE_BEGIN
00031 
00032 
00033 
00038 class XALAN_XPATH_EXPORT NameSpace
00039 {
00040 public:
00041 
00042     explicit
00043     NameSpace(MemoryManagerType&  theManager) :
00044         m_prefix(theManager),
00045         m_uri(theManager)
00046     {
00047     }
00048 
00056     NameSpace(
00057             const XalanDOMString&   prefix,
00058             const XalanDOMString&   uri,
00059             MemoryManagerType&      theManager) :
00060         m_prefix(prefix, theManager),
00061         m_uri(uri, theManager)
00062     {
00063     }
00064 
00065     static NameSpace*
00066     create(
00067             const XalanDOMString&   prefix,
00068             const XalanDOMString&   uri,
00069             MemoryManagerType&      theManager)
00070     {
00071         typedef NameSpace ThisType;
00072         
00073         XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
00074         
00075         ThisType* theResult = theGuard.get();
00076         
00077         new (theResult) ThisType(prefix, uri, theManager);
00078         
00079         theGuard.release();
00080         
00081         return theResult;
00082     }
00083     NameSpace( const NameSpace&     other,
00084         MemoryManagerType&      theManager) :
00085         m_prefix(other.m_prefix, theManager),
00086         m_uri(other.m_uri, theManager)        
00087     {
00088     }
00089 
00090     ~NameSpace()
00091     {
00092     }
00093 
00099     const XalanDOMString&
00100     getPrefix() const
00101     {
00102         return m_prefix;
00103     }
00104 
00110     void
00111     setPrefix(const XalanDOMString&     prefix)
00112     {
00113         m_prefix = prefix;
00114     }
00115 
00121     const XalanDOMString&
00122     getURI() const
00123     {
00124         return m_uri;
00125     }
00126 
00132     void
00133     setURI(const XalanDOMString&    uri)
00134     {
00135         m_uri = uri;
00136     }
00137 
00143     void
00144     setURI(const XalanDOMChar*  uri)
00145     {
00146         assert(uri != 0);
00147 
00148         m_uri = uri;
00149     }
00150 
00157     void
00158     setURI(
00159             const XalanDOMChar*         uri,
00160             XalanDOMString::size_type   len)
00161     {
00162         assert(uri != 0);
00163 
00164         m_uri.assign(uri, len);
00165     }
00166 
00167     bool
00168     empty() const
00169     {
00170         return m_prefix.empty() && m_uri.empty();
00171     }
00172 
00173     void
00174     clear()
00175     {
00176         m_prefix.clear();
00177 
00178         m_uri.clear();
00179     }
00180 
00186     bool
00187     operator==(const NameSpace&     theRHS) const
00188     {
00189         return equals(m_prefix, theRHS.m_prefix) &&
00190                equals(m_uri, theRHS.m_uri);
00191     }   
00192 
00193 private:
00194     NameSpace(const NameSpace&);
00195 
00196     XalanDOMString  m_prefix;
00197 
00198     XalanDOMString  m_uri;
00199 };
00200 
00201 XALAN_USES_MEMORY_MANAGER(NameSpace)
00202 
00203 XALAN_CPP_NAMESPACE_END
00204 
00205 
00206 
00207 #endif  // NAMESPACE_HEADER_GUARD_1357924680

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