Xalan-C++ API Reference 1.12.0
URISupport.hpp
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18#if !defined(URISUPPORT_HEADER_GUARD_1357924680)
19#define URISUPPORT_HEADER_GUARD_1357924680
20
21
22
23// Base include file. Must be first.
25
26
27
28#include <xercesc/util/XMLURL.hpp>
29
30
31
33
34
35
37
38
39
41
42
43
44namespace XALAN_CPP_NAMESPACE {
45
46
47
48typedef xercesc::XMLURL XMLURLType;
49
50
51
53{
54public:
55
57
58 /**
59 * Determine the fully qualified URI for a string.
60 *
61 * @param urlString string to qualify
62 * @return auto pointer to fully qualified URI
63 */
64 static URLAutoPtrType
66 MemoryManager& theManager)
67 {
68 return getURLFromString(urlString.c_str(), theManager);
69 }
70
71 /**
72 * Determine the fully qualified URI for a string.
73 *
74 * @param urlString string to qualify
75 * @param url to update with the qualified string.
76 */
77 static void
81 MemoryManager& theManager)
82 {
83 getURLFromString(urlString.c_str(), url, theManager);
84 }
85
86 /**
87 * Determine the fully qualified URI for a string.
88 *
89 * @param urlString string to qualify
90 * @return auto pointer to fully qualified URI
91 */
92 static URLAutoPtrType
94 MemoryManager& theManager);
95
96 /**
97 * Determine the fully qualified URI for a string.
98 *
99 * @param urlString string to qualify
100 * @param url to update with the qualified string.
101 */
102 static void
104 const XalanDOMChar* urlString,
106 MemoryManager& theManager)
107 {
109
110 getURLStringFromString(urlString, buffer);
111
112 url.setURL(buffer.c_str());
113 }
114
115 /**
116 * Determine the fully qualified URI for a string.
117 *
118 * @param urlString string to qualify
119 * @param base base location for URI
120 * @return auto pointer to fully qualified URI
121 */
122 static URLAutoPtrType
125 const XalanDOMString& base,
126 MemoryManager& theManager)
127 {
129
130 getURLStringFromString(urlString, base, theResult);
131
132 return getURLFromString(theResult, theManager);
133 }
134
135 /**
136 * Determine the fully qualified URI for a string.
137 *
138 * @param urlString string to qualify
139 * @param base base location for URI
140 * @return auto pointer to fully qualified URI
141 */
142 static URLAutoPtrType
144 const XalanDOMChar* urlString,
145 const XalanDOMChar* base);
146
147
148 /**
149 * Determine the fully qualified URI for a string.
150 *
151 * @param urlString string to qualify
152 * @return string to fully qualified URI
153 */
154 static void
158 {
159 getURLStringFromString(urlString.c_str(), urlString.length(), theNormalizedURI);
160 }
161
162
163 /**
164 * Determine the fully qualified URI for a string.
165 *
166 * @param urlString string to qualify
167 * @param theNormalizedURI fully qualified URI
168 */
169 static void
171 const XalanDOMChar* urlString,
173 {
174 assert(urlString != 0);
175
176 getURLStringFromString(
177 urlString,
178 XalanDOMString::length(urlString),
180 }
181
182 /**
183 * Determine the fully qualified URI for a string.
184 *
185 * @param urlString string to qualify
186 * @param len the length of urlString
187 * @param theNormalizedURI fully qualified URI
188 */
189 static void
191 const XalanDOMChar* urlString,
194
195 /**
196 * Determine the fully qualified URI for a string.
197 *
198 * @param urlString string to qualify
199 * @param base base location for URI
200 * @param theNormalizedURI fully qualified URI
201 */
202 static void
205 const XalanDOMString& base,
207 {
208 getURLStringFromString(urlString.c_str(), base.c_str(), theNormalizedURI);
209 }
210
211
212 /**
213 * Determine the fully qualified URI for a string.
214 *
215 * @param urlString string to qualify
216 * @param base base location for URI
217 * @param theNormalizedURI fully qualified URI
218 */
219 static void
221 const XalanDOMChar* urlString,
222 const XalanDOMChar* base,
224 {
225 assert(urlString != 0 && base != 0);
226
227 getURLStringFromString(
228 urlString,
229 XalanDOMString::length(urlString),
230 base,
231 XalanDOMString::length(base),
233 }
234
235 /**
236 * Determine the fully qualified URI for a string.
237 *
238 * @param urlString string to qualify
239 * @param base base location for URI
240 * @param theNormalizedURI fully qualified URI
241 */
242 static void
244 const XalanDOMChar* urlString,
246 const XalanDOMChar* base,
249
250 /**
251 * Normalizes the string passed in, replacing
252 * \ with /.
253 *
254 * @param urlString string to normalize
255 * @return a reference to the passed parameter
256 */
257 static XalanDOMString&
259
260 /**
261 * Normalizes the string passed in, replacing
262 * \ with /.
263 *
264 * @param urlString string to normalize
265 * @return a copy of the normalized URI
266 */
267
268
270 {
271 public:
272
273 /**
274 * Construct an InvalidURIException.
275 *
276 * @param theMessage the error message
277 */
280 MemoryManager& theManager,
281 const Locator* theLocator);
282
283 /**
284 * Construct an InvalidURIException.
285 *
286 * @param theMessage the error message
287 */
290 MemoryManager& theManager);
291
292 virtual
294
295 virtual const XalanDOMChar*
296 getType() const;
297
298 private:
299 };
300
301
302 static const XalanDOMChar s_fileProtocolString1[];
303
304 static const XalanDOMChar s_fileProtocolString2[];
305};
306
307
308
309}
310
311
312
313#endif // URISUPPORT_HEADER_GUARD_1357924680
#define XALAN_PLATFORMSUPPORT_EXPORT
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Normalizes the string passed in, replacing \ with /.
InvalidURIException(const XalanDOMString &theMessage, MemoryManager &theManager)
Construct an InvalidURIException.
InvalidURIException(const XalanDOMString &theMessage, MemoryManager &theManager, const Locator *theLocator)
Construct an InvalidURIException.
virtual const XalanDOMChar * getType() const
Retrieve type of exception.
static URLAutoPtrType getURLFromString(const XalanDOMString &urlString, MemoryManager &theManager)
Determine the fully qualified URI for a string.
static URLAutoPtrType getURLFromString(const XalanDOMString &urlString, const XalanDOMString &base, MemoryManager &theManager)
Determine the fully qualified URI for a string.
static void getURLStringFromString(const XalanDOMChar *urlString, XalanDOMString &theNormalizedURI)
Determine the fully qualified URI for a string.
static void getURLStringFromString(const XalanDOMString &urlString, const XalanDOMString &base, XalanDOMString &theNormalizedURI)
Determine the fully qualified URI for a string.
static void getURLStringFromString(const XalanDOMChar *urlString, const XalanDOMChar *base, XalanDOMString &theNormalizedURI)
Determine the fully qualified URI for a string.
static void getURLFromString(const XalanDOMString &urlString, XMLURLType &url, MemoryManager &theManager)
Determine the fully qualified URI for a string.
static void getURLFromString(const XalanDOMChar *urlString, XMLURLType &url, MemoryManager &theManager)
Determine the fully qualified URI for a string.
static URLAutoPtrType getURLFromString(const XalanDOMChar *urlString, const XalanDOMChar *base)
Determine the fully qualified URI for a string.
static URLAutoPtrType getURLFromString(const XalanDOMChar *urlString, MemoryManager &theManager)
Determine the fully qualified URI for a string.
static void getURLStringFromString(const XalanDOMChar *urlString, XalanDOMString::size_type urlStringLen, const XalanDOMChar *base, XalanDOMString::size_type baseLen, XalanDOMString &theNormalizedURI)
Determine the fully qualified URI for a string.
XalanAutoPtr< XMLURLType > URLAutoPtrType
static XalanDOMString & NormalizeURIText(XalanDOMString &uriString)
Normalizes the string passed in, replacing \ with /.
static void getURLStringFromString(const XalanDOMString &urlString, XalanDOMString &theNormalizedURI)
Determine the fully qualified URI for a string.
static void getURLStringFromString(const XalanDOMChar *urlString, XalanDOMString::size_type len, XalanDOMString &theNormalizedURI)
Determine the fully qualified URI for a string.
const XalanDOMChar * c_str() const
xercesc::XMLURL XMLURLType