Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.7

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

XalanParsedURI.hpp

Go to the documentation of this file.
00001 /*
00002  * The Apache Software License, Version 1.1
00003  *
00004  *
00005  * Copyright (c) 1999-2004 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 
00058 #if !defined(XALANPARSEDURI_HEADER_GUARD_1357924680)
00059 #define XALANPARSEDURI_HEADER_GUARD_1357924680
00060 
00061 
00062 
00063 // Base include file.  Must be first.
00064 #include <xalanc/PlatformSupport/PlatformSupportDefinitions.hpp>
00065 
00066 
00067 
00068 #include <xalanc/XalanDOM/XalanDOMString.hpp>
00069 
00070 
00071 
00072 
00073 XALAN_CPP_NAMESPACE_BEGIN
00074 
00075 
00076 
00080 class XALAN_PLATFORMSUPPORT_EXPORT XalanParsedURI
00081 {
00082 public:
00083 
00084     // Flags to say if a component is defined.  Note that each component may
00085     // be defined but empty, except for the path.
00086 #if defined(XALAN_INLINE_INITIALIZATION)
00087     static const int d_scheme       = 1;
00088     static const int d_authority    = 2;
00089     static const int d_query        = 4;
00090     static const int d_fragment     = 8;
00091 #else
00092     enum eComponent
00093     {
00094         d_scheme    = 1,
00095         d_authority = 2,
00096         d_query     = 4,
00097         d_fragment  = 8
00098     };
00099 #endif
00100 
00104     XalanParsedURI() :
00105         m_defined(0)
00106     {
00107     }
00108 
00115     XalanParsedURI(
00116         const XalanDOMChar*         uriString,
00117         XalanDOMString::size_type   uriStringLen) : 
00118         m_defined(0)
00119     {
00120         parse(uriString, uriStringLen);
00121     }
00122 
00128     XalanParsedURI(
00129         const XalanDOMString        &uriString) :
00130         m_defined(0)
00131     {
00132         parse(uriString.c_str(), uriString.length());
00133     }
00134      
00141     void parse(
00142         const XalanDOMChar*         uriString,
00143         XalanDOMString::size_type   uriStringLen);
00144      
00151     void parse(
00152         const XalanDOMString &uriString)
00153     {
00154         parse(uriString.c_str(), uriString.length());
00155     }
00156 
00162     XalanDOMString make() const;
00163 
00169     void resolve(const XalanParsedURI &base);
00170 
00177     void resolve(
00178         const XalanDOMChar *base,
00179         const XalanDOMString::size_type baseLen)
00180     {
00181         XalanParsedURI baseURI(base, baseLen);
00182 
00183         resolve(baseURI);
00184     }
00185 
00191     void resolve(
00192         const XalanDOMString &base)
00193     {
00194         resolve(base.c_str(), base.length());
00195     }
00196 
00206     static XalanDOMString resolve(
00207         const XalanDOMChar          *relative,
00208         XalanDOMString::size_type   relativeLen,
00209         const XalanDOMChar          *base,
00210         XalanDOMString::size_type   baseLen
00211     );
00212 
00213 
00221     static XalanDOMString resolve(
00222         const XalanDOMString &relative,
00223         const XalanDOMString &base
00224     )
00225     {
00226         return resolve(relative.c_str(), relative.length(), base.c_str(), base.length());
00227     }
00228 
00232     const XalanDOMString& getScheme() const 
00233     { 
00234         return m_scheme; 
00235     }
00236 
00240     bool isSchemeDefined() const 
00241     { 
00242         return !!(m_defined & d_scheme); 
00243     }
00244 
00248     void setScheme(const XalanDOMChar *scheme) 
00249     { 
00250         m_scheme = scheme;
00251         m_defined |= d_scheme;
00252     }
00253 
00257     void setScheme(const XalanDOMString &scheme) 
00258     { 
00259         m_scheme = scheme;
00260         m_defined |= d_scheme;
00261     }
00262 
00266     const XalanDOMString& getAuthority() const 
00267     { 
00268         return m_authority; 
00269     }
00270 
00274     bool isAuthorityDefined() const 
00275     { 
00276         return !!(m_defined & d_authority); 
00277     }
00278 
00282     void setAuthority(const XalanDOMChar *authority) 
00283     { 
00284         m_authority = authority;
00285         m_defined |= d_authority;
00286     }
00287 
00291     void setAuthority(const XalanDOMString &authority) 
00292     { 
00293         m_authority = authority;
00294         m_defined |= d_authority;
00295     }
00296 
00300     const XalanDOMString& getPath() const 
00301     { 
00302         return m_path; 
00303     }
00304 
00308     void setPath(const XalanDOMChar *path) 
00309     { 
00310         m_path = path;
00311     }
00312 
00316     void setPath(const XalanDOMString &path) 
00317     { 
00318         m_path = path;
00319     }
00320 
00324     const XalanDOMString& getQuery() const 
00325     { 
00326         return m_query; 
00327     }
00328 
00332     bool isQueryDefined() const 
00333     { 
00334         return !!(m_defined & d_query); 
00335     }
00336 
00340     void setQuery(const XalanDOMChar *query) 
00341     { 
00342         m_query = query;
00343         m_defined |= d_query;
00344     }
00345 
00349     void setQuery(const XalanDOMString &query) 
00350     { 
00351         m_query = query;
00352         m_defined |= d_query;
00353     }
00354 
00358     const XalanDOMString& getFragment() const 
00359     { 
00360         return m_fragment; 
00361     }
00362 
00366     bool isFragmentDefined() const 
00367     { 
00368         return !!(m_defined & d_fragment); 
00369     }
00370 
00374     void setFragment(const XalanDOMChar *fragment) 
00375     { 
00376         m_fragment = fragment;
00377         m_defined |= d_fragment;
00378     }
00379 
00383     void setFragment(const XalanDOMString &fragment) 
00384     { 
00385         m_fragment = fragment;
00386         m_defined |= d_fragment;
00387     }
00388 
00392     unsigned int getDefined() const
00393     {
00394         return m_defined;
00395     }
00396 
00400     void setDefined(unsigned int defined)
00401     {
00402         m_defined = defined;
00403     }
00404 
00405 private:
00406     XalanDOMString  m_scheme;
00407     XalanDOMString  m_authority;
00408     XalanDOMString  m_path;
00409     XalanDOMString  m_query;
00410     XalanDOMString  m_fragment;
00411 
00412     unsigned int    m_defined;
00413 };
00414 
00415 XALAN_CPP_NAMESPACE_END
00416 
00417 #endif // XALANPARSEDURI_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.7
Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.