diff options
author | Stephan Bergmann <sb@openoffice.org> | 2002-09-24 09:15:18 +0000 |
---|---|---|
committer | Stephan Bergmann <sb@openoffice.org> | 2002-09-24 09:15:18 +0000 |
commit | af7cf378c38c9bc7f062dea691a2d868affafdb5 (patch) | |
tree | d8605aa9762f2117646eccf8d48188b6c3146358 /sal/inc/rtl/uri.hxx | |
parent | a40f7fcb9417e9e13a66ca0ac94fd8f5d951ab23 (diff) |
#102945# Added convertRelToAbs.
Diffstat (limited to 'sal/inc/rtl/uri.hxx')
-rw-r--r-- | sal/inc/rtl/uri.hxx | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/sal/inc/rtl/uri.hxx b/sal/inc/rtl/uri.hxx index 3d575c1b2bdb..3a8c93caa45e 100644 --- a/sal/inc/rtl/uri.hxx +++ b/sal/inc/rtl/uri.hxx @@ -2,9 +2,9 @@ * * $RCSfile: uri.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: sb $ $Date: 2001-10-29 11:55:09 $ + * last change: $Author: sb $ $Date: 2002-09-24 10:15:18 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -50,7 +50,7 @@ * * The Initial Developer of the Original Code is: Sun Microsystems, Inc. * - * Copyright: 2000 by Sun Microsystems, Inc. + * Copyright: 2002 by Sun Microsystems, Inc. * * All Rights Reserved. * @@ -62,17 +62,20 @@ #ifndef _RTL_URI_HXX_ #define _RTL_URI_HXX_ +#ifndef INCLUDED_RTL_MALFORMEDURIEXCEPTION_HXX +#include "rtl/malformeduriexception.hxx" +#endif #ifndef _RTL_URI_H_ -#include <rtl/uri.h> +#include "rtl/uri.h" #endif #ifndef _RTL_TEXTENC_H -#include <rtl/textenc.h> +#include "rtl/textenc.h" #endif #ifndef _RTL_USTRING_HXX_ -#include <rtl/ustring.hxx> +#include "rtl/ustring.hxx" #endif #ifndef _SAL_TYPES_H_ -#include <sal/types.h> +#include "sal/types.h" #endif namespace rtl { @@ -107,6 +110,15 @@ public: rtl_TextEncoding eCharset) SAL_THROW(()); + /** A wrapper around rtl_uriConvertRelToAbs() from <rtl/uri.h> (see there). + + @exception MalformedUriException + Thrown in case rtl_uriConvertRelToAbs() signals an exception due to a + malformed base URI. + */ + static inline rtl::OUString convertRelToAbs( + rtl::OUString const & rBaseUriRef, rtl::OUString const & rRelUriRef); + private: /** not implemented @internal */ @@ -168,6 +180,19 @@ inline rtl::OUString Uri::decode(rtl::OUString const & rText, return aResult; } +inline rtl::OUString Uri::convertRelToAbs(rtl::OUString const & rBaseUriRef, + rtl::OUString const & rRelUriRef) +{ + rtl::OUString aResult; + rtl::OUString aException; + if (!rtl_uriConvertRelToAbs( + const_cast< rtl::OUString & >(rBaseUriRef).pData, + const_cast< rtl::OUString & >(rRelUriRef).pData, &aResult.pData, + &aException.pData)) + throw MalformedUriException(aException); + return aResult; +} + } #endif // _RTL_URI_HXX_ |