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(URISUPPORT_HEADER_GUARD_1357924680) 00019 #define URISUPPORT_HEADER_GUARD_1357924680 00020 00021 00022 00023 // Base include file. Must be first. 00024 #include <xalanc/PlatformSupport/PlatformSupportDefinitions.hpp> 00025 00026 00027 00028 #include <xercesc/util/XMLURL.hpp> 00029 00030 00031 00032 #include <xalanc/XalanDOM/XalanDOMString.hpp> 00033 00034 00035 00036 #include <xalanc/Include/XalanAutoPtr.hpp> 00037 00038 00039 00040 #include <xalanc/PlatformSupport/XSLException.hpp> 00041 00042 00043 00044 XALAN_CPP_NAMESPACE_BEGIN 00045 00046 00047 00048 typedef XERCES_CPP_NAMESPACE_QUALIFIER XMLURL XMLURLType; 00049 00050 00051 00052 class XALAN_PLATFORMSUPPORT_EXPORT URISupport 00053 { 00054 public: 00055 00056 typedef XalanAutoPtr<XMLURLType> URLAutoPtrType; 00057 00058 /** 00059 * Determine the fully qualified URI for a string. 00060 * 00061 * @param urlString string to qualify 00062 * @return auto pointer to fully qualified URI 00063 */ 00064 static URLAutoPtrType 00065 getURLFromString(const XalanDOMString& urlString, 00066 MemoryManager& theManager) 00067 { 00068 return getURLFromString(urlString.c_str(), theManager); 00069 } 00070 00071 /** 00072 * Determine the fully qualified URI for a string. 00073 * 00074 * @param urlString string to qualify 00075 * @param url to update with the qualified string. 00076 */ 00077 static void 00078 getURLFromString( 00079 const XalanDOMString& urlString, 00080 XMLURLType& url, 00081 MemoryManager& theManager) 00082 { 00083 getURLFromString(urlString.c_str(), url, theManager); 00084 } 00085 00086 /** 00087 * Determine the fully qualified URI for a string. 00088 * 00089 * @param urlString string to qualify 00090 * @return auto pointer to fully qualified URI 00091 */ 00092 static URLAutoPtrType 00093 getURLFromString(const XalanDOMChar* urlString, 00094 MemoryManager& theManager); 00095 00096 /** 00097 * Determine the fully qualified URI for a string. 00098 * 00099 * @param urlString string to qualify 00100 * @param url to update with the qualified string. 00101 */ 00102 static void 00103 getURLFromString( 00104 const XalanDOMChar* urlString, 00105 XMLURLType& url, 00106 MemoryManager& theManager) 00107 { 00108 XalanDOMString buffer(theManager); 00109 00110 getURLStringFromString(urlString, buffer); 00111 00112 url.setURL(buffer.c_str()); 00113 } 00114 00115 /** 00116 * Determine the fully qualified URI for a string. 00117 * 00118 * @param urlString string to qualify 00119 * @param base base location for URI 00120 * @return auto pointer to fully qualified URI 00121 */ 00122 static URLAutoPtrType 00123 getURLFromString( 00124 const XalanDOMString& urlString, 00125 const XalanDOMString& base, 00126 MemoryManager& theManager) 00127 { 00128 XalanDOMString theResult(theManager); 00129 00130 getURLStringFromString(urlString, base, theResult); 00131 00132 return getURLFromString(theResult, theManager); 00133 } 00134 00135 /** 00136 * Determine the fully qualified URI for a string. 00137 * 00138 * @param urlString string to qualify 00139 * @param base base location for URI 00140 * @return auto pointer to fully qualified URI 00141 */ 00142 static URLAutoPtrType 00143 getURLFromString( 00144 const XalanDOMChar* urlString, 00145 const XalanDOMChar* base); 00146 00147 00148 /** 00149 * Determine the fully qualified URI for a string. 00150 * 00151 * @param urlString string to qualify 00152 * @return string to fully qualified URI 00153 */ 00154 static void 00155 getURLStringFromString( 00156 const XalanDOMString& urlString, 00157 XalanDOMString& theNormalizedURI) 00158 { 00159 getURLStringFromString(urlString.c_str(), urlString.length(), theNormalizedURI); 00160 } 00161 00162 00163 /** 00164 * Determine the fully qualified URI for a string. 00165 * 00166 * @param urlString string to qualify 00167 * @param theNormalizedURI fully qualified URI 00168 */ 00169 static void 00170 getURLStringFromString( 00171 const XalanDOMChar* urlString, 00172 XalanDOMString& theNormalizedURI) 00173 { 00174 assert(urlString != 0); 00175 00176 getURLStringFromString( 00177 urlString, 00178 XalanDOMString::length(urlString), 00179 theNormalizedURI); 00180 } 00181 00182 /** 00183 * Determine the fully qualified URI for a string. 00184 * 00185 * @param urlString string to qualify 00186 * @param len the length of urlString 00187 * @param theNormalizedURI fully qualified URI 00188 */ 00189 static void 00190 getURLStringFromString( 00191 const XalanDOMChar* urlString, 00192 XalanDOMString::size_type len, 00193 XalanDOMString& theNormalizedURI); 00194 00195 /** 00196 * Determine the fully qualified URI for a string. 00197 * 00198 * @param urlString string to qualify 00199 * @param base base location for URI 00200 * @param theNormalizedURI fully qualified URI 00201 */ 00202 static void 00203 getURLStringFromString( 00204 const XalanDOMString& urlString, 00205 const XalanDOMString& base, 00206 XalanDOMString& theNormalizedURI) 00207 { 00208 getURLStringFromString(urlString.c_str(), base.c_str(), theNormalizedURI); 00209 } 00210 00211 00212 /** 00213 * Determine the fully qualified URI for a string. 00214 * 00215 * @param urlString string to qualify 00216 * @param base base location for URI 00217 * @param theNormalizedURI fully qualified URI 00218 */ 00219 static void 00220 getURLStringFromString( 00221 const XalanDOMChar* urlString, 00222 const XalanDOMChar* base, 00223 XalanDOMString& theNormalizedURI) 00224 { 00225 assert(urlString != 0 && base != 0); 00226 00227 getURLStringFromString( 00228 urlString, 00229 XalanDOMString::length(urlString), 00230 base, 00231 XalanDOMString::length(base), 00232 theNormalizedURI); 00233 } 00234 00235 /** 00236 * Determine the fully qualified URI for a string. 00237 * 00238 * @param urlString string to qualify 00239 * @param base base location for URI 00240 * @param theNormalizedURI fully qualified URI 00241 */ 00242 static void 00243 getURLStringFromString( 00244 const XalanDOMChar* urlString, 00245 XalanDOMString::size_type urlStringLen, 00246 const XalanDOMChar* base, 00247 XalanDOMString::size_type baseLen, 00248 XalanDOMString& theNormalizedURI); 00249 00250 /** 00251 * Normalizes the string passed in, replacing 00252 * \ with /. 00253 * 00254 * @param urlString string to normalize 00255 * @return a reference to the passed parameter 00256 */ 00257 static XalanDOMString& 00258 NormalizeURIText(XalanDOMString& uriString); 00259 00260 /** 00261 * Normalizes the string passed in, replacing 00262 * \ with /. 00263 * 00264 * @param urlString string to normalize 00265 * @return a copy of the normalized URI 00266 */ 00267 00268 00269 class InvalidURIException : public XSLException 00270 { 00271 public: 00272 00273 /** 00274 * Construct an InvalidURIException. 00275 * 00276 * @param theMessage the error message 00277 */ 00278 InvalidURIException( 00279 const XalanDOMString& theMessage, 00280 MemoryManager& theManager, 00281 const Locator* theLocator); 00282 00283 /** 00284 * Construct an InvalidURIException. 00285 * 00286 * @param theMessage the error message 00287 */ 00288 InvalidURIException( 00289 const XalanDOMString& theMessage, 00290 MemoryManager& theManager); 00291 00292 virtual 00293 ~InvalidURIException(); 00294 00295 virtual const XalanDOMChar* 00296 getType() const; 00297 00298 private: 00299 }; 00300 00301 00302 static const XalanDOMChar s_fileProtocolString1[]; 00303 00304 static const XalanDOMChar s_fileProtocolString2[]; 00305 }; 00306 00307 00308 00309 XALAN_CPP_NAMESPACE_END 00310 00311 00312 00313 #endif // URISUPPORT_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 |
|