diff options
Diffstat (limited to 'sal/inc/rtl/uri.h')
-rw-r--r-- | sal/inc/rtl/uri.h | 60 |
1 files changed, 54 insertions, 6 deletions
diff --git a/sal/inc/rtl/uri.h b/sal/inc/rtl/uri.h index fb84257d0216..99e88b4f2ad5 100644 --- a/sal/inc/rtl/uri.h +++ b/sal/inc/rtl/uri.h @@ -2,9 +2,9 @@ * * $RCSfile: uri.h,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * 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. * @@ -63,13 +63,13 @@ #define _RTL_URI_H_ #ifndef _RTL_TEXTENC_H -#include <rtl/textenc.h> +#include "rtl/textenc.h" #endif #ifndef _RTL_USTRING_H_ -#include <rtl/ustring.h> +#include "rtl/ustring.h" #endif #ifndef _SAL_TYPES_H_ -#include <sal/types.h> +#include "sal/types.h" #endif #if defined __cplusplus @@ -309,6 +309,54 @@ void rtl_uriDecode(rtl_uString * pText, rtl_uString ** pResult) SAL_THROW_EXTERN_C(); +/** Convert a relative URI reference into an absolute one. + + A URI reference is a URI plus an optional <"#" fragment> part. + + This function uses the algorithm described in RFC 2396, section 5.2, with + the following clarifications: (1) Backwards-compatible relative URIs + starting with a scheme component (see RFC 2396, section 5.2, step 3) are not + supported. (2) Segments "." and ".." within the path of the base URI are + not considered special, RFC 2396 seems a bit unlcear about that point. + (3) Erroneous excess segments ".." within the path of the relative URI (if + it is indeed relative) are left intact, as the examples in RFC 2396, + section C.2, suggest. (4) If the relative URI is a reference to the + "current document," the "current document" is taken to be the base URI. + + This function signals exceptions by returning false and letting pException + point to a message explaining the exception. + + @param pBaseUriRef + An absolute, hierarchical URI reference that serves as the base URI. If it + has to be inspected (i.e., pRelUriRef is not an absolute URI already), and + if it either is not an absolute URI (i.e., does not begin with a + <scheme ":"> part) or has a path that is non-empty but does not start + with "/", an exception will be signaled. + + @param pRelUriRef + An URI reference that may be either absolute or relative. If it is + absolute, it will be returned unmodified (and it need not be hierarchical + then). + + @param pResult + Returns an absolute URI reference. Must itself not be null, and must point + to either null or a valid string. If an exception is signalled, it is left + unchanged. + + @param pException + Returns an explanatory message in case an exception is signalled. Must + itself not be null, and must point to either null or a valid string. If no + exception is signalled, it is left unchanged. + + @return + True if no exception is signalled, otherwise false. + */ +sal_Bool rtl_uriConvertRelToAbs(rtl_uString * pBaseUriRef, + rtl_uString * pRelUriRef, + rtl_uString ** pResult, + rtl_uString ** pException) + SAL_THROW_EXTERN_C(); + #if defined __cplusplus } #endif /* __cplusplus */ |