## Xalan-C++ API Documentation

### The Xalan C++ XSLT Processor Version 1.6

Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# URISupport.hpp

Go to the documentation of this file.

    00001 /*
    00002  * The Apache Software License, Version 1.1
    00003  *
    00004  *
    00005  * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    00006  * reserved.
    00007  *
    00008  * Redistribution and use in source and binary forms, with or without
    00009  * modification, are permitted provided that the following conditions
    00010  * are met:
    00011  *
    00012  * 1. Redistributions of source code must retain the above copyright
    00013  *    notice, this list of conditions and the following disclaimer.
    00014  *
    00015  * 2. Redistributions in binary form must reproduce the above copyright
    00016  *    notice, this list of conditions and the following disclaimer in
    00017  *    the documentation and/or other materials provided with the
    00018  *    distribution.
    00019  *
    00020  * 3. The end-user documentation included with the redistribution,
    00021  *    if any, must include the following acknowledgment:
    00022  *       "This product includes software developed by the
    00023  *        Apache Software Foundation (http://www.apache.org/)."
    00024  *    Alternately, this acknowledgment may appear in the software itself,
    00025  *    if and wherever such third-party acknowledgments normally appear.
    00026  *
    00027  * 4. The names "Xalan" and "Apache Software Foundation" must
    00028  *    not be used to endorse or promote products derived from this
    00029  *    software without prior written permission. For written
    00030  *    permission, please contact apache@apache.org.
    00031  *
    00032  * 5. Products derived from this software may not be called "Apache",
    00033  *    nor may "Apache" appear in their name, without prior written
    00034  *    permission of the Apache Software Foundation.
    00035  *
    00036  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    00037  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    00038  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    00039  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    00040  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    00041  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    00042  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    00043  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    00044  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    00045  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    00046  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    00047  * SUCH DAMAGE.
    00048  * ====================================================================
    00049  *
    00050  * This software consists of voluntary contributions made by many
    00051  * individuals on behalf of the Apache Software Foundation and was
    00052  * originally based on software copyright (c) 1999, International
    00053  * Business Machines, Inc., http://www.ibm.com.  For more
    00054  * information on the Apache Software Foundation, please see
    00055  * <http://www.apache.org/>.
    00056  */
    00057 #if !defined(URISUPPORT_HEADER_GUARD_1357924680)
    00058 #define URISUPPORT_HEADER_GUARD_1357924680
    00059
    00060
    00061
    00062 // Base include file.  Must be first.
    00063 #include <xalanc/PlatformSupport/PlatformSupportDefinitions.hpp>
    00064
    00065
    00066
    00067 #include <xercesc/util/XMLURL.hpp>
    00068
    00069
    00070
    00071 #include <xalanc/XalanDOM/XalanDOMString.hpp>
    00072
    00073
    00074
    00075 #include <xalanc/Include/XalanAutoPtr.hpp>
    00076
    00077
    00078
    00079 #include <xalanc/PlatformSupport/XSLException.hpp>
    00080
    00081
    00082
    00083 XALAN_CPP_NAMESPACE_BEGIN
    00084
    00085
    00086
    00087 typedef XERCES_CPP_NAMESPACE_QUALIFIER XMLURL   XMLURLType;
    00088
    00089
    00090
    00091 class XALAN_PLATFORMSUPPORT_EXPORT URISupport
    00092 {
    00093 public:
    00094
    00095     typedef XalanAutoPtr<XMLURLType>    URLAutoPtrType;
    00096
    00103     static URLAutoPtrType
    00104     getURLFromString(const XalanDOMString&  urlString)
    00105     {
    00106         return getURLFromString(urlString.c_str());
    00107     }
    00108
    00115     static void
    00116     getURLFromString(
    00117             const XalanDOMString&   urlString,
    00118             XMLURLType&             url)
    00119     {
    00120         getURLFromString(urlString.c_str(), url);
    00121     }
    00122
    00129     static URLAutoPtrType
    00130     getURLFromString(const XalanDOMChar*    urlString);
    00131
    00138     static void
    00139     getURLFromString(
    00140             const XalanDOMChar*     urlString,
    00141             XMLURLType&             url)
    00142     {
    00143         url.setURL(getURLStringFromString(urlString).c_str());
    00144     }
    00145
    00153     static URLAutoPtrType
    00154     getURLFromString(
    00155             const XalanDOMString&   urlString,
    00156             const XalanDOMString&   base)
    00157     {
    00158         return getURLFromString(getURLStringFromString(urlString, base));
    00159     }
    00160
    00168     static URLAutoPtrType
    00169     getURLFromString(
    00170             const XalanDOMChar*     urlString,
    00171             const XalanDOMChar*     base);
    00172
    00179     static XalanDOMString
    00180     getURLStringFromString(const XalanDOMString&    urlString)
    00181     {
    00182         XalanDOMString  result;
    00183
    00184         getURLStringFromString(urlString.c_str(), urlString.length(), result);
    00185
    00186         return result;
    00187     }
    00188
    00195     static void
    00196     getURLStringFromString(
    00197             const XalanDOMString&   urlString,
    00198             XalanDOMString&         theNormalizedURI)
    00199     {
    00200         getURLStringFromString(urlString.c_str(), urlString.length(), theNormalizedURI);
    00201     }
    00202
    00209     static XalanDOMString
    00210     getURLStringFromString(const XalanDOMChar*  urlString)
    00211     {
    00212         XalanDOMString  theNormalizedURI;
    00213
    00214         getURLStringFromString(urlString, theNormalizedURI);
    00215
    00216         return theNormalizedURI;
    00217     }
    00218
    00225     static void
    00226     getURLStringFromString(
    00227             const XalanDOMChar*         urlString,
    00228             XalanDOMString&             theNormalizedURI)
    00229     {
    00230         assert(urlString != 0);
    00231
    00232         getURLStringFromString(
    00233             urlString,
    00234             XalanDOMString::length(urlString),
    00235             theNormalizedURI);
    00236     }
    00237
    00245     static void
    00246     getURLStringFromString(
    00247             const XalanDOMChar*         urlString,
    00248             XalanDOMString::size_type   len,
    00249             XalanDOMString&             theNormalizedURI);
    00250
    00258     static XalanDOMString
    00259     getURLStringFromString(
    00260             const XalanDOMString&   urlString,
    00261             const XalanDOMString&   base)
    00262     {
    00263         XalanDOMString  theNormalizedURI;
    00264
    00265         getURLStringFromString(
    00266             urlString.c_str(),
    00267             urlString.length(),
    00268             base.c_str(),
    00269             base.length(),
    00270             theNormalizedURI);
    00271
    00272         return theNormalizedURI;
    00273     }
    00274
    00282     static void
    00283     getURLStringFromString(
    00284             const XalanDOMString&   urlString,
    00285             const XalanDOMString&   base,
    00286             XalanDOMString&         theNormalizedURI)
    00287     {
    00288         getURLStringFromString(urlString.c_str(), base.c_str(), theNormalizedURI);
    00289     }
    00290
    00298     static XalanDOMString
    00299     getURLStringFromString(
    00300             const XalanDOMChar*     urlString,
    00301             const XalanDOMChar*     base)
    00302     {
    00303         XalanDOMString  theNormalizedURI;
    00304
    00305         getURLStringFromString(urlString, base, theNormalizedURI);
    00306
    00307         return theNormalizedURI;
    00308     }
    00309
    00317     static void
    00318     getURLStringFromString(
    00319             const XalanDOMChar*     urlString,
    00320             const XalanDOMChar*     base,
    00321             XalanDOMString&         theNormalizedURI)
    00322     {
    00323         assert(urlString != 0 && base != 0);
    00324
    00325         getURLStringFromString(
    00326             urlString,
    00327             XalanDOMString::length(urlString),
    00328             base,
    00329             XalanDOMString::length(base),
    00330             theNormalizedURI);
    00331     }
    00332
    00340     static void
    00341     getURLStringFromString(
    00342             const XalanDOMChar*         urlString,
    00343             XalanDOMString::size_type   urlStringLen,
    00344             const XalanDOMChar*         base,
    00345             XalanDOMString::size_type   baseLen,
    00346             XalanDOMString&             theNormalizedURI);
    00347
    00355     static XalanDOMString&
    00356     NormalizeURIText(XalanDOMString&    uriString);
    00357
    00365     static const XalanDOMString
    00366     NormalizeURIText(const XalanDOMString&  uriString);
    00367
    00368
    00369     class InvalidURIException : public XSLException
    00370     {
    00371     public:
    00372
    00378         InvalidURIException(const XalanDOMString&   theMessage);
    00379
    00380         virtual
    00381         ~InvalidURIException();
    00382     };
    00383
    00384
    00385     static const XalanDOMChar   s_fileProtocolString1[];
    00386
    00387     static const XalanDOMChar   s_fileProtocolString2[];
    00388 };
    00389
    00390
    00391
    00392 XALAN_CPP_NAMESPACE_END
    00393
    00394
    00395
    00396 #endif  // URISUPPORT_HEADER_GUARD_1357924680

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSLT Processor Version 1.6 Copyright © 2000, 2001, 2002, 2003 The Apache Software Foundation. All Rights Reserved.