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(XALANQNAMEBYVALUE_HEADER_GUARD_1357924680) 00019 #define XALANQNAMEBYVALUE_HEADER_GUARD_1357924680 00020 00021 00022 00023 // Base header file. Must be first. 00024 #include <xalanc/XPath/XPathDefinitions.hpp> 00025 00026 00027 00028 // Base class header file... 00029 #include <xalanc/XPath/XalanQName.hpp> 00030 00031 00032 00033 XALAN_DECLARE_XERCES_CLASS(Locator) 00034 00035 00036 00037 XALAN_CPP_NAMESPACE_BEGIN 00038 00039 00040 00041 class DOMSupport; 00042 class ProblemListenerBase; 00043 00044 00045 00046 class XALAN_XPATH_EXPORT XalanQNameByValue : public XalanQName 00047 { 00048 public: 00049 00050 typedef XERCES_CPP_NAMESPACE_QUALIFIER Locator LocatorType; 00051 00052 /** 00053 * Construct an empty XalanQNameByValue. 00054 */ 00055 explicit 00056 XalanQNameByValue(MemoryManager& theManager); 00057 00058 MemoryManager& 00059 getMemoryManager() 00060 { 00061 return m_namespace.getMemoryManager(); 00062 } 00063 00064 /** 00065 * Copy constructor. 00066 * 00067 * @param theSource The source of the copy. 00068 */ 00069 XalanQNameByValue( 00070 const XalanQNameByValue& theSource, 00071 MemoryManager& theManager); 00072 00073 /** 00074 * Construct an instance from another XalanQName. 00075 * 00076 * @param theSource The source of the copy. 00077 */ 00078 explicit 00079 XalanQNameByValue( 00080 const XalanQName& theSource, 00081 MemoryManager& theManager); 00082 00083 /** 00084 * Construct a XalanQNameByValue, with the supplied namespace and local part. 00085 * 00086 * @param theNamespace namespace string 00087 * @param theLocalPart local part string 00088 */ 00089 XalanQNameByValue( 00090 const XalanDOMString& theNamespace, 00091 const XalanDOMString& theLocalPart, 00092 MemoryManager& theManager); 00093 00094 static XalanQNameByValue* 00095 create( 00096 const XalanDOMString& theNamespace, 00097 const XalanDOMString& theLocalPart, 00098 MemoryManager& theManager); 00099 00100 /** 00101 * Construct a XalanQNameByValue from a string, resolving the prefix using the given 00102 * namespace vector stack. 00103 * 00104 * @param qname QName string 00105 * @param namespaces namespace vector stack to use 00106 * @param locator The Locator instance for error reporting, if any 00107 * @param fUseDefault If true, then elements with no prefix will have the default namespace URI, if there is one. 00108 */ 00109 XalanQNameByValue( 00110 const XalanDOMString& qname, 00111 const NamespacesStackType& namespaces, 00112 MemoryManager& theManager, 00113 const Locator* locator = 0, 00114 bool fUseDefault = false); 00115 00116 /** 00117 * Construct a XalanQNameByValue from a string, resolving the prefix using the given 00118 * namespace vector stack. 00119 * 00120 * @param qname QName string 00121 * @param namespaces namespace vector stack to use 00122 * @param locator The Locator instance for error reporting, if any 00123 * @param fUseDefault If true, then elements with no prefix will have the default namespace URI, if there is one. 00124 */ 00125 XalanQNameByValue( 00126 const XalanDOMChar* qname, 00127 const NamespacesStackType& namespaces, 00128 MemoryManager& theManager, 00129 const Locator* locator = 0, 00130 bool fUseDefault = false); 00131 00132 /** 00133 * Construct a XalanQNameByValue from a string, resolving the prefix using the given 00134 * prefix resolver. The default namespace is not resolved. 00135 * 00136 * @param qname QName string 00137 * @param theResolver prefix resolver to use 00138 * @param locator The Locator instance for error reporting, if any 00139 */ 00140 XalanQNameByValue( 00141 const XalanDOMString& qname, 00142 MemoryManager& theManager, 00143 const PrefixResolver* theResolver = 0, 00144 const Locator* locator = 0); 00145 00146 virtual 00147 ~XalanQNameByValue(); 00148 00149 /** 00150 * Retrieve the local part of qualified name. 00151 * 00152 * @return local part string 00153 */ 00154 virtual const XalanDOMString& 00155 getLocalPart() const; 00156 00157 /** 00158 * Set the local part of qualified name. 00159 * 00160 * @param theLocalPart local part string 00161 */ 00162 void 00163 setLocalPart(const XalanDOMString& theLocalPart) 00164 { 00165 m_localpart = theLocalPart; 00166 } 00167 00168 /** 00169 * Retrieve the namespace of qualified name. 00170 * 00171 * @return namespace string 00172 */ 00173 virtual const XalanDOMString& 00174 getNamespace() const; 00175 00176 /** 00177 * Set the Namespace URI of qualified name. 00178 * 00179 * @param theLocalPart local part string 00180 */ 00181 void 00182 setNamespace(const XalanDOMString& theNamespace) 00183 { 00184 m_namespace = theNamespace; 00185 } 00186 00187 /** 00188 * Set the local part and namespace URI of a XalanQNameByValue from 00189 * a string, resolving the prefix using the given namespace vector 00190 * stack. 00191 * 00192 * @param qname QName string 00193 * @param namespaces namespace vector stack to use 00194 * @param locator The Locator instance for error reporting, if any 00195 * @param fUseDefault If true, then elements with no prefix will have the default namespace URI, if there is one. 00196 */ 00197 void 00198 set( 00199 const XalanDOMString& qname, 00200 const NamespacesStackType& namespaces, 00201 const Locator* locator = 0, 00202 bool fUseDefault = false); 00203 00204 /** 00205 * Set the local part and namespace URI of a XalanQNameByValue from 00206 * a string, resolving the prefix using the given namespace vector 00207 * stack. 00208 * 00209 * @param qname QName string 00210 * @param namespaces namespace vector stack to use 00211 * @param locator The Locator instance for error reporting, if any 00212 * @param fUseDefault If true, then elements with no prefix will have the default namespace URI, if there is one. 00213 */ 00214 void 00215 set( 00216 const XalanDOMChar* qname, 00217 const NamespacesStackType& namespaces, 00218 const Locator* locator = 0, 00219 bool fUseDefault = false); 00220 00221 /** 00222 * Set the local part and namespace URI of a XalanQNameByValue from 00223 * a string, resolving the prefix using the resolver provided. The 00224 * default namespace is not resolved. 00225 * 00226 * @param qname QName string 00227 * @param theResolver prefix resolver to use 00228 * @param locator The Locator instance for error reporting, if any 00229 */ 00230 void 00231 set( 00232 const XalanDOMString& qname, 00233 const PrefixResolver* theResolver = 0, 00234 const Locator* locator = 0); 00235 00236 /** 00237 * Set the local part and namespace URI of a XalanQNameByValue from 00238 * a string, resolving the prefix using the resolver provided. The 00239 * default namespace is not resolved. 00240 * 00241 * @param qname QName string 00242 * @param theResolver prefix resolver to use 00243 * @param locator The Locator instance for error reporting, if any 00244 */ 00245 void 00246 set( 00247 const XalanDOMChar* qname, 00248 const PrefixResolver* theResolver = 0, 00249 const Locator* locator = 0); 00250 /** 00251 * Clear the instance. 00252 */ 00253 void 00254 clear() 00255 { 00256 m_namespace.clear(); 00257 m_localpart.clear(); 00258 } 00259 00260 XalanQNameByValue& 00261 operator=(const XalanQNameByValue& theRHS) 00262 { 00263 m_namespace = theRHS.m_namespace; 00264 m_localpart = theRHS.m_localpart; 00265 00266 return *this; 00267 } 00268 00269 XalanQNameByValue& 00270 operator=(const XalanQName& theRHS) 00271 { 00272 m_namespace = theRHS.getNamespace(); 00273 m_localpart = theRHS.getLocalPart(); 00274 00275 return *this; 00276 } 00277 00278 private: 00279 // not implemented 00280 XalanQNameByValue(const XalanQNameByValue& theSource); 00281 void 00282 initialize( 00283 const XalanDOMChar* qname, 00284 XalanDOMString::size_type len, 00285 const NamespacesStackType& namespaces, 00286 const Locator* locator, 00287 bool fUseDefault); 00288 00289 void 00290 resolvePrefix( 00291 const XalanDOMChar* qname, 00292 XalanDOMString::size_type theLength, 00293 const PrefixResolver* theResolver, 00294 const Locator* locator); 00295 00296 void 00297 validate( 00298 const XalanDOMChar* qname, 00299 XalanDOMString::size_type theLength, 00300 const Locator* locator); 00301 00302 // Data members... 00303 XalanDOMString m_namespace; 00304 00305 XalanDOMString m_localpart; 00306 }; 00307 00308 XALAN_USES_MEMORY_MANAGER(XalanQNameByValue) 00309 00310 00311 template<> 00312 struct XalanMapKeyTraits<XalanQNameByValue> : public XalanMapKeyTraits<XalanQName> 00313 { 00314 }; 00315 00316 00317 00318 XALAN_CPP_NAMESPACE_END 00319 00320 00321 00322 #endif // XALANQNAMEBYVALUE_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 |
|