00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one 00003 * or more contributor license agreements. See the NOTICE file 00004 * distributed with this work for additional information 00005 * regarding copyright ownership. The ASF licenses this file 00006 * to you under the Apache License, Version 2.0 (the "License"); 00007 * you may not use this file except in compliance with the License. 00008 * You may obtain a copy of the License at 00009 * 00010 * http://www.apache.org/licenses/LICENSE-2.0 00011 * 00012 * Unless required by applicable law or agreed to in writing, software 00013 * distributed under the License is distributed on an "AS IS" BASIS, 00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 * See the License for the specific language governing permissions and 00016 * limitations under the License. 00017 */ 00018 #if !defined(XALANNAMESPACE_HEADER_GUARD_1357924680) 00019 #define XALANNAMESPACE_HEADER_GUARD_1357924680 00020 00021 00022 00023 // Base header file. Must be first. 00024 #include <xalanc/PlatformSupport/PlatformSupportDefinitions.hpp> 00025 00026 00027 00028 #include <xalanc/PlatformSupport/DOMStringHelper.hpp> 00029 00030 00031 00032 XALAN_CPP_NAMESPACE_BEGIN 00033 00034 00035 00036 class XalanNamespace 00037 { 00038 public: 00039 00040 explicit 00041 XalanNamespace(MemoryManager& theManager) : 00042 m_prefix(theManager), 00043 m_uri(theManager) 00044 { 00045 } 00046 00047 /** 00048 * Construct a namespace for placement on the 00049 * result tree namespace stack. 00050 * 00051 * @param thePrefix namespace thePrefix 00052 * @param theURI URI of namespace 00053 */ 00054 XalanNamespace( 00055 const XalanDOMString& thePrefix, 00056 const XalanDOMString& theURI, 00057 MemoryManager& theManager) : 00058 m_prefix(thePrefix,theManager), 00059 m_uri(theURI, theManager) 00060 { 00061 } 00062 00063 XalanNamespace( 00064 const XalanNamespace& other, 00065 MemoryManager& theManager) : 00066 m_prefix(other.m_prefix,theManager), 00067 m_uri(other.m_uri, theManager) 00068 { 00069 } 00070 00071 ~XalanNamespace() 00072 { 00073 } 00074 00075 /** 00076 * Retrieve the thePrefix for namespace 00077 * 00078 * @return thePrefix string 00079 */ 00080 const XalanDOMString& 00081 getPrefix() const 00082 { 00083 return m_prefix; 00084 } 00085 00086 /** 00087 * Set the thePrefix for namespace 00088 * 00089 * @param thePrefix The new thePrefix value 00090 */ 00091 void 00092 setPrefix(const XalanDOMString& thePrefix) 00093 { 00094 m_prefix = thePrefix; 00095 } 00096 00097 /** 00098 * Retrieve the URI for namespace 00099 * 00100 * @return URI string 00101 */ 00102 const XalanDOMString& 00103 getURI() const 00104 { 00105 return m_uri; 00106 } 00107 00108 /** 00109 * Set the URI for namespace 00110 * 00111 * @param theURI The new theURI value 00112 */ 00113 void 00114 setURI(const XalanDOMString& theURI) 00115 { 00116 m_uri = theURI; 00117 } 00118 00119 /** 00120 * Set the URI for namespace 00121 * 00122 * @param theURI The new theURI value 00123 */ 00124 void 00125 setURI(const XalanDOMChar* theURI) 00126 { 00127 assert(theURI != 0); 00128 00129 m_uri = theURI; 00130 } 00131 00132 /** 00133 * Set the URI for namespace 00134 * 00135 * @param theURI The new theURI value 00136 * @param len The length of the theURI 00137 */ 00138 void 00139 setURI( 00140 const XalanDOMChar* theURI, 00141 XalanDOMString::size_type len) 00142 { 00143 assert(theURI != 0); 00144 00145 m_uri.assign(theURI, len); 00146 } 00147 00148 bool 00149 empty() const 00150 { 00151 return m_prefix.empty() && m_uri.empty(); 00152 } 00153 00154 void 00155 clear() 00156 { 00157 m_prefix.clear(); 00158 00159 m_uri.clear(); 00160 } 00161 00162 /** 00163 * Equality operator 00164 * 00165 * @param theRHS namespace to compare 00166 */ 00167 bool 00168 operator==(const XalanNamespace& theRHS) const 00169 { 00170 return equals(m_prefix, theRHS.m_prefix) && 00171 equals(m_uri, theRHS.m_uri); 00172 } 00173 00174 private: 00175 //Not implemented 00176 XalanNamespace(); 00177 XalanNamespace(const XalanNamespace&); 00178 00179 XalanDOMString m_prefix; 00180 00181 XalanDOMString m_uri; 00182 }; 00183 00184 XALAN_USES_MEMORY_MANAGER(XalanNamespace) 00185 00186 XALAN_CPP_NAMESPACE_END 00187 00188 00189 00190 #endif // ALANNAMESPACE_HEADER_GUARD_1357924680
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSLT Processor Version 1.11 |
|