xref: /AOO41X/main/tools/inc/tools/urlobj.hxx (revision 8b851043d896eaadc6634f0a22437412985b1d4a)
1*8b851043SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*8b851043SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*8b851043SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*8b851043SAndrew Rist  * distributed with this work for additional information
6*8b851043SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*8b851043SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*8b851043SAndrew Rist  * "License"); you may not use this file except in compliance
9*8b851043SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*8b851043SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*8b851043SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*8b851043SAndrew Rist  * software distributed under the License is distributed on an
15*8b851043SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*8b851043SAndrew Rist  * KIND, either express or implied.  See the License for the
17*8b851043SAndrew Rist  * specific language governing permissions and limitations
18*8b851043SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*8b851043SAndrew Rist  *************************************************************/
21*8b851043SAndrew Rist 
22*8b851043SAndrew Rist 
23cdf0e10cSrcweir #ifndef _URLOBJ_HXX
24cdf0e10cSrcweir #define _URLOBJ_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include "tools/toolsdllapi.h"
27cdf0e10cSrcweir #include <tools/string.hxx>
28cdf0e10cSrcweir #include "com/sun/star/uno/Reference.hxx"
29cdf0e10cSrcweir #include "rtl/string.h"
30cdf0e10cSrcweir #include "rtl/ustrbuf.hxx"
31cdf0e10cSrcweir #include "rtl/textenc.h"
32cdf0e10cSrcweir #include "sal/types.h"
33cdf0e10cSrcweir 
34cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace util {
35cdf0e10cSrcweir     class XStringWidth;
36cdf0e10cSrcweir } } } }
37cdf0e10cSrcweir 
38cdf0e10cSrcweir //============================================================================
39cdf0e10cSrcweir // Special tokens:
40cdf0e10cSrcweir #define INET_PASS_TOKEN '@'
41cdf0e10cSrcweir #define INET_DELIM_TOKEN ':'
42cdf0e10cSrcweir #define INET_DELIM_IMAPID ';'
43cdf0e10cSrcweir #define INET_ENC_DELIM_TOKEN '|'
44cdf0e10cSrcweir #define INET_DELIM_HOST_TOKEN '.'
45cdf0e10cSrcweir #define INET_PATH_TOKEN '/'
46cdf0e10cSrcweir #define INET_DOSPATH_TOKEN '\\'
47cdf0e10cSrcweir #define INET_MARK_TOKEN '#'
48cdf0e10cSrcweir #define INET_PARAM_TOKEN '?'
49cdf0e10cSrcweir #define INET_HEX_ESCAPE '%'
50cdf0e10cSrcweir 
51cdf0e10cSrcweir //============================================================================
52cdf0e10cSrcweir // Common URL prefixes for various schemes:
53cdf0e10cSrcweir #define	INET_FTP_SCHEME "ftp://"
54cdf0e10cSrcweir #define INET_HTTP_SCHEME "http://"
55cdf0e10cSrcweir #define INET_HTTPS_SCHEME "https://"
56cdf0e10cSrcweir #define INET_FILE_SCHEME "file://"
57cdf0e10cSrcweir #define INET_GOPHER_SCHEME "gopher://"
58cdf0e10cSrcweir #define INET_MAILTO_SCHEME "mailto:"
59cdf0e10cSrcweir #define INET_CID_SCHEME "cid:"
60cdf0e10cSrcweir #define INET_NEWS_SCHEME "news:"
61cdf0e10cSrcweir #define INET_POP3_SCHEME "pop3://"
62cdf0e10cSrcweir #define INET_LDAP_SCHEME "ldap://"
63cdf0e10cSrcweir #define INET_PRIVATE_SCHEME "private:"
64cdf0e10cSrcweir #define INET_BUGDOC_SCHEME "bugdoc:"
65cdf0e10cSrcweir #define INET_SLOT_SCHEME "slot:"
66cdf0e10cSrcweir #define INET_MACRO_SCHEME "macro:"
67cdf0e10cSrcweir #define INET_JAVASCRIPT_SCHEME "javascript:"
68cdf0e10cSrcweir #define INET_IMAP_SCHEME "imap://"
69cdf0e10cSrcweir #define INET_DOWNPASS_SCHEME ".."
70cdf0e10cSrcweir #define INET_DATA_SCHEME "data:"
71cdf0e10cSrcweir #define INET_OUT_SCHEME "out://"
72cdf0e10cSrcweir #define INET_FIF_SCHEME "fif://"
73cdf0e10cSrcweir #define INET_CEPT_SCHEME "cept://"
74cdf0e10cSrcweir #define INET_VIM_SCHEME "vim://"
75cdf0e10cSrcweir #define INET_UNO_SCHEME ".uno:"
76cdf0e10cSrcweir #define INET_COMPONENT_SCHEME ".component:"
77cdf0e10cSrcweir #define INET_DB_SCHEME "db:"
78cdf0e10cSrcweir #define INET_BUGID_SCHEME "bugid:"
79cdf0e10cSrcweir #define INET_TELNET_SCHEME "telnet://"
80cdf0e10cSrcweir #define INET_HID_SCHEME "hid:"
81cdf0e10cSrcweir 
82cdf0e10cSrcweir #define URL_PREFIX_PRIV_SOFFICE "private:"
83cdf0e10cSrcweir enum
84cdf0e10cSrcweir {
85cdf0e10cSrcweir 	URL_PREFIX_PRIV_SOFFICE_LEN
86cdf0e10cSrcweir 	    = RTL_CONSTASCII_LENGTH(URL_PREFIX_PRIV_SOFFICE)
87cdf0e10cSrcweir };
88cdf0e10cSrcweir 
89cdf0e10cSrcweir #define URL_PREFIX_PRIV_OBSOLETE URL_PREFIX_PRIV_SOFFICE
90cdf0e10cSrcweir enum
91cdf0e10cSrcweir {
92cdf0e10cSrcweir 	URL_PREFIX_PRIV_OBSOLETE_LEN
93cdf0e10cSrcweir 	    = RTL_CONSTASCII_LENGTH(URL_PREFIX_PRIV_OBSOLETE)
94cdf0e10cSrcweir };
95cdf0e10cSrcweir 
96cdf0e10cSrcweir #define URL_PREFIX_PRIV_EXTERN "staroffice:"
97cdf0e10cSrcweir enum
98cdf0e10cSrcweir {
99cdf0e10cSrcweir 	URL_PREFIX_PRIV_EXTERN_LEN = RTL_CONSTASCII_LENGTH(URL_PREFIX_PRIV_EXTERN)
100cdf0e10cSrcweir };
101cdf0e10cSrcweir 
102cdf0e10cSrcweir //============================================================================
103cdf0e10cSrcweir // Schemes:
104cdf0e10cSrcweir enum INetProtocol
105cdf0e10cSrcweir {
106cdf0e10cSrcweir 	INET_PROT_NOT_VALID = 0,
107cdf0e10cSrcweir 	INET_PROT_FTP = 1,
108cdf0e10cSrcweir 	INET_PROT_HTTP = 2,
109cdf0e10cSrcweir 	INET_PROT_FILE = 3,
110cdf0e10cSrcweir 	INET_PROT_MAILTO = 4,
111cdf0e10cSrcweir 	INET_PROT_VND_SUN_STAR_WEBDAV = 5,
112cdf0e10cSrcweir 	INET_PROT_NEWS = 6,
113cdf0e10cSrcweir 	INET_PROT_PRIV_SOFFICE = 7,
114cdf0e10cSrcweir 	INET_PROT_PRIVATE = INET_PROT_PRIV_SOFFICE, // obsolete
115cdf0e10cSrcweir 	INET_PROT_VND_SUN_STAR_HELP = 8,
116cdf0e10cSrcweir 	INET_PROT_HTTPS = 9,
117cdf0e10cSrcweir 	INET_PROT_SLOT = 10,
118cdf0e10cSrcweir 	INET_PROT_MACRO = 11,
119cdf0e10cSrcweir 	INET_PROT_JAVASCRIPT = 12,
120cdf0e10cSrcweir 	INET_PROT_IMAP = 13,
121cdf0e10cSrcweir 	INET_PROT_POP3 = 14,
122cdf0e10cSrcweir 	INET_PROT_DATA = 15,
123cdf0e10cSrcweir 	INET_PROT_CID = 16,
124cdf0e10cSrcweir 	INET_PROT_OUT = 17,
125cdf0e10cSrcweir 	INET_PROT_VND_SUN_STAR_HIER = 18,
126cdf0e10cSrcweir 	INET_PROT_VIM = 19,
127cdf0e10cSrcweir 	INET_PROT_UNO = 20,
128cdf0e10cSrcweir 	INET_PROT_COMPONENT = 21,
129cdf0e10cSrcweir 	INET_PROT_VND_SUN_STAR_PKG = 22,
130cdf0e10cSrcweir 	INET_PROT_LDAP = 23,
131cdf0e10cSrcweir 	INET_PROT_DB = 24,
132cdf0e10cSrcweir 	INET_PROT_VND_SUN_STAR_CMD = 25,
133cdf0e10cSrcweir 	INET_PROT_VND_SUN_STAR_ODMA = 26,
134cdf0e10cSrcweir     INET_PROT_TELNET = 27,
135cdf0e10cSrcweir     INET_PROT_VND_SUN_STAR_EXPAND = 28,
136cdf0e10cSrcweir     INET_PROT_VND_SUN_STAR_TDOC = 29,
137cdf0e10cSrcweir     INET_PROT_GENERIC = 30,
138cdf0e10cSrcweir     INET_PROT_SMB = 31,
139cdf0e10cSrcweir 	INET_PROT_HID = 32,
140cdf0e10cSrcweir 	INET_PROT_END = 33
141cdf0e10cSrcweir };
142cdf0e10cSrcweir 
143cdf0e10cSrcweir //============================================================================
144cdf0e10cSrcweir class TOOLS_DLLPUBLIC INetURLObject
145cdf0e10cSrcweir {
146cdf0e10cSrcweir public:
147cdf0e10cSrcweir 	//========================================================================
148cdf0e10cSrcweir 	// Get- and Set-Methods:
149cdf0e10cSrcweir 
150cdf0e10cSrcweir 	/** The way input strings that represent (parts of) URIs are interpreted
151cdf0e10cSrcweir 		in set-methods.
152cdf0e10cSrcweir 
153cdf0e10cSrcweir 		@descr  Most set-methods accept either a ByteString or a rtl::OUString
154cdf0e10cSrcweir 		as input.  Using a ByteString, octets in the range 0x80--0xFF are
155cdf0e10cSrcweir 		replaced by single escape sequences.  Using a rtl::OUString , UTF-32
156cdf0e10cSrcweir 		characters in the range 0x80--0x10FFFF are replaced by sequences of
157cdf0e10cSrcweir 		escape sequences, representing the UTF-8 coded characters.
158cdf0e10cSrcweir 
159cdf0e10cSrcweir 		@descr  Along with an EncodeMechanism parameter, the set-methods all
160cdf0e10cSrcweir 		take an rtl_TextEncoding parameter, which is ignored unless the
161cdf0e10cSrcweir 		EncodeMechanism is WAS_ENCODED.
162cdf0e10cSrcweir 	 */
163cdf0e10cSrcweir 	enum EncodeMechanism
164cdf0e10cSrcweir 	{
165cdf0e10cSrcweir 		/** All escape sequences that are already present are ignored, and are
166cdf0e10cSrcweir 			interpreted as literal sequences of three characters.
167cdf0e10cSrcweir 		 */
168cdf0e10cSrcweir 		ENCODE_ALL,
169cdf0e10cSrcweir 
170cdf0e10cSrcweir 		/** Sequences of escape sequences, that represent characters from the
171cdf0e10cSrcweir 			specified character set and that can be converted to UTF-32
172cdf0e10cSrcweir 			characters, are first decoded.  If they have to be encoded, they
173cdf0e10cSrcweir 			are converted to UTF-8 characters and are than translated into
174cdf0e10cSrcweir 			(sequences of) escape sequences.  Other escape sequences are
175cdf0e10cSrcweir 			copied verbatim (but using upper case hex digits).
176cdf0e10cSrcweir 		 */
177cdf0e10cSrcweir 		WAS_ENCODED,
178cdf0e10cSrcweir 
179cdf0e10cSrcweir 		/** All escape sequences that are already present are copied verbatim
180cdf0e10cSrcweir 			(but using upper case hex digits).
181cdf0e10cSrcweir 		 */
182cdf0e10cSrcweir 		NOT_CANONIC
183cdf0e10cSrcweir 	};
184cdf0e10cSrcweir 
185cdf0e10cSrcweir 	/** The way strings that represent (parts of) URIs are returned from get-
186cdf0e10cSrcweir 		methods.
187cdf0e10cSrcweir 
188cdf0e10cSrcweir 		@descr  Along with a DecodeMechanism parameter, the get-methods all
189cdf0e10cSrcweir 		take an rtl_TextEncoding parameter, which is ignored unless the
190cdf0e10cSrcweir 		DecodeMechanism is DECODE_WITH_CHARSET or DECODE_UNAMBIGUOUS.
191cdf0e10cSrcweir 	 */
192cdf0e10cSrcweir 	enum DecodeMechanism
193cdf0e10cSrcweir 	{
194cdf0e10cSrcweir 		/** The (part of the) URI is returned unchanged.  Since URIs are
195cdf0e10cSrcweir 			written using a subset of US-ASCII, the returned string is
196cdf0e10cSrcweir 			guaranteed to contain only US-ASCII characters.
197cdf0e10cSrcweir 		 */
198cdf0e10cSrcweir 		NO_DECODE,
199cdf0e10cSrcweir 
200cdf0e10cSrcweir 		/** All sequences of escape sequences that represent UTF-8 coded
201cdf0e10cSrcweir 			UTF-32 characters with a numerical value greater than 0x7F, are
202cdf0e10cSrcweir 			replaced by the respective UTF-16 characters.  All other escape
203cdf0e10cSrcweir 			sequences are not decoded.
204cdf0e10cSrcweir 		 */
205cdf0e10cSrcweir 		DECODE_TO_IURI,
206cdf0e10cSrcweir 
207cdf0e10cSrcweir 		/** All (sequences of) escape sequences that represent characters from
208cdf0e10cSrcweir 			the specified character set, and that can be converted to UTF-32,
209cdf0e10cSrcweir 			are replaced by the respective UTF-16 characters.  All other
210cdf0e10cSrcweir 			escape sequences are not decoded.
211cdf0e10cSrcweir 		 */
212cdf0e10cSrcweir 		DECODE_WITH_CHARSET,
213cdf0e10cSrcweir 
214cdf0e10cSrcweir 		/** All (sequences of) escape sequences that represent characters from
215cdf0e10cSrcweir 			the specified character set, that can be converted to UTF-32, and
216cdf0e10cSrcweir 			that (in the case of ASCII characters) can safely be decoded
217cdf0e10cSrcweir 			without altering the meaning of the (part of the) URI, are
218cdf0e10cSrcweir 			replaced by the respective UTF-16 characters.  All other escape
219cdf0e10cSrcweir 			sequences are not decoded.
220cdf0e10cSrcweir 		 */
221cdf0e10cSrcweir 		DECODE_UNAMBIGUOUS
222cdf0e10cSrcweir 	};
223cdf0e10cSrcweir 
224cdf0e10cSrcweir 	//========================================================================
225cdf0e10cSrcweir 	// General Structure:
226cdf0e10cSrcweir 
INetURLObject()227cdf0e10cSrcweir 	inline INetURLObject():
228cdf0e10cSrcweir 		m_eScheme(INET_PROT_NOT_VALID), m_eSmartScheme(INET_PROT_HTTP) {}
229cdf0e10cSrcweir 
HasError() const230cdf0e10cSrcweir 	inline bool HasError() const { return m_eScheme == INET_PROT_NOT_VALID; }
231cdf0e10cSrcweir 
GetMainURL(DecodeMechanism eMechanism,rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const232cdf0e10cSrcweir 	inline rtl::OUString GetMainURL(DecodeMechanism eMechanism,
233cdf0e10cSrcweir 								rtl_TextEncoding eCharset
234cdf0e10cSrcweir 								    = RTL_TEXTENCODING_UTF8) const
235cdf0e10cSrcweir 	{ return decode(m_aAbsURIRef, getEscapePrefix(), eMechanism, eCharset); }
236cdf0e10cSrcweir 
237cdf0e10cSrcweir 	rtl::OUString GetURLNoPass(DecodeMechanism eMechanism = DECODE_TO_IURI,
238cdf0e10cSrcweir 						   rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
239cdf0e10cSrcweir 		const;
240cdf0e10cSrcweir 
241cdf0e10cSrcweir 	rtl::OUString GetURLNoMark(DecodeMechanism eMechanism = DECODE_TO_IURI,
242cdf0e10cSrcweir 						   rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
243cdf0e10cSrcweir 		const;
244cdf0e10cSrcweir 
245cdf0e10cSrcweir     rtl::OUString
246cdf0e10cSrcweir     getAbbreviated(com::sun::star::uno::Reference<
247cdf0e10cSrcweir                            com::sun::star::util::XStringWidth > const &
248cdf0e10cSrcweir                        rStringWidth,
249cdf0e10cSrcweir                    sal_Int32 nWidth,
250cdf0e10cSrcweir                    DecodeMechanism eMechanism = DECODE_TO_IURI,
251cdf0e10cSrcweir                    rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
252cdf0e10cSrcweir 		const;
253cdf0e10cSrcweir 
254cdf0e10cSrcweir 	bool operator ==(INetURLObject const & rObject) const;
255cdf0e10cSrcweir 
operator !=(INetURLObject const & rObject) const256cdf0e10cSrcweir 	inline bool operator !=(INetURLObject const & rObject) const
257cdf0e10cSrcweir 	{ return !(*this == rObject); }
258cdf0e10cSrcweir 
259cdf0e10cSrcweir 	bool operator <(INetURLObject const & rObject) const;
260cdf0e10cSrcweir 
operator >(INetURLObject const & rObject) const261cdf0e10cSrcweir 	inline bool operator >(INetURLObject const & rObject) const
262cdf0e10cSrcweir 	{ return rObject < *this; }
263cdf0e10cSrcweir 
264cdf0e10cSrcweir 	//========================================================================
265cdf0e10cSrcweir 	// Strict Parsing:
266cdf0e10cSrcweir 
267cdf0e10cSrcweir 	inline INetURLObject(ByteString const & rTheAbsURIRef,
268cdf0e10cSrcweir 						 EncodeMechanism eMechanism = WAS_ENCODED,
269cdf0e10cSrcweir 						 rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
270cdf0e10cSrcweir 
271cdf0e10cSrcweir 	inline INetURLObject(rtl::OUString const & rTheAbsURIRef,
272cdf0e10cSrcweir 						 EncodeMechanism eMechanism = WAS_ENCODED,
273cdf0e10cSrcweir 						 rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
274cdf0e10cSrcweir 
275cdf0e10cSrcweir 	inline bool SetURL(ByteString const & rTheAbsURIRef,
276cdf0e10cSrcweir 					   EncodeMechanism eMechanism = WAS_ENCODED,
277cdf0e10cSrcweir 					   rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
278cdf0e10cSrcweir 
279cdf0e10cSrcweir 	inline bool SetURL(rtl::OUString const & rTheAbsURIRef,
280cdf0e10cSrcweir 					   EncodeMechanism eMechanism = WAS_ENCODED,
281cdf0e10cSrcweir 					   rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
282cdf0e10cSrcweir 
283cdf0e10cSrcweir 	bool ConcatData(INetProtocol eTheScheme, rtl::OUString const & rTheUser,
284cdf0e10cSrcweir 					rtl::OUString const & rThePassword,
285cdf0e10cSrcweir 					rtl::OUString const & rTheHost, sal_uInt32 nThePort,
286cdf0e10cSrcweir 					rtl::OUString const & rThePath,
287cdf0e10cSrcweir 					EncodeMechanism eMechanism = WAS_ENCODED,
288cdf0e10cSrcweir 					rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
289cdf0e10cSrcweir 
290cdf0e10cSrcweir 	//========================================================================
291cdf0e10cSrcweir 	// Smart Parsing:
292cdf0e10cSrcweir 
293cdf0e10cSrcweir 	/** The supported notations for file system paths.
294cdf0e10cSrcweir 	 */
295cdf0e10cSrcweir 	enum FSysStyle
296cdf0e10cSrcweir 	{
297cdf0e10cSrcweir 		/** VOS notation (e.g., "//server/dir/file").
298cdf0e10cSrcweir 		 */
299cdf0e10cSrcweir 		FSYS_VOS = 0x1,
300cdf0e10cSrcweir 
301cdf0e10cSrcweir 		/** Unix notation (e.g., "/dir/file").
302cdf0e10cSrcweir 		 */
303cdf0e10cSrcweir 		FSYS_UNX = 0x2,
304cdf0e10cSrcweir 
305cdf0e10cSrcweir 		/** DOS notation (e.g., "a:\dir\file" and "\\server\dir\file").
306cdf0e10cSrcweir 		 */
307cdf0e10cSrcweir 		FSYS_DOS = 0x4,
308cdf0e10cSrcweir 
309cdf0e10cSrcweir 		/** Mac notation (e.g., "dir:file").
310cdf0e10cSrcweir 		 */
311cdf0e10cSrcweir 		FSYS_MAC = 0x8,
312cdf0e10cSrcweir 
313cdf0e10cSrcweir 		/** Detect the used notation.
314cdf0e10cSrcweir 
315cdf0e10cSrcweir 			@descr  For the following descriptions, please note that
316cdf0e10cSrcweir 			whereas FSYS_DEFAULT includes all style bits, combinations of only
317cdf0e10cSrcweir 			a few style bits are also possible, and are also described.
318cdf0e10cSrcweir 
319cdf0e10cSrcweir 			@descr  When used to translate a file system path to a file URL,
320cdf0e10cSrcweir 			the subset of the following productions for which the appropriate
321cdf0e10cSrcweir 			style bit is set are checked in order (using the conventions of
322cdf0e10cSrcweir 			RFC 2234, RFC 2396, and RFC 2732; UCS4 stands for any UCS4
323cdf0e10cSrcweir 			character):
324cdf0e10cSrcweir 
325cdf0e10cSrcweir 			 Production T1 (VOS local; FSYS_VOS only):
326cdf0e10cSrcweir 			    "//." ["/" *UCS4]
327cdf0e10cSrcweir 			  becomes
328cdf0e10cSrcweir 			    "file:///" *UCS4
329cdf0e10cSrcweir 
330cdf0e10cSrcweir 			 Production T2 (VOS host; FSYS_VOS only):
331cdf0e10cSrcweir 			    "//" [host] ["/" *UCS4]
332cdf0e10cSrcweir 			  becomes
333cdf0e10cSrcweir 			    "file://" host "/" *UCS4
334cdf0e10cSrcweir 
335cdf0e10cSrcweir 			 Production T3 (UNC; FSYS_DOS only):
336cdf0e10cSrcweir 			    "\\" [host] ["\" *UCS4]
337cdf0e10cSrcweir 			  becomes
338cdf0e10cSrcweir 			    "file://" host "/" *UCS4
339cdf0e10cSrcweir 			  replacing "\" by "/" within <*UCS4>
340cdf0e10cSrcweir 
341cdf0e10cSrcweir 			 Production T4 (Unix-like DOS; FSYS_DOS only):
342cdf0e10cSrcweir 			    ALPHA ":" ["/" *UCS4]
343cdf0e10cSrcweir 			  becomes
344cdf0e10cSrcweir 			    "file:///" ALPHA ":/" *UCS4
345cdf0e10cSrcweir 			  replacing "\" by "/" within <*UCS4>
346cdf0e10cSrcweir 
347cdf0e10cSrcweir 			 Production T5 (DOS; FSYS_DOS only):
348cdf0e10cSrcweir 			    ALPHA ":" ["\" *UCS4]
349cdf0e10cSrcweir 			  becomes
350cdf0e10cSrcweir 			    "file:///" ALPHA ":/" *UCS4
351cdf0e10cSrcweir 			  replacing "\" by "/" within <*UCS4>
352cdf0e10cSrcweir 
353cdf0e10cSrcweir 			 Production T6 (any):
354cdf0e10cSrcweir 			    *UCS4
355cdf0e10cSrcweir 			  becomes
356cdf0e10cSrcweir 			    "file:///" *UCS4
357cdf0e10cSrcweir 			  replacing the delimiter by "/" within <*UCS4>.  The delimiter is
358cdf0e10cSrcweir 			  that character from the set { "/", "\", ":" } which appears most
359cdf0e10cSrcweir 			  often in <*UCS4> (if FSYS_UNX is not among the style bits, "/"
360cdf0e10cSrcweir 			  is removed from the set; if FSYS_DOS is not among the style
361cdf0e10cSrcweir 			  bits, "\" is removed from the set; if FSYS_MAC is not among the
362cdf0e10cSrcweir 			  style bits, ":" is removed from the set).  If two or more
363cdf0e10cSrcweir 			  characters appear the same number of times, the character
364cdf0e10cSrcweir 			  mentioned first in that set is chosen.  If the first character
365cdf0e10cSrcweir 			  of <*UCS4> is the delimiter, that character is not copied.
366cdf0e10cSrcweir 
367cdf0e10cSrcweir 			@descr  When used to translate a file URL to a file system path,
368cdf0e10cSrcweir 			the following productions are checked in order (using the
369cdf0e10cSrcweir 			conventions of RFC 2234, RFC 2396, and RFC 2732):
370cdf0e10cSrcweir 
371cdf0e10cSrcweir 			 Production F1 (VOS; FSYS_VOS):
372cdf0e10cSrcweir 			    "file://" host "/" fpath ["#" fragment]
373cdf0e10cSrcweir 			  becomes
374cdf0e10cSrcweir 			    "//" host "/" fpath
375cdf0e10cSrcweir 
376cdf0e10cSrcweir 			 Production F2 (DOS; FSYS_DOS):
377cdf0e10cSrcweir 			    "file:///" ALPHA ":" ["/" fpath] ["#" fragment]
378cdf0e10cSrcweir 			  becomes
379cdf0e10cSrcweir 			    ALPHA ":" ["\" fpath]
380cdf0e10cSrcweir 			  replacing "/" by "\" in <fpath>
381cdf0e10cSrcweir 
382cdf0e10cSrcweir 			 Production F3 (Unix; FSYS_UNX):
383cdf0e10cSrcweir 			    "file:///" fpath ["#" fragment]
384cdf0e10cSrcweir 			  becomes
385cdf0e10cSrcweir 			    "/" fpath
386cdf0e10cSrcweir 		 */
387cdf0e10cSrcweir 		FSYS_DETECT = FSYS_VOS | FSYS_UNX | FSYS_DOS
388cdf0e10cSrcweir 	};
389cdf0e10cSrcweir 
390cdf0e10cSrcweir 	inline INetURLObject(rtl::OUString const & rTheAbsURIRef,
391cdf0e10cSrcweir 						 INetProtocol eTheSmartScheme,
392cdf0e10cSrcweir 						 EncodeMechanism eMechanism = WAS_ENCODED,
393cdf0e10cSrcweir 						 rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
394cdf0e10cSrcweir 						 FSysStyle eStyle = FSYS_DETECT);
395cdf0e10cSrcweir 
SetSmartProtocol(INetProtocol eTheSmartScheme)396cdf0e10cSrcweir 	inline void SetSmartProtocol(INetProtocol eTheSmartScheme)
397cdf0e10cSrcweir 	{ m_eSmartScheme = eTheSmartScheme; }
398cdf0e10cSrcweir 
399cdf0e10cSrcweir 	inline bool
400cdf0e10cSrcweir 	SetSmartURL(ByteString const & rTheAbsURIRef,
401cdf0e10cSrcweir 				EncodeMechanism eMechanism = WAS_ENCODED,
402cdf0e10cSrcweir 				rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
403cdf0e10cSrcweir 				FSysStyle eStyle = FSYS_DETECT);
404cdf0e10cSrcweir 
405cdf0e10cSrcweir 	inline bool
406cdf0e10cSrcweir 	SetSmartURL(rtl::OUString const & rTheAbsURIRef,
407cdf0e10cSrcweir 				EncodeMechanism eMechanism = WAS_ENCODED,
408cdf0e10cSrcweir 				rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
409cdf0e10cSrcweir 				FSysStyle eStyle = FSYS_DETECT);
410cdf0e10cSrcweir 
411cdf0e10cSrcweir 	inline INetURLObject
412cdf0e10cSrcweir 	smartRel2Abs(ByteString const & rTheRelURIRef,
413cdf0e10cSrcweir 				 bool & rWasAbsolute,
414cdf0e10cSrcweir 				 bool bIgnoreFragment = false,
415cdf0e10cSrcweir 				 EncodeMechanism eMechanism = WAS_ENCODED,
416cdf0e10cSrcweir 				 rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
417cdf0e10cSrcweir 				 bool bRelativeNonURIs = false,
418cdf0e10cSrcweir 				 FSysStyle eStyle = FSYS_DETECT) const;
419cdf0e10cSrcweir 
420cdf0e10cSrcweir 	inline INetURLObject
421cdf0e10cSrcweir 	smartRel2Abs(rtl::OUString const & rTheRelURIRef,
422cdf0e10cSrcweir 				 bool & rWasAbsolute,
423cdf0e10cSrcweir 				 bool bIgnoreFragment = false,
424cdf0e10cSrcweir 				 EncodeMechanism eMechanism = WAS_ENCODED,
425cdf0e10cSrcweir 				 rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
426cdf0e10cSrcweir 				 bool bRelativeNonURIs = false,
427cdf0e10cSrcweir 				 FSysStyle eStyle = FSYS_DETECT) const;
428cdf0e10cSrcweir 
429cdf0e10cSrcweir 	//========================================================================
430cdf0e10cSrcweir 	// Relative URLs:
431cdf0e10cSrcweir 
432cdf0e10cSrcweir 	inline bool
433cdf0e10cSrcweir 	GetNewAbsURL(ByteString const & rTheRelURIRef,
434cdf0e10cSrcweir 				 INetURLObject * pTheAbsURIRef,
435cdf0e10cSrcweir 				 EncodeMechanism eMechanism = WAS_ENCODED,
436cdf0e10cSrcweir 				 rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
437cdf0e10cSrcweir 				 FSysStyle eStyle = FSYS_DETECT, bool bIgnoreFragment = false)
438cdf0e10cSrcweir         const;
439cdf0e10cSrcweir 
440cdf0e10cSrcweir 	inline bool
441cdf0e10cSrcweir 	GetNewAbsURL(rtl::OUString const & rTheRelURIRef,
442cdf0e10cSrcweir 				 INetURLObject * pTheAbsURIRef,
443cdf0e10cSrcweir 				 EncodeMechanism eMechanism = WAS_ENCODED,
444cdf0e10cSrcweir 				 rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
445cdf0e10cSrcweir 				 FSysStyle eStyle = FSYS_DETECT, bool bIgnoreFragment = false)
446cdf0e10cSrcweir         const;
447cdf0e10cSrcweir 
448cdf0e10cSrcweir 	/** @descr  If rTheRelURIRef cannot be converted to an absolute URL
449cdf0e10cSrcweir 		(because of syntactic reasons), either rTheRelURIRef or an empty
450cdf0e10cSrcweir 		string is returned:  If all of the parameters eEncodeMechanism,
451cdf0e10cSrcweir 		eDecodeMechanism and eCharset have their respective default values,
452cdf0e10cSrcweir 		then rTheRelURIRef is returned unmodified; otherwise, an empty string
453cdf0e10cSrcweir 		is returned.
454cdf0e10cSrcweir 	 */
455cdf0e10cSrcweir     static rtl::OUString
456cdf0e10cSrcweir     GetAbsURL(rtl::OUString const & rTheBaseURIRef,
457cdf0e10cSrcweir               rtl::OUString const & rTheRelURIRef,
458cdf0e10cSrcweir               bool bIgnoreFragment = false,
459cdf0e10cSrcweir               EncodeMechanism eEncodeMechanism = WAS_ENCODED,
460cdf0e10cSrcweir               DecodeMechanism eDecodeMechanism = DECODE_TO_IURI,
461cdf0e10cSrcweir               rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
462cdf0e10cSrcweir               FSysStyle eStyle = FSYS_DETECT);
463cdf0e10cSrcweir 
464cdf0e10cSrcweir 	static inline rtl::OUString
465cdf0e10cSrcweir 	GetRelURL(ByteString const & rTheBaseURIRef,
466cdf0e10cSrcweir 			  ByteString const & rTheAbsURIRef,
467cdf0e10cSrcweir 			  EncodeMechanism eEncodeMechanism = WAS_ENCODED,
468cdf0e10cSrcweir 			  DecodeMechanism eDecodeMechanism = DECODE_TO_IURI,
469cdf0e10cSrcweir 			  rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
470cdf0e10cSrcweir 			  FSysStyle eStyle = FSYS_DETECT);
471cdf0e10cSrcweir 
472cdf0e10cSrcweir 	static inline rtl::OUString
473cdf0e10cSrcweir 	GetRelURL(rtl::OUString const & rTheBaseURIRef,
474cdf0e10cSrcweir 			  rtl::OUString const & rTheAbsURIRef,
475cdf0e10cSrcweir 			  EncodeMechanism eEncodeMechanism = WAS_ENCODED,
476cdf0e10cSrcweir 			  DecodeMechanism eDecodeMechanism = DECODE_TO_IURI,
477cdf0e10cSrcweir 			  rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
478cdf0e10cSrcweir 			  FSysStyle eStyle = FSYS_DETECT);
479cdf0e10cSrcweir 
480cdf0e10cSrcweir 	//========================================================================
481cdf0e10cSrcweir 	// External URLs:
482cdf0e10cSrcweir 
483cdf0e10cSrcweir 	rtl::OUString getExternalURL(DecodeMechanism eMechanism = DECODE_TO_IURI,
484cdf0e10cSrcweir 							 rtl_TextEncoding eCharset
485cdf0e10cSrcweir 							     = RTL_TEXTENCODING_UTF8) const;
486cdf0e10cSrcweir 
487cdf0e10cSrcweir 	static inline bool translateToExternal(ByteString const & rTheIntURIRef,
488cdf0e10cSrcweir 										   rtl::OUString & rTheExtURIRef,
489cdf0e10cSrcweir 										   DecodeMechanism eDecodeMechanism
490cdf0e10cSrcweir 										       = DECODE_TO_IURI,
491cdf0e10cSrcweir 										   rtl_TextEncoding eCharset
492cdf0e10cSrcweir 										       = RTL_TEXTENCODING_UTF8);
493cdf0e10cSrcweir 
494cdf0e10cSrcweir 	static inline bool translateToExternal(rtl::OUString const & rTheIntURIRef,
495cdf0e10cSrcweir 										   rtl::OUString & rTheExtURIRef,
496cdf0e10cSrcweir 										   DecodeMechanism eDecodeMechanism
497cdf0e10cSrcweir 										       = DECODE_TO_IURI,
498cdf0e10cSrcweir 										   rtl_TextEncoding eCharset
499cdf0e10cSrcweir 										       = RTL_TEXTENCODING_UTF8);
500cdf0e10cSrcweir 
501cdf0e10cSrcweir 	static inline bool translateToInternal(ByteString const & rTheExtURIRef,
502cdf0e10cSrcweir 										   rtl::OUString & rTheIntURIRef,
503cdf0e10cSrcweir 										   DecodeMechanism eDecodeMechanism
504cdf0e10cSrcweir 										       = DECODE_TO_IURI,
505cdf0e10cSrcweir 										   rtl_TextEncoding eCharset
506cdf0e10cSrcweir 										       = RTL_TEXTENCODING_UTF8);
507cdf0e10cSrcweir 
508cdf0e10cSrcweir     static inline bool translateToInternal(rtl::OUString const & rTheExtURIRef,
509cdf0e10cSrcweir                                            rtl::OUString & rTheIntURIRef,
510cdf0e10cSrcweir                                            DecodeMechanism eDecodeMechanism
511cdf0e10cSrcweir                                                = DECODE_TO_IURI,
512cdf0e10cSrcweir                                            rtl_TextEncoding eCharset
513cdf0e10cSrcweir                                                = RTL_TEXTENCODING_UTF8);
514cdf0e10cSrcweir 
515cdf0e10cSrcweir 	//========================================================================
516cdf0e10cSrcweir 	// Scheme:
517cdf0e10cSrcweir 
518cdf0e10cSrcweir 	struct SchemeInfo;
519cdf0e10cSrcweir 
GetProtocol() const520cdf0e10cSrcweir 	inline INetProtocol GetProtocol() const { return m_eScheme; }
521cdf0e10cSrcweir 
522cdf0e10cSrcweir 	/** Return the URL 'prefix' for a given scheme.
523cdf0e10cSrcweir 
524cdf0e10cSrcweir 		@param eTheScheme  One of the supported URL schemes.
525cdf0e10cSrcweir 
526cdf0e10cSrcweir 		@return  The 'prefix' of URLs of the given scheme.
527cdf0e10cSrcweir 	 */
528cdf0e10cSrcweir 	static rtl::OUString GetScheme(INetProtocol eTheScheme);
529cdf0e10cSrcweir 
CompareProtocolScheme(ByteString const & rTheAbsURIRef)530cdf0e10cSrcweir 	static inline INetProtocol CompareProtocolScheme(ByteString const &
531cdf0e10cSrcweir 													     rTheAbsURIRef)
532cdf0e10cSrcweir 	{ return CompareProtocolScheme(extend(rTheAbsURIRef)); }
533cdf0e10cSrcweir 
534cdf0e10cSrcweir 	static INetProtocol CompareProtocolScheme(rtl::OUString const &
535cdf0e10cSrcweir 											      rTheAbsURIRef);
536cdf0e10cSrcweir 
537cdf0e10cSrcweir 	//========================================================================
538cdf0e10cSrcweir 	// User Info:
539cdf0e10cSrcweir 
HasUserData() const540cdf0e10cSrcweir 	inline bool HasUserData() const { return m_aUser.isPresent(); }
541cdf0e10cSrcweir 
IsEmptyUser() const542cdf0e10cSrcweir 	inline bool IsEmptyUser() const
543cdf0e10cSrcweir 	{ return m_aUser.isPresent() && m_aUser.isEmpty(); }
544cdf0e10cSrcweir 
545cdf0e10cSrcweir 	bool hasPassword() const;
546cdf0e10cSrcweir 
IsEmptyPass() const547cdf0e10cSrcweir 	inline bool IsEmptyPass() const
548cdf0e10cSrcweir 	{ return hasPassword() && m_aAuth.isEmpty(); }
549cdf0e10cSrcweir 
GetUser(DecodeMechanism eMechanism=DECODE_TO_IURI,rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const550cdf0e10cSrcweir 	inline rtl::OUString GetUser(DecodeMechanism eMechanism = DECODE_TO_IURI,
551cdf0e10cSrcweir 							 rtl_TextEncoding eCharset
552cdf0e10cSrcweir 							     = RTL_TEXTENCODING_UTF8) const
553cdf0e10cSrcweir 	{ return decode(m_aUser, getEscapePrefix(), eMechanism, eCharset); }
554cdf0e10cSrcweir 
GetPass(DecodeMechanism eMechanism=DECODE_TO_IURI,rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const555cdf0e10cSrcweir 	inline rtl::OUString GetPass(DecodeMechanism eMechanism = DECODE_TO_IURI,
556cdf0e10cSrcweir 							 rtl_TextEncoding eCharset
557cdf0e10cSrcweir 							     = RTL_TEXTENCODING_UTF8) const
558cdf0e10cSrcweir 	{ return decode(m_aAuth, getEscapePrefix(), eMechanism, eCharset); }
559cdf0e10cSrcweir 
SetUser(ByteString const & rTheUser,EncodeMechanism eMechanism=WAS_ENCODED,rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)560cdf0e10cSrcweir 	inline bool SetUser(ByteString const & rTheUser,
561cdf0e10cSrcweir 						EncodeMechanism eMechanism = WAS_ENCODED,
562cdf0e10cSrcweir 						rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
563cdf0e10cSrcweir 	{ return setUser(extend(rTheUser), true, eMechanism, eCharset); }
564cdf0e10cSrcweir 
SetUser(rtl::OUString const & rTheUser,EncodeMechanism eMechanism=WAS_ENCODED,rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)565cdf0e10cSrcweir 	inline bool SetUser(rtl::OUString const & rTheUser,
566cdf0e10cSrcweir 						EncodeMechanism eMechanism = WAS_ENCODED,
567cdf0e10cSrcweir 						rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
568cdf0e10cSrcweir 	{ return setUser(rTheUser, false, eMechanism, eCharset); }
569cdf0e10cSrcweir 
570cdf0e10cSrcweir 	void makeAuthCanonic();
571cdf0e10cSrcweir 
572cdf0e10cSrcweir 	inline bool SetPass(ByteString const & rThePassword,
573cdf0e10cSrcweir 						EncodeMechanism eMechanism = WAS_ENCODED,
574cdf0e10cSrcweir 						rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
575cdf0e10cSrcweir 
576cdf0e10cSrcweir 	inline bool SetPass(rtl::OUString const & rThePassword,
577cdf0e10cSrcweir 						EncodeMechanism eMechanism = WAS_ENCODED,
578cdf0e10cSrcweir 						rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
579cdf0e10cSrcweir 
580cdf0e10cSrcweir 	inline bool SetUserAndPass(ByteString const & rTheUser,
581cdf0e10cSrcweir 							   ByteString const & rThePassword,
582cdf0e10cSrcweir 							   EncodeMechanism eMechanism = WAS_ENCODED,
583cdf0e10cSrcweir 							   rtl_TextEncoding eCharset
584cdf0e10cSrcweir 							       = RTL_TEXTENCODING_UTF8);
585cdf0e10cSrcweir 
586cdf0e10cSrcweir 	inline bool SetUserAndPass(rtl::OUString const & rTheUser,
587cdf0e10cSrcweir 							   rtl::OUString const & rThePassword,
588cdf0e10cSrcweir 							   EncodeMechanism eMechanism = WAS_ENCODED,
589cdf0e10cSrcweir 							   rtl_TextEncoding eCharset
590cdf0e10cSrcweir 							       = RTL_TEXTENCODING_UTF8);
591cdf0e10cSrcweir 
592cdf0e10cSrcweir 	//========================================================================
593cdf0e10cSrcweir 	// Host and Port:
594cdf0e10cSrcweir 
HasPort() const595cdf0e10cSrcweir 	inline bool HasPort() const { return m_aPort.isPresent(); }
596cdf0e10cSrcweir 
GetHost(DecodeMechanism eMechanism=DECODE_TO_IURI,rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const597cdf0e10cSrcweir 	inline rtl::OUString GetHost(DecodeMechanism eMechanism = DECODE_TO_IURI,
598cdf0e10cSrcweir 							 rtl_TextEncoding eCharset
599cdf0e10cSrcweir 							     = RTL_TEXTENCODING_UTF8) const
600cdf0e10cSrcweir 	{ return decode(m_aHost, getEscapePrefix(), eMechanism, eCharset); }
601cdf0e10cSrcweir 
602cdf0e10cSrcweir 	rtl::OUString GetHostPort(DecodeMechanism eMechanism = DECODE_TO_IURI,
603cdf0e10cSrcweir 						  rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
604cdf0e10cSrcweir 
605cdf0e10cSrcweir 	sal_uInt32 GetPort() const;
606cdf0e10cSrcweir 
SetHost(ByteString const & rTheHost,EncodeMechanism eMechanism=WAS_ENCODED,rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)607cdf0e10cSrcweir 	inline bool SetHost(ByteString const & rTheHost,
608cdf0e10cSrcweir 						EncodeMechanism eMechanism = WAS_ENCODED,
609cdf0e10cSrcweir 						rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
610cdf0e10cSrcweir 	{ return setHost(extend(rTheHost), true, eMechanism, eCharset); }
611cdf0e10cSrcweir 
SetHost(rtl::OUString const & rTheHost,EncodeMechanism eMechanism=WAS_ENCODED,rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)612cdf0e10cSrcweir 	inline bool SetHost(rtl::OUString const & rTheHost,
613cdf0e10cSrcweir 						EncodeMechanism eMechanism = WAS_ENCODED,
614cdf0e10cSrcweir 						rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
615cdf0e10cSrcweir 	{ return setHost(rTheHost, false, eMechanism, eCharset); }
616cdf0e10cSrcweir 
617cdf0e10cSrcweir 	bool SetPort(sal_uInt32 nThePort);
618cdf0e10cSrcweir 
619cdf0e10cSrcweir 	void makePortCanonic();
620cdf0e10cSrcweir 
621cdf0e10cSrcweir 	/** Encode the <hostport> part of a URL.
622cdf0e10cSrcweir 
623cdf0e10cSrcweir 		@ATT  Obsolete, because at the moment the <hostport> part of a URL may
624cdf0e10cSrcweir 		not contain any escape sequences anyway, and because this method does
625cdf0e10cSrcweir 		not inform the caller whether the given <hostport> part is legal.
626cdf0e10cSrcweir 
627cdf0e10cSrcweir 		@param rTheHostPort  The <hostport> part of a URL (for its
628cdf0e10cSrcweir 		interpretation, see the general discussion for set-methods).
629cdf0e10cSrcweir 
630cdf0e10cSrcweir 		@param eMechanism  See the general discussion for set-methods.
631cdf0e10cSrcweir 
632cdf0e10cSrcweir 		@param eCharset  See the general discussion for set-methods.
633cdf0e10cSrcweir 
634cdf0e10cSrcweir 		@return  The <hostport> part, encoded according to the given mechanism
635cdf0e10cSrcweir 		and charset ('forbidden' characters replaced by escape sequences).
636cdf0e10cSrcweir 	 */
637cdf0e10cSrcweir 	static inline rtl::OUString encodeHostPort(ByteString const & rTheHostPort,
638cdf0e10cSrcweir 										   EncodeMechanism eMechanism,
639cdf0e10cSrcweir 										   rtl_TextEncoding eCharset
640cdf0e10cSrcweir 										       = RTL_TEXTENCODING_UTF8);
641cdf0e10cSrcweir 
642cdf0e10cSrcweir 	/** Encode the <hostport> part of a URL.
643cdf0e10cSrcweir 
644cdf0e10cSrcweir 		@ATT  Obsolete, because at the moment the <hostport> part of a URL may
645cdf0e10cSrcweir 		not contain any escape sequences anyway, and because this method does
646cdf0e10cSrcweir 		not inform the caller whether the given <hostport> part is legal.
647cdf0e10cSrcweir 
648cdf0e10cSrcweir 		@param rTheHostPort  The <hostport> part of a URL (for its
649cdf0e10cSrcweir 		interpretation, see the general discussion for set-methods).
650cdf0e10cSrcweir 
651cdf0e10cSrcweir 		@param eMechanism  See the general discussion for set-methods.
652cdf0e10cSrcweir 
653cdf0e10cSrcweir 		@param eCharset  See the general discussion for set-methods.
654cdf0e10cSrcweir 
655cdf0e10cSrcweir 		@return  The <hostport> part, encoded according to the given mechanism
656cdf0e10cSrcweir 		and charset ('forbidden' characters replaced by escape sequences).
657cdf0e10cSrcweir 	 */
encodeHostPort(rtl::OUString const & rTheHostPort,EncodeMechanism eMechanism,rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)658cdf0e10cSrcweir 	static inline rtl::OUString encodeHostPort(rtl::OUString const & rTheHostPort,
659cdf0e10cSrcweir 										   EncodeMechanism eMechanism,
660cdf0e10cSrcweir 										   rtl_TextEncoding eCharset
661cdf0e10cSrcweir 										       = RTL_TEXTENCODING_UTF8)
662cdf0e10cSrcweir 	{ return encodeHostPort(rTheHostPort, false, eMechanism, eCharset); }
663cdf0e10cSrcweir 
664cdf0e10cSrcweir 	//========================================================================
665cdf0e10cSrcweir 	// Path:
666cdf0e10cSrcweir 
HasURLPath() const667cdf0e10cSrcweir 	inline bool HasURLPath() const { return !m_aPath.isEmpty(); }
668cdf0e10cSrcweir 
GetURLPath(DecodeMechanism eMechanism=DECODE_TO_IURI,rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const669cdf0e10cSrcweir 	inline rtl::OUString GetURLPath(DecodeMechanism eMechanism = DECODE_TO_IURI,
670cdf0e10cSrcweir 								rtl_TextEncoding eCharset
671cdf0e10cSrcweir 								    = RTL_TEXTENCODING_UTF8) const
672cdf0e10cSrcweir 	{ return decode(m_aPath, getEscapePrefix(), eMechanism, eCharset); }
673cdf0e10cSrcweir 
SetURLPath(ByteString const & rThePath,EncodeMechanism eMechanism=WAS_ENCODED,rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)674cdf0e10cSrcweir 	inline bool SetURLPath(ByteString const & rThePath,
675cdf0e10cSrcweir 						   EncodeMechanism eMechanism = WAS_ENCODED,
676cdf0e10cSrcweir 						   rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
677cdf0e10cSrcweir 	{ return setPath(extend(rThePath), true, eMechanism, eCharset); }
678cdf0e10cSrcweir 
SetURLPath(rtl::OUString const & rThePath,EncodeMechanism eMechanism=WAS_ENCODED,rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)679cdf0e10cSrcweir 	inline bool SetURLPath(rtl::OUString const & rThePath,
680cdf0e10cSrcweir 						   EncodeMechanism eMechanism = WAS_ENCODED,
681cdf0e10cSrcweir 						   rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
682cdf0e10cSrcweir 	{ return setPath(rThePath, false, eMechanism, eCharset); }
683cdf0e10cSrcweir 
684cdf0e10cSrcweir 	//========================================================================
685cdf0e10cSrcweir 	// Hierarchical Path:
686cdf0e10cSrcweir 
687cdf0e10cSrcweir 	/** A constant to address the last segment in various methods dealing with
688cdf0e10cSrcweir 		hierarchical paths.
689cdf0e10cSrcweir 
690cdf0e10cSrcweir 		@descr  It is often more efficient to address the last segment using
691cdf0e10cSrcweir 		this constant, than to determine its ordinal value using
692cdf0e10cSrcweir 		getSegmentCount().
693cdf0e10cSrcweir 	 */
694cdf0e10cSrcweir 	enum { LAST_SEGMENT = -1 };
695cdf0e10cSrcweir 
696cdf0e10cSrcweir 	/** The number of segments in the hierarchical path.
697cdf0e10cSrcweir 
698cdf0e10cSrcweir 		@descr  Using RFC 2396 and RFC 2234, a hierarchical path is of the
699cdf0e10cSrcweir 		form
700cdf0e10cSrcweir 
701cdf0e10cSrcweir 		  hierarchical-path = 1*("/" segment)
702cdf0e10cSrcweir 
703cdf0e10cSrcweir 		  segment = name *(";" param)
704cdf0e10cSrcweir 
705cdf0e10cSrcweir 		  name = [base ["." extension]]
706cdf0e10cSrcweir 
707cdf0e10cSrcweir 		  base = 1*pchar
708cdf0e10cSrcweir 
709cdf0e10cSrcweir 		  extension = *<any pchar except ".">
710cdf0e10cSrcweir 
711cdf0e10cSrcweir 		  param = *pchar
712cdf0e10cSrcweir 
713cdf0e10cSrcweir 		@param bIgnoreFinalSlash  If true, a final slash at the end of the
714cdf0e10cSrcweir 		hierarchical path does not denote an empty segment, but is ignored.
715cdf0e10cSrcweir 
716cdf0e10cSrcweir 		@return  The number of segments in the hierarchical path.  If the path
717cdf0e10cSrcweir 		is not hierarchical, 0 is returned.
718cdf0e10cSrcweir 	 */
719cdf0e10cSrcweir 	sal_Int32 getSegmentCount(bool bIgnoreFinalSlash = true) const;
720cdf0e10cSrcweir 
721cdf0e10cSrcweir 	/** Remove a segment from the hierarchical path.
722cdf0e10cSrcweir 
723cdf0e10cSrcweir 		@param nIndex  The non-negative index of the segment, or LAST_SEGMENT
724cdf0e10cSrcweir 		if addressing the last segment.
725cdf0e10cSrcweir 
726cdf0e10cSrcweir 		@param bIgnoreFinalSlash  If true, a final slash at the end of the
727cdf0e10cSrcweir 		hierarchical path does not denote an empty segment, but is ignored.
728cdf0e10cSrcweir 
729cdf0e10cSrcweir 		@return  True if the segment has successfully been removed (and the
730cdf0e10cSrcweir 		resulting URI is still valid).  If the path is not hierarchical, or
731cdf0e10cSrcweir 		the specified segment does not exist, false is returned.  If false is
732cdf0e10cSrcweir 		returned, the object is not modified.
733cdf0e10cSrcweir 	 */
734cdf0e10cSrcweir 	bool removeSegment(sal_Int32 nIndex = LAST_SEGMENT,
735cdf0e10cSrcweir 					   bool bIgnoreFinalSlash = true);
736cdf0e10cSrcweir 
737cdf0e10cSrcweir 	/** Insert a new segment into the hierarchical path.
738cdf0e10cSrcweir 
739cdf0e10cSrcweir 		@param rTheName  The name part of the new segment.  The new segment
740cdf0e10cSrcweir 		will contain no parameters.
741cdf0e10cSrcweir 
742cdf0e10cSrcweir 		@param bAppendFinalSlash  If the new segment is appended at the end of
743cdf0e10cSrcweir 		the hierarchical path, this parameter specifies whether to add a final
744cdf0e10cSrcweir 		slash after it or not.
745cdf0e10cSrcweir 
746cdf0e10cSrcweir 		@param nIndex  The non-negative index of the segment before which
747cdf0e10cSrcweir 		to insert the new segment.  LAST_SEGMENT or an nIndex that equals
748cdf0e10cSrcweir 		getSegmentCount() inserts the new segment at the end of the
749cdf0e10cSrcweir 		hierarchical path.
750cdf0e10cSrcweir 
751cdf0e10cSrcweir 		@param bIgnoreFinalSlash  If true, a final slash at the end of the
752cdf0e10cSrcweir 		hierarchical path does not denote an empty segment, but is ignored.
753cdf0e10cSrcweir 
754cdf0e10cSrcweir 		@param eMechanism  See the general discussion for set-methods.
755cdf0e10cSrcweir 
756cdf0e10cSrcweir 		@param eCharset  See the general discussion for set-methods.
757cdf0e10cSrcweir 
758cdf0e10cSrcweir 		@return  True if the segment has successfully been inserted (and the
759cdf0e10cSrcweir 		resulting URI is still valid).  If the path is not hierarchical, or
760cdf0e10cSrcweir 		the specified place to insert the new segment does not exist, false is
761cdf0e10cSrcweir 		returned.  If false is returned, the object is not modified.
762cdf0e10cSrcweir 	 */
763cdf0e10cSrcweir 	inline bool insertName(rtl::OUString const & rTheName,
764cdf0e10cSrcweir 						   bool bAppendFinalSlash = false,
765cdf0e10cSrcweir 						   sal_Int32 nIndex = LAST_SEGMENT,
766cdf0e10cSrcweir 						   bool bIgnoreFinalSlash = true,
767cdf0e10cSrcweir 						   EncodeMechanism eMechanism = WAS_ENCODED,
768cdf0e10cSrcweir 						   rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
769cdf0e10cSrcweir 
770cdf0e10cSrcweir 	/** Get the name of a segment of the hierarchical path.
771cdf0e10cSrcweir 
772cdf0e10cSrcweir 		@param nIndex  The non-negative index of the segment, or LAST_SEGMENT
773cdf0e10cSrcweir 		if addressing the last segment.
774cdf0e10cSrcweir 
775cdf0e10cSrcweir 		@param bIgnoreFinalSlash  If true, a final slash at the end of the
776cdf0e10cSrcweir 		hierarchical path does not denote an empty segment, but is ignored.
777cdf0e10cSrcweir 
778cdf0e10cSrcweir 		@param eMechanism  See the general discussion for get-methods.
779cdf0e10cSrcweir 
780cdf0e10cSrcweir 		@param eCharset  See the general discussion for get-methods.
781cdf0e10cSrcweir 
782cdf0e10cSrcweir 		@return  The name part of the specified segment.  If the path is not
783cdf0e10cSrcweir 		hierarchical, or the specified segment does not exits, an empty string
784cdf0e10cSrcweir 		is returned.
785cdf0e10cSrcweir 	 */
786cdf0e10cSrcweir 	rtl::OUString getName(sal_Int32 nIndex = LAST_SEGMENT,
787cdf0e10cSrcweir 					  bool bIgnoreFinalSlash = true,
788cdf0e10cSrcweir 					  DecodeMechanism eMechanism = DECODE_TO_IURI,
789cdf0e10cSrcweir 					  rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
790cdf0e10cSrcweir 		const;
791cdf0e10cSrcweir 
792cdf0e10cSrcweir 	/** Set the name of a segment (preserving any parameters and any query or
793cdf0e10cSrcweir 		fragment part).
794cdf0e10cSrcweir 
795cdf0e10cSrcweir 		@param rTheName  The new name.
796cdf0e10cSrcweir 
797cdf0e10cSrcweir 		@param nIndex  The non-negative index of the segment, or LAST_SEGMENT
798cdf0e10cSrcweir 		if addressing the last segment.
799cdf0e10cSrcweir 
800cdf0e10cSrcweir 		@param bIgnoreFinalSlash  If true, a final slash at the end of the
801cdf0e10cSrcweir 		hierarchical path does not denote an empty segment, but is ignored.
802cdf0e10cSrcweir 
803cdf0e10cSrcweir 		@param eMechanism  See the general discussion for set-methods.
804cdf0e10cSrcweir 
805cdf0e10cSrcweir 		@param eCharset  See the general discussion for set-methods.
806cdf0e10cSrcweir 
807cdf0e10cSrcweir 		@return  True if the name has successfully been modified (and the
808cdf0e10cSrcweir 		resulting URI is still valid).  If the path is not hierarchical, or
809cdf0e10cSrcweir 		the specified segment does not exist, false is returned.  If false is
810cdf0e10cSrcweir 		returned, the object is not modified.
811cdf0e10cSrcweir 	 */
812cdf0e10cSrcweir 	bool setName(rtl::OUString const & rTheName,
813cdf0e10cSrcweir 				 sal_Int32 nIndex = LAST_SEGMENT,
814cdf0e10cSrcweir 				 bool bIgnoreFinalSlash = true,
815cdf0e10cSrcweir 				 EncodeMechanism eMechanism = WAS_ENCODED,
816cdf0e10cSrcweir 				 rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
817cdf0e10cSrcweir 
818cdf0e10cSrcweir 	/** Get the base of the name of a segment.
819cdf0e10cSrcweir 
820cdf0e10cSrcweir 		@param nIndex  The non-negative index of the segment, or LAST_SEGMENT
821cdf0e10cSrcweir 		if addressing the last segment.
822cdf0e10cSrcweir 
823cdf0e10cSrcweir 		@param bIgnoreFinalSlash  If true, a final slash at the end of the
824cdf0e10cSrcweir 		hierarchical path does not denote an empty segment, but is ignored.
825cdf0e10cSrcweir 
826cdf0e10cSrcweir 		@param eMechanism  See the general discussion for get-methods.
827cdf0e10cSrcweir 
828cdf0e10cSrcweir 		@param eCharset  See the general discussion for get-methods.
829cdf0e10cSrcweir 
830cdf0e10cSrcweir 		@return  The base part of the specified segment.  If the path is
831cdf0e10cSrcweir 		not hierarchical, or the specified segment does not exits, an empty
832cdf0e10cSrcweir 		string is returned.
833cdf0e10cSrcweir 	 */
834cdf0e10cSrcweir 	rtl::OUString getBase(sal_Int32 nIndex = LAST_SEGMENT,
835cdf0e10cSrcweir 					  bool bIgnoreFinalSlash = true,
836cdf0e10cSrcweir 					  DecodeMechanism eMechanism = DECODE_TO_IURI,
837cdf0e10cSrcweir 					  rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
838cdf0e10cSrcweir 		const;
839cdf0e10cSrcweir 
840cdf0e10cSrcweir 	/** Set the base of the name of a segment (preserving the extension).
841cdf0e10cSrcweir 
842cdf0e10cSrcweir 		@param rTheBase  The new base.
843cdf0e10cSrcweir 
844cdf0e10cSrcweir 		@param nIndex  The non-negative index of the segment, or LAST_SEGMENT
845cdf0e10cSrcweir 		if addressing the last segment.
846cdf0e10cSrcweir 
847cdf0e10cSrcweir 		@param bIgnoreFinalSlash  If true, a final slash at the end of the
848cdf0e10cSrcweir 		hierarchical path does not denote an empty segment, but is ignored.
849cdf0e10cSrcweir 
850cdf0e10cSrcweir 		@param eMechanism  See the general discussion for set-methods.
851cdf0e10cSrcweir 
852cdf0e10cSrcweir 		@param eCharset  See the general discussion for set-methods.
853cdf0e10cSrcweir 
854cdf0e10cSrcweir 		@return  True if the base has successfully been modified (and the
855cdf0e10cSrcweir 		resulting URI is still valid).  If the path is not hierarchical, or
856cdf0e10cSrcweir 		the specified segment does not exist, false is returned.  If false is
857cdf0e10cSrcweir 		returned, the object is not modified.
858cdf0e10cSrcweir 	 */
859cdf0e10cSrcweir 	bool setBase(rtl::OUString const & rTheBase,
860cdf0e10cSrcweir 				 sal_Int32 nIndex = LAST_SEGMENT,
861cdf0e10cSrcweir 				 bool bIgnoreFinalSlash = true,
862cdf0e10cSrcweir 				 EncodeMechanism eMechanism = WAS_ENCODED,
863cdf0e10cSrcweir 				 rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
864cdf0e10cSrcweir 
865cdf0e10cSrcweir 	/** Determine whether the name of a segment has an extension.
866cdf0e10cSrcweir 
867cdf0e10cSrcweir 		@param nIndex  The non-negative index of the segment, or LAST_SEGMENT
868cdf0e10cSrcweir 		if addressing the last segment.
869cdf0e10cSrcweir 
870cdf0e10cSrcweir 		@param bIgnoreFinalSlash  If true, a final slash at the end of the
871cdf0e10cSrcweir 		hierarchical path does not denote an empty segment, but is ignored.
872cdf0e10cSrcweir 
873cdf0e10cSrcweir 		@return  True if the name of the specified segment has an extension.
874cdf0e10cSrcweir 		If the path is not hierarchical, or the specified segment does not
875cdf0e10cSrcweir 		exist, false is returned.
876cdf0e10cSrcweir 	 */
877cdf0e10cSrcweir 	bool hasExtension(sal_Int32 nIndex = LAST_SEGMENT,
878cdf0e10cSrcweir 					  bool bIgnoreFinalSlash = true) const;
879cdf0e10cSrcweir 
880cdf0e10cSrcweir 	/** Get the extension of the name of a segment.
881cdf0e10cSrcweir 
882cdf0e10cSrcweir 		@param nIndex  The non-negative index of the segment, or LAST_SEGMENT
883cdf0e10cSrcweir 		if addressing the last segment.
884cdf0e10cSrcweir 
885cdf0e10cSrcweir 		@param bIgnoreFinalSlash  If true, a final slash at the end of the
886cdf0e10cSrcweir 		hierarchical path does not denote an empty segment, but is ignored.
887cdf0e10cSrcweir 
888cdf0e10cSrcweir 		@param eMechanism  See the general discussion for get-methods.
889cdf0e10cSrcweir 
890cdf0e10cSrcweir 		@param eCharset  See the general discussion for get-methods.
891cdf0e10cSrcweir 
892cdf0e10cSrcweir 		@return  The extension part of the specified segment.  If the path is
893cdf0e10cSrcweir 		not hierarchical, or the specified segment does not exits, an empty
894cdf0e10cSrcweir 		string is returned.
895cdf0e10cSrcweir 	 */
896cdf0e10cSrcweir 	rtl::OUString getExtension(sal_Int32 nIndex = LAST_SEGMENT,
897cdf0e10cSrcweir 						   bool bIgnoreFinalSlash = true,
898cdf0e10cSrcweir 						   DecodeMechanism eMechanism = DECODE_TO_IURI,
899cdf0e10cSrcweir 						   rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
900cdf0e10cSrcweir 		const;
901cdf0e10cSrcweir 
902cdf0e10cSrcweir 	/** Set the extension of the name of a segment (replacing an already
903cdf0e10cSrcweir 		existing extension).
904cdf0e10cSrcweir 
905cdf0e10cSrcweir 		@param rTheExtension  The new extension.
906cdf0e10cSrcweir 
907cdf0e10cSrcweir 		@param nIndex  The non-negative index of the segment, or LAST_SEGMENT
908cdf0e10cSrcweir 		if addressing the last segment.
909cdf0e10cSrcweir 
910cdf0e10cSrcweir 		@param bIgnoreFinalSlash  If true, a final slash at the end of the
911cdf0e10cSrcweir 		hierarchical path does not denote an empty segment, but is ignored.
912cdf0e10cSrcweir 
913cdf0e10cSrcweir 		@param eMechanism  See the general discussion for set-methods.
914cdf0e10cSrcweir 
915cdf0e10cSrcweir 		@param eCharset  See the general discussion for set-methods.
916cdf0e10cSrcweir 
917cdf0e10cSrcweir 		@return  True if the extension has successfully been modified (and the
918cdf0e10cSrcweir 		resulting URI is still valid).  If the path is not hierarchical, or
919cdf0e10cSrcweir 		the specified segment does not exist, false is returned.  If false is
920cdf0e10cSrcweir 		returned, the object is not modified.
921cdf0e10cSrcweir 	 */
922cdf0e10cSrcweir 	bool setExtension(rtl::OUString const & rTheExtension,
923cdf0e10cSrcweir 					  sal_Int32 nIndex = LAST_SEGMENT,
924cdf0e10cSrcweir 					  bool bIgnoreFinalSlash = true,
925cdf0e10cSrcweir 					  EncodeMechanism eMechanism = WAS_ENCODED,
926cdf0e10cSrcweir 					  rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
927cdf0e10cSrcweir 
928cdf0e10cSrcweir 	/** Remove the extension of the name of a segment.
929cdf0e10cSrcweir 
930cdf0e10cSrcweir 		@param nIndex  The non-negative index of the segment, or LAST_SEGMENT
931cdf0e10cSrcweir 		if addressing the last segment.
932cdf0e10cSrcweir 
933cdf0e10cSrcweir 		@param bIgnoreFinalSlash  If true, a final slash at the end of the
934cdf0e10cSrcweir 		hierarchical path does not denote an empty segment, but is ignored.
935cdf0e10cSrcweir 
936cdf0e10cSrcweir 		@return  True if the extension has successfully been removed (and the
937cdf0e10cSrcweir 		resulting URI is still valid), or if the name did not have an
938cdf0e10cSrcweir 		extension.  If the path is not hierarchical, or the specified segment
939cdf0e10cSrcweir 		does not exist, false is returned.  If false is returned, the object
940cdf0e10cSrcweir 		is not modified.
941cdf0e10cSrcweir 	 */
942cdf0e10cSrcweir 	bool removeExtension(sal_Int32 nIndex = LAST_SEGMENT,
943cdf0e10cSrcweir 						 bool bIgnoreFinalSlash = true);
944cdf0e10cSrcweir 
945cdf0e10cSrcweir 	/** Determine whether the hierarchical path ends in a final slash.
946cdf0e10cSrcweir 
947cdf0e10cSrcweir 		@return  True if the hierarchical path ends in a final slash.  If the
948cdf0e10cSrcweir 		path is not hierarchical, false is returned.
949cdf0e10cSrcweir 	 */
950cdf0e10cSrcweir 	bool hasFinalSlash() const;
951cdf0e10cSrcweir 
952cdf0e10cSrcweir 	/** Make the hierarchical path end in a final slash (if it does not
953cdf0e10cSrcweir 		already do so).
954cdf0e10cSrcweir 
955cdf0e10cSrcweir 		@return  True if a final slash has successfully been appended (and the
956cdf0e10cSrcweir 		resulting URI is still valid), or if the hierarchical path already
957cdf0e10cSrcweir 		ended in a final slash.  If the path is not hierarchical, false is
958cdf0e10cSrcweir 		returned.  If false is returned, the object is not modified.
959cdf0e10cSrcweir 	 */
960cdf0e10cSrcweir 	bool setFinalSlash();
961cdf0e10cSrcweir 
962cdf0e10cSrcweir 	/** Remove a final slash from the hierarchical path.
963cdf0e10cSrcweir 
964cdf0e10cSrcweir 		@return  True if a final slash has successfully been removed (and the
965cdf0e10cSrcweir 		resulting URI is still valid), or if the hierarchical path already did
966cdf0e10cSrcweir 		not end in a final slash.  If the path is not hierarchical, false is
967cdf0e10cSrcweir 		returned.  If false is returned, the object is not modified.
968cdf0e10cSrcweir 	 */
969cdf0e10cSrcweir 	bool removeFinalSlash();
970cdf0e10cSrcweir 
971cdf0e10cSrcweir 	//========================================================================
972cdf0e10cSrcweir 	// Query:
973cdf0e10cSrcweir 
HasParam() const974cdf0e10cSrcweir 	inline bool HasParam() const { return m_aQuery.isPresent(); }
975cdf0e10cSrcweir 
GetParam(DecodeMechanism eMechanism=DECODE_TO_IURI,rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const976cdf0e10cSrcweir 	inline rtl::OUString GetParam(DecodeMechanism eMechanism = DECODE_TO_IURI,
977cdf0e10cSrcweir 							  rtl_TextEncoding eCharset
978cdf0e10cSrcweir 							      = RTL_TEXTENCODING_UTF8) const
979cdf0e10cSrcweir 	{ return decode(m_aQuery, getEscapePrefix(), eMechanism, eCharset); }
980cdf0e10cSrcweir 
981cdf0e10cSrcweir 	inline bool SetParam(ByteString const & rTheQuery,
982cdf0e10cSrcweir 						 EncodeMechanism eMechanism = WAS_ENCODED,
983cdf0e10cSrcweir 						 rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
984cdf0e10cSrcweir 
985cdf0e10cSrcweir 	inline bool SetParam(rtl::OUString const & rTheQuery,
986cdf0e10cSrcweir 						 EncodeMechanism eMechanism = WAS_ENCODED,
987cdf0e10cSrcweir 						 rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
988cdf0e10cSrcweir 
989cdf0e10cSrcweir 	//========================================================================
990cdf0e10cSrcweir 	// Fragment:
991cdf0e10cSrcweir 
HasMark() const992cdf0e10cSrcweir 	inline bool HasMark() const { return m_aFragment.isPresent(); }
993cdf0e10cSrcweir 
GetMark(DecodeMechanism eMechanism=DECODE_TO_IURI,rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const994cdf0e10cSrcweir 	inline rtl::OUString GetMark(DecodeMechanism eMechanism = DECODE_TO_IURI,
995cdf0e10cSrcweir 							 rtl_TextEncoding eCharset
996cdf0e10cSrcweir 							     = RTL_TEXTENCODING_UTF8) const
997cdf0e10cSrcweir 	{ return decode(m_aFragment, getEscapePrefix(), eMechanism, eCharset); }
998cdf0e10cSrcweir 
999cdf0e10cSrcweir 	inline bool SetMark(ByteString const & rTheFragment,
1000cdf0e10cSrcweir 						EncodeMechanism eMechanism = WAS_ENCODED,
1001cdf0e10cSrcweir 						rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
1002cdf0e10cSrcweir 
1003cdf0e10cSrcweir 	inline bool SetMark(rtl::OUString const & rTheFragment,
1004cdf0e10cSrcweir 						EncodeMechanism eMechanism = WAS_ENCODED,
1005cdf0e10cSrcweir 						rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
1006cdf0e10cSrcweir 
1007cdf0e10cSrcweir 	static rtl::OUString createFragment(rtl::OUString const & rText);
1008cdf0e10cSrcweir 
1009cdf0e10cSrcweir 	//========================================================================
1010cdf0e10cSrcweir 	// File URLs:
1011cdf0e10cSrcweir 
1012cdf0e10cSrcweir 	/** Create an INetURLObject from a file system path.
1013cdf0e10cSrcweir 
1014cdf0e10cSrcweir 		@param rFSysPath  A file system path.  An URL is not allowed here!
1015cdf0e10cSrcweir 
1016cdf0e10cSrcweir 		@param eStyle  The notation of rFSysPath.
1017cdf0e10cSrcweir 	 */
1018cdf0e10cSrcweir 	inline INetURLObject(rtl::OUString const & rFSysPath, FSysStyle eStyle);
1019cdf0e10cSrcweir 
1020cdf0e10cSrcweir 	/** Set this INetURLObject to a file URL constructed from a file system
1021cdf0e10cSrcweir 		path.
1022cdf0e10cSrcweir 
1023cdf0e10cSrcweir 		@param rFSysPath  A file system path.  An URL is not allowed here!
1024cdf0e10cSrcweir 
1025cdf0e10cSrcweir 		@param eStyle  The notation of rFSysPath.
1026cdf0e10cSrcweir 
1027cdf0e10cSrcweir 		@return  True if this INetURLObject has successfully been changed.  If
1028cdf0e10cSrcweir 		false is returned, this INetURLObject has not been modified.
1029cdf0e10cSrcweir 	 */
1030cdf0e10cSrcweir 	bool setFSysPath(rtl::OUString const & rFSysPath, FSysStyle eStyle);
1031cdf0e10cSrcweir 
1032cdf0e10cSrcweir 	/** Return the file system path represented by a file URL (ignoring any
1033cdf0e10cSrcweir 		fragment part).
1034cdf0e10cSrcweir 
1035cdf0e10cSrcweir 		@param eStyle  The notation of the returned file system path.
1036cdf0e10cSrcweir 
1037cdf0e10cSrcweir 		@param pDelimiter  Upon successful return, this parameter can return
1038cdf0e10cSrcweir 		the character that is the 'main' delimiter within the returned file
1039cdf0e10cSrcweir 		system path (e.g., "/" for Unix, "\" for DOS, ":" for Mac).  This is
1040cdf0e10cSrcweir 		especially useful for routines that later try to shorten the returned
1041cdf0e10cSrcweir 		file system path at a 'good' position, e.g. to fit it into some
1042cdf0e10cSrcweir 		limited display space.
1043cdf0e10cSrcweir 
1044cdf0e10cSrcweir 		@return  The file system path represented by this file URL.  If this
1045cdf0e10cSrcweir 		file URL does not represent a file system path according to the
1046cdf0e10cSrcweir 		specified notation, or if this is not a file URL at all, an empty
1047cdf0e10cSrcweir 		string is returned.
1048cdf0e10cSrcweir 	 */
1049cdf0e10cSrcweir 	rtl::OUString getFSysPath(FSysStyle eStyle, sal_Unicode * pDelimiter = 0)
1050cdf0e10cSrcweir 		const;
1051cdf0e10cSrcweir 
1052cdf0e10cSrcweir 	//========================================================================
1053cdf0e10cSrcweir 	// POP3 and URLs:
1054cdf0e10cSrcweir 
1055cdf0e10cSrcweir 	bool HasMsgId() const;
1056cdf0e10cSrcweir 
1057cdf0e10cSrcweir 	rtl::OUString GetMsgId(DecodeMechanism eMechanism = DECODE_TO_IURI,
1058cdf0e10cSrcweir 					   rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
1059cdf0e10cSrcweir 		const;
1060cdf0e10cSrcweir 
1061cdf0e10cSrcweir 	//========================================================================
1062cdf0e10cSrcweir 	// Coding:
1063cdf0e10cSrcweir 
1064cdf0e10cSrcweir 	enum Part
1065cdf0e10cSrcweir 	{
1066cdf0e10cSrcweir 		PART_OBSOLETE_NORMAL = 0x001, // Obsolete, do not use!
1067cdf0e10cSrcweir 		PART_OBSOLETE_FILE = 0x002, // Obsolete, do not use!
1068cdf0e10cSrcweir 		PART_OBSOLETE_PARAM = 0x004, // Obsolete, do not use!
1069cdf0e10cSrcweir 		PART_USER_PASSWORD = 0x008,
1070cdf0e10cSrcweir 		PART_IMAP_ACHAR = 0x010,
1071cdf0e10cSrcweir 		PART_VIM = 0x020,
1072cdf0e10cSrcweir 		PART_HOST_EXTRA = 0x040,
1073cdf0e10cSrcweir 		PART_FPATH = 0x080,
1074cdf0e10cSrcweir 		PART_AUTHORITY = 0x100,
1075cdf0e10cSrcweir 		PART_PATH_SEGMENTS_EXTRA = 0x200,
1076cdf0e10cSrcweir 		PART_REL_SEGMENT_EXTRA = 0x400,
1077cdf0e10cSrcweir 		PART_URIC = 0x800,
1078cdf0e10cSrcweir 		PART_HTTP_PATH = 0x1000,
1079cdf0e10cSrcweir 		PART_FILE_SEGMENT_EXTRA = 0x2000, // Obsolete, do not use!
1080cdf0e10cSrcweir 		PART_MESSAGE_ID = 0x4000,
1081cdf0e10cSrcweir 		PART_MESSAGE_ID_PATH = 0x8000,
1082cdf0e10cSrcweir 		PART_MAILTO = 0x10000,
1083cdf0e10cSrcweir 		PART_PATH_BEFORE_QUERY = 0x20000,
1084cdf0e10cSrcweir 		PART_PCHAR = 0x40000,
1085cdf0e10cSrcweir 		PART_FRAGMENT = 0x80000, // Obsolete, do not use!
1086cdf0e10cSrcweir 		PART_VISIBLE = 0x100000,
1087cdf0e10cSrcweir 		PART_VISIBLE_NONSPECIAL = 0x200000,
1088cdf0e10cSrcweir 		PART_CREATEFRAGMENT = 0x400000,
1089cdf0e10cSrcweir 		PART_UNO_PARAM_VALUE = 0x800000,
1090cdf0e10cSrcweir 		PART_UNAMBIGUOUS = 0x1000000,
1091cdf0e10cSrcweir 		PART_URIC_NO_SLASH = 0x2000000,
1092cdf0e10cSrcweir         PART_HTTP_QUERY = 0x4000000, //TODO! unused?
1093cdf0e10cSrcweir         PART_NEWS_ARTICLE_LOCALPART = 0x8000000,
1094cdf0e10cSrcweir 		max_part = 0x80000000
1095cdf0e10cSrcweir 			// Do not use!  Only there to allow compatible changes in the
1096cdf0e10cSrcweir 			// future.
1097cdf0e10cSrcweir 	};
1098cdf0e10cSrcweir 
1099cdf0e10cSrcweir 	enum EscapeType
1100cdf0e10cSrcweir 	{
1101cdf0e10cSrcweir 		ESCAPE_NO,
1102cdf0e10cSrcweir 		ESCAPE_OCTET,
1103cdf0e10cSrcweir 		ESCAPE_UTF32
1104cdf0e10cSrcweir 	};
1105cdf0e10cSrcweir 
1106cdf0e10cSrcweir 	/** Encode some text as part of a URI.
1107cdf0e10cSrcweir 
1108cdf0e10cSrcweir 		@param rText  Some text (for its interpretation, see the general
1109cdf0e10cSrcweir 		discussion for set-methods).
1110cdf0e10cSrcweir 
1111cdf0e10cSrcweir 		@param ePart  The part says which characters are 'forbidden' and must
1112cdf0e10cSrcweir 		be encoded (replaced by escape sequences).  Characters outside the US-
1113cdf0e10cSrcweir 		ASCII range are always 'forbidden.'
1114cdf0e10cSrcweir 
1115cdf0e10cSrcweir 		@param cEscapePrefix  The first character in an escape sequence
1116cdf0e10cSrcweir 		(normally '%').
1117cdf0e10cSrcweir 
1118cdf0e10cSrcweir 		@param eMechanism  See the general discussion for set-methods.
1119cdf0e10cSrcweir 
1120cdf0e10cSrcweir 		@param eCharset  See the general discussion for set-methods.
1121cdf0e10cSrcweir 
1122cdf0e10cSrcweir 		@return  The encoded representation of the text ('forbidden'
1123cdf0e10cSrcweir 		characters replaced by escape sequences).
1124cdf0e10cSrcweir 	 */
1125cdf0e10cSrcweir 	static inline rtl::OUString encode(ByteString const & rText, Part ePart,
1126cdf0e10cSrcweir 								   sal_Char cEscapePrefix,
1127cdf0e10cSrcweir 								   EncodeMechanism eMechanism,
1128cdf0e10cSrcweir 								   rtl_TextEncoding eCharset
1129cdf0e10cSrcweir 								       = RTL_TEXTENCODING_UTF8);
1130cdf0e10cSrcweir 
1131cdf0e10cSrcweir 	/** Encode some text as part of a URI.
1132cdf0e10cSrcweir 
1133cdf0e10cSrcweir 		@param rText  Some text (for its interpretation, see the general
1134cdf0e10cSrcweir 		discussion for set-methods).
1135cdf0e10cSrcweir 
1136cdf0e10cSrcweir 		@param ePart  The part says which characters are 'forbidden' and must
1137cdf0e10cSrcweir 		be encoded (replaced by escape sequences).  Characters outside the US-
1138cdf0e10cSrcweir 		ASCII range are always 'forbidden.'
1139cdf0e10cSrcweir 
1140cdf0e10cSrcweir 		@param cEscapePrefix  The first character in an escape sequence
1141cdf0e10cSrcweir 		(normally '%').
1142cdf0e10cSrcweir 
1143cdf0e10cSrcweir 		@param eMechanism  See the general discussion for set-methods.
1144cdf0e10cSrcweir 
1145cdf0e10cSrcweir 		@param eCharset  See the general discussion for set-methods.
1146cdf0e10cSrcweir 
1147cdf0e10cSrcweir 		@return  The text, encoded according to the given mechanism and
1148cdf0e10cSrcweir 		charset ('forbidden' characters replaced by escape sequences).
1149cdf0e10cSrcweir 	 */
1150cdf0e10cSrcweir 	static inline rtl::OUString encode(rtl::OUString const & rText, Part ePart,
1151cdf0e10cSrcweir 								   sal_Char cEscapePrefix,
1152cdf0e10cSrcweir 								   EncodeMechanism eMechanism,
1153cdf0e10cSrcweir 								   rtl_TextEncoding eCharset
1154cdf0e10cSrcweir 								       = RTL_TEXTENCODING_UTF8);
1155cdf0e10cSrcweir 
1156cdf0e10cSrcweir 	/** Decode some text.
1157cdf0e10cSrcweir 
1158cdf0e10cSrcweir 		@param rText  Some (encoded) text.
1159cdf0e10cSrcweir 
1160cdf0e10cSrcweir 		@param cEscapePrefix  The first character in an escape sequence
1161cdf0e10cSrcweir 		(normally '%').
1162cdf0e10cSrcweir 
1163cdf0e10cSrcweir 		@param eMechanism  See the general discussion for get-methods.
1164cdf0e10cSrcweir 
1165cdf0e10cSrcweir 		@param eCharset  See the general discussion for get-methods.
1166cdf0e10cSrcweir 
1167cdf0e10cSrcweir 		@return  The text, decoded according to the given mechanism and
1168cdf0e10cSrcweir 		charset (escape sequences replaced by 'raw' characters).
1169cdf0e10cSrcweir 	 */
1170cdf0e10cSrcweir 	static inline rtl::OUString decode(rtl::OUString const & rText,
1171cdf0e10cSrcweir 								   sal_Char cEscapePrefix,
1172cdf0e10cSrcweir 								   DecodeMechanism eMechanism,
1173cdf0e10cSrcweir 								   rtl_TextEncoding eCharset
1174cdf0e10cSrcweir 								       = RTL_TEXTENCODING_UTF8);
1175cdf0e10cSrcweir 
1176cdf0e10cSrcweir 	static inline rtl::OUString decode(rtl::OUStringBuffer const & rText,
1177cdf0e10cSrcweir 								   sal_Char cEscapePrefix,
1178cdf0e10cSrcweir 								   DecodeMechanism eMechanism,
1179cdf0e10cSrcweir 								   rtl_TextEncoding eCharset
1180cdf0e10cSrcweir 								       = RTL_TEXTENCODING_UTF8);
1181cdf0e10cSrcweir 
1182cdf0e10cSrcweir 	static void appendUCS4Escape(rtl::OUStringBuffer & rTheText,
1183cdf0e10cSrcweir 								 sal_Char cEscapePrefix,
1184cdf0e10cSrcweir 								 sal_uInt32 nUCS4);
1185cdf0e10cSrcweir 
1186cdf0e10cSrcweir 	static void appendUCS4(rtl::OUStringBuffer & rTheText, sal_uInt32 nUCS4,
1187cdf0e10cSrcweir 						   EscapeType eEscapeType, bool bOctets, Part ePart,
1188cdf0e10cSrcweir 						   sal_Char cEscapePrefix, rtl_TextEncoding eCharset,
1189cdf0e10cSrcweir 						   bool bKeepVisibleEscapes);
1190cdf0e10cSrcweir 
1191cdf0e10cSrcweir 	static sal_uInt32 getUTF32(sal_Unicode const *& rBegin,
1192cdf0e10cSrcweir 							   sal_Unicode const * pEnd, bool bOctets,
1193cdf0e10cSrcweir 							   sal_Char cEscapePrefix,
1194cdf0e10cSrcweir 							   EncodeMechanism eMechanism,
1195cdf0e10cSrcweir 							   rtl_TextEncoding eCharset,
1196cdf0e10cSrcweir 							   EscapeType & rEscapeType);
1197cdf0e10cSrcweir 
1198cdf0e10cSrcweir 	//========================================================================
1199cdf0e10cSrcweir 	// Specialized helpers:
1200cdf0e10cSrcweir 
1201cdf0e10cSrcweir 	static sal_uInt32 scanDomain(sal_Unicode const *& rBegin,
1202cdf0e10cSrcweir 								 sal_Unicode const * pEnd,
1203cdf0e10cSrcweir 								 bool bEager = true);
1204cdf0e10cSrcweir 
1205cdf0e10cSrcweir 	//========================================================================
1206cdf0e10cSrcweir 	// OBSOLETE Hierarchical Path:
1207cdf0e10cSrcweir 
1208cdf0e10cSrcweir 	rtl::OUString GetPartBeforeLastName(DecodeMechanism eMechanism
1209cdf0e10cSrcweir 									    = DECODE_TO_IURI,
1210cdf0e10cSrcweir 									rtl_TextEncoding eCharset
1211cdf0e10cSrcweir 									    = RTL_TEXTENCODING_UTF8) const;
1212cdf0e10cSrcweir 
1213cdf0e10cSrcweir 	/** Get the last segment in the path.
1214cdf0e10cSrcweir 
1215cdf0e10cSrcweir 		@param eMechanism  See the general discussion for get-methods.
1216cdf0e10cSrcweir 
1217cdf0e10cSrcweir 		@param eCharset  See the general discussion for get-methods.
1218cdf0e10cSrcweir 
1219cdf0e10cSrcweir 		@return  For a hierarchical URL, the last segment (everything after
1220cdf0e10cSrcweir 		the last unencoded '/').  Not that this last segment may be empty.  If
1221cdf0e10cSrcweir 		the URL is not hierarchical, an empty string is returned.
1222cdf0e10cSrcweir 	 */
1223cdf0e10cSrcweir 	rtl::OUString GetLastName(DecodeMechanism eMechanism = DECODE_TO_IURI,
1224cdf0e10cSrcweir 						  rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
1225cdf0e10cSrcweir 		const;
1226cdf0e10cSrcweir 
1227cdf0e10cSrcweir 	/** Get the 'extension' of the last segment in the path.
1228cdf0e10cSrcweir 
1229cdf0e10cSrcweir 		@param eMechanism  See the general discussion for get-methods.
1230cdf0e10cSrcweir 
1231cdf0e10cSrcweir 		@param eCharset  See the general discussion for get-methods.
1232cdf0e10cSrcweir 
1233cdf0e10cSrcweir 		@return  For a hierarchical URL, everything after the first unencoded
1234cdf0e10cSrcweir 		'.' in the last segment of the path.  Note that this 'extension' may
1235cdf0e10cSrcweir 		be empty.  If the URL is not hierarchical, or if the last segment does
1236cdf0e10cSrcweir 		not contain an unencoded '.', an empty string is returned.
1237cdf0e10cSrcweir 	 */
1238cdf0e10cSrcweir 	rtl::OUString GetFileExtension(DecodeMechanism eMechanism = DECODE_TO_IURI,
1239cdf0e10cSrcweir 							   rtl_TextEncoding eCharset
1240cdf0e10cSrcweir 							       = RTL_TEXTENCODING_UTF8) const;
1241cdf0e10cSrcweir 
Append(ByteString const & rTheSegment,EncodeMechanism eMechanism=WAS_ENCODED,rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)1242cdf0e10cSrcweir 	inline bool Append(ByteString const & rTheSegment,
1243cdf0e10cSrcweir 					   EncodeMechanism eMechanism = WAS_ENCODED,
1244cdf0e10cSrcweir 					   rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
1245cdf0e10cSrcweir 	{ return appendSegment(extend(rTheSegment), true, eMechanism, eCharset); }
1246cdf0e10cSrcweir 
Append(rtl::OUString const & rTheSegment,EncodeMechanism eMechanism=WAS_ENCODED,rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)1247cdf0e10cSrcweir 	inline bool Append(rtl::OUString const & rTheSegment,
1248cdf0e10cSrcweir 					   EncodeMechanism eMechanism = WAS_ENCODED,
1249cdf0e10cSrcweir 					   rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
1250cdf0e10cSrcweir 	{ return appendSegment(rTheSegment, false, eMechanism, eCharset); }
1251cdf0e10cSrcweir 
1252cdf0e10cSrcweir 	bool CutLastName();
1253cdf0e10cSrcweir 
1254cdf0e10cSrcweir 	//========================================================================
1255cdf0e10cSrcweir 	// OBSOLETE File URLs:
1256cdf0e10cSrcweir 
1257cdf0e10cSrcweir 	rtl::OUString PathToFileName() const;
1258cdf0e10cSrcweir 
1259cdf0e10cSrcweir 	rtl::OUString GetFull() const;
1260cdf0e10cSrcweir 
1261cdf0e10cSrcweir 	rtl::OUString GetPath() const;
1262cdf0e10cSrcweir 
1263cdf0e10cSrcweir 	void SetBase(rtl::OUString const & rTheBase);
1264cdf0e10cSrcweir 
1265cdf0e10cSrcweir 	rtl::OUString GetBase() const;
1266cdf0e10cSrcweir 
1267cdf0e10cSrcweir 	void SetName(rtl::OUString const & rTheName,
1268cdf0e10cSrcweir 				 EncodeMechanism eMechanism = WAS_ENCODED,
1269cdf0e10cSrcweir 				 rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
1270cdf0e10cSrcweir 
GetName(DecodeMechanism eMechanism=DECODE_TO_IURI,rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const1271cdf0e10cSrcweir 	inline rtl::OUString GetName(DecodeMechanism eMechanism = DECODE_TO_IURI,
1272cdf0e10cSrcweir 							 rtl_TextEncoding eCharset
1273cdf0e10cSrcweir 							     = RTL_TEXTENCODING_UTF8) const
1274cdf0e10cSrcweir 	{ return GetLastName(eMechanism, eCharset); }
1275cdf0e10cSrcweir 
1276cdf0e10cSrcweir 	rtl::OUString CutName(DecodeMechanism eMechanism = DECODE_TO_IURI,
1277cdf0e10cSrcweir 					  rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
1278cdf0e10cSrcweir 
1279cdf0e10cSrcweir 	void SetExtension(rtl::OUString const & rTheExtension,
1280cdf0e10cSrcweir 					  EncodeMechanism eMechanism = WAS_ENCODED,
1281cdf0e10cSrcweir 					  rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
1282cdf0e10cSrcweir 
GetExtension(DecodeMechanism eMechanism=DECODE_TO_IURI,rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const1283cdf0e10cSrcweir 	inline rtl::OUString GetExtension(
1284cdf0e10cSrcweir 								  DecodeMechanism eMechanism = DECODE_TO_IURI,
1285cdf0e10cSrcweir 								  rtl_TextEncoding eCharset
1286cdf0e10cSrcweir 								      = RTL_TEXTENCODING_UTF8) const
1287cdf0e10cSrcweir 	{ return GetFileExtension(eMechanism, eCharset); }
1288cdf0e10cSrcweir 
1289cdf0e10cSrcweir 	rtl::OUString CutExtension(DecodeMechanism eMechanism = DECODE_TO_IURI,
1290cdf0e10cSrcweir 						   rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
1291cdf0e10cSrcweir 
1292cdf0e10cSrcweir 	bool IsCaseSensitive() const;
1293cdf0e10cSrcweir 
1294cdf0e10cSrcweir 	//========================================================================
1295cdf0e10cSrcweir 
1296cdf0e10cSrcweir private:
1297cdf0e10cSrcweir 	// General Structure:
1298cdf0e10cSrcweir 
1299cdf0e10cSrcweir 	class SubString
1300cdf0e10cSrcweir 	{
1301cdf0e10cSrcweir 		sal_Int32 m_nBegin;
1302cdf0e10cSrcweir 		sal_Int32 m_nLength;
1303cdf0e10cSrcweir 
1304cdf0e10cSrcweir 	public:
SubString(sal_Int32 nTheBegin=-1,sal_Int32 nTheLength=0)1305cdf0e10cSrcweir 		explicit inline SubString(sal_Int32 nTheBegin = -1,
1306cdf0e10cSrcweir 								  sal_Int32 nTheLength = 0):
1307cdf0e10cSrcweir 			m_nBegin(nTheBegin), m_nLength(nTheLength) {}
1308cdf0e10cSrcweir 
isPresent() const1309cdf0e10cSrcweir 		inline bool isPresent() const { return m_nBegin != -1; }
1310cdf0e10cSrcweir 
isEmpty() const1311cdf0e10cSrcweir 		inline bool isEmpty() const { return m_nLength == 0; }
1312cdf0e10cSrcweir 
getBegin() const1313cdf0e10cSrcweir 		inline sal_Int32 getBegin() const { return m_nBegin; }
1314cdf0e10cSrcweir 
getLength() const1315cdf0e10cSrcweir 		inline sal_Int32 getLength() const { return m_nLength; }
1316cdf0e10cSrcweir 
getEnd() const1317cdf0e10cSrcweir 		inline sal_Int32 getEnd() const { return m_nBegin + m_nLength; }
1318cdf0e10cSrcweir 
1319cdf0e10cSrcweir 		inline sal_Int32 clear();
1320cdf0e10cSrcweir 
1321cdf0e10cSrcweir 		inline sal_Int32 set(rtl::OUStringBuffer & rString,
1322cdf0e10cSrcweir 						     rtl::OUString const & rSubString,
1323cdf0e10cSrcweir 						     sal_Int32 nTheBegin);
1324cdf0e10cSrcweir 
1325cdf0e10cSrcweir 		inline sal_Int32 set(rtl::OUString & rString,
1326cdf0e10cSrcweir 						     rtl::OUString const & rSubString);
1327cdf0e10cSrcweir 
1328cdf0e10cSrcweir 		inline sal_Int32 set(rtl::OUStringBuffer & rString,
1329cdf0e10cSrcweir 						     rtl::OUString const & rSubString);
1330cdf0e10cSrcweir 
1331cdf0e10cSrcweir 		inline void operator +=(sal_Int32 nDelta);
1332cdf0e10cSrcweir 
1333cdf0e10cSrcweir 		int compare(SubString const & rOther,
1334cdf0e10cSrcweir 			rtl::OUStringBuffer const & rThisString,
1335cdf0e10cSrcweir 			rtl::OUStringBuffer const & rOtherString) const;
1336cdf0e10cSrcweir 	};
1337cdf0e10cSrcweir 
1338cdf0e10cSrcweir 	rtl::OUStringBuffer m_aAbsURIRef;
1339cdf0e10cSrcweir 	SubString m_aScheme;
1340cdf0e10cSrcweir 	SubString m_aUser;
1341cdf0e10cSrcweir 	SubString m_aAuth;
1342cdf0e10cSrcweir 	SubString m_aHost;
1343cdf0e10cSrcweir 	SubString m_aPort;
1344cdf0e10cSrcweir 	SubString m_aPath;
1345cdf0e10cSrcweir 	SubString m_aQuery;
1346cdf0e10cSrcweir 	SubString m_aFragment;
1347cdf0e10cSrcweir 	INetProtocol m_eScheme;
1348cdf0e10cSrcweir 	INetProtocol m_eSmartScheme;
1349cdf0e10cSrcweir 
1350cdf0e10cSrcweir     TOOLS_DLLPRIVATE void setInvalid();
1351cdf0e10cSrcweir 
1352cdf0e10cSrcweir     bool setAbsURIRef(
1353cdf0e10cSrcweir         rtl::OUString const & rTheAbsURIRef, bool bOctets,
1354cdf0e10cSrcweir         EncodeMechanism eMechanism, rtl_TextEncoding eCharset, bool bSmart,
1355cdf0e10cSrcweir         FSysStyle eStyle);
1356cdf0e10cSrcweir 
1357cdf0e10cSrcweir     // Relative URLs:
1358cdf0e10cSrcweir 
1359cdf0e10cSrcweir     bool convertRelToAbs(
1360cdf0e10cSrcweir         rtl::OUString const & rTheRelURIRef, bool bOctets,
1361cdf0e10cSrcweir         INetURLObject & rTheAbsURIRef, bool & rWasAbsolute,
1362cdf0e10cSrcweir         EncodeMechanism eMechanism, rtl_TextEncoding eCharset,
1363cdf0e10cSrcweir         bool bIgnoreFragment, bool bSmart, bool bRelativeNonURIs,
1364cdf0e10cSrcweir         FSysStyle eStyle) const;
1365cdf0e10cSrcweir 
1366cdf0e10cSrcweir     bool convertAbsToRel(
1367cdf0e10cSrcweir         rtl::OUString const & rTheAbsURIRef, bool bOctets,
1368cdf0e10cSrcweir         rtl::OUString & rTheRelURIRef, EncodeMechanism eEncodeMechanism,
1369cdf0e10cSrcweir         DecodeMechanism eDecodeMechanism, rtl_TextEncoding eCharset,
1370cdf0e10cSrcweir         FSysStyle eStyle) const;
1371cdf0e10cSrcweir 
1372cdf0e10cSrcweir     // External URLs:
1373cdf0e10cSrcweir 
1374cdf0e10cSrcweir     static bool convertIntToExt(
1375cdf0e10cSrcweir         rtl::OUString const & rTheIntURIRef, bool bOctets,
1376cdf0e10cSrcweir         rtl::OUString & rTheExtURIRef, DecodeMechanism eDecodeMechanism,
1377cdf0e10cSrcweir         rtl_TextEncoding eCharset);
1378cdf0e10cSrcweir 
1379cdf0e10cSrcweir     static bool convertExtToInt(
1380cdf0e10cSrcweir         rtl::OUString const & rTheExtURIRef, bool bOctets,
1381cdf0e10cSrcweir         rtl::OUString & rTheIntURIRef, DecodeMechanism eDecodeMechanism,
1382cdf0e10cSrcweir         rtl_TextEncoding eCharset);
1383cdf0e10cSrcweir 
1384cdf0e10cSrcweir     // Scheme:
1385cdf0e10cSrcweir 
1386cdf0e10cSrcweir     struct PrefixInfo;
1387cdf0e10cSrcweir 
1388cdf0e10cSrcweir     TOOLS_DLLPRIVATE static inline SchemeInfo const & getSchemeInfo(
1389cdf0e10cSrcweir         INetProtocol eTheScheme);
1390cdf0e10cSrcweir 
1391cdf0e10cSrcweir     TOOLS_DLLPRIVATE inline SchemeInfo const & getSchemeInfo() const;
1392cdf0e10cSrcweir 
1393cdf0e10cSrcweir     TOOLS_DLLPRIVATE static PrefixInfo const * getPrefix(
1394cdf0e10cSrcweir         sal_Unicode const *& rBegin, sal_Unicode const * pEnd);
1395cdf0e10cSrcweir 
1396cdf0e10cSrcweir     // Authority:
1397cdf0e10cSrcweir 
1398cdf0e10cSrcweir     TOOLS_DLLPRIVATE sal_Int32 getAuthorityBegin() const;
1399cdf0e10cSrcweir 
1400cdf0e10cSrcweir     TOOLS_DLLPRIVATE SubString getAuthority() const;
1401cdf0e10cSrcweir 
1402cdf0e10cSrcweir     // User Info:
1403cdf0e10cSrcweir 
1404cdf0e10cSrcweir     bool setUser(
1405cdf0e10cSrcweir         rtl::OUString const & rTheUser, bool bOctets,
1406cdf0e10cSrcweir         EncodeMechanism eMechanism, rtl_TextEncoding eCharset);
1407cdf0e10cSrcweir 
1408cdf0e10cSrcweir     bool clearPassword();
1409cdf0e10cSrcweir 
1410cdf0e10cSrcweir     bool setPassword(
1411cdf0e10cSrcweir         rtl::OUString const & rThePassword, bool bOctets,
1412cdf0e10cSrcweir         EncodeMechanism eMechanism, rtl_TextEncoding eCharset);
1413cdf0e10cSrcweir 
1414cdf0e10cSrcweir     // Host and Port:
1415cdf0e10cSrcweir 
1416cdf0e10cSrcweir     TOOLS_DLLPRIVATE static bool parseHost(
1417cdf0e10cSrcweir         sal_Unicode const *& rBegin, sal_Unicode const * pEnd,
1418cdf0e10cSrcweir         rtl::OUString & rCanonic);
1419cdf0e10cSrcweir 
1420cdf0e10cSrcweir     TOOLS_DLLPRIVATE static bool parseHostOrNetBiosName(
1421cdf0e10cSrcweir         sal_Unicode const * pBegin, sal_Unicode const * pEnd, bool bOctets,
1422cdf0e10cSrcweir         EncodeMechanism eMechanism, rtl_TextEncoding eCharset,
1423cdf0e10cSrcweir         bool bNetBiosName, rtl::OUStringBuffer* pCanonic);
1424cdf0e10cSrcweir 
1425cdf0e10cSrcweir     static rtl::OUString encodeHostPort(
1426cdf0e10cSrcweir         rtl::OUString const & rTheHostPort, bool bOctets,
1427cdf0e10cSrcweir         EncodeMechanism eMechanism, rtl_TextEncoding eCharset);
1428cdf0e10cSrcweir 
1429cdf0e10cSrcweir     bool setHost(
1430cdf0e10cSrcweir         rtl::OUString const & rTheHost, bool bOctets,
1431cdf0e10cSrcweir         EncodeMechanism eMechanism, rtl_TextEncoding eCharset);
1432cdf0e10cSrcweir 
1433cdf0e10cSrcweir     // Path:
1434cdf0e10cSrcweir 
1435cdf0e10cSrcweir     TOOLS_DLLPRIVATE static bool parsePath(
1436cdf0e10cSrcweir         INetProtocol eScheme, sal_Unicode const ** pBegin,
1437cdf0e10cSrcweir         sal_Unicode const * pEnd, bool bOctets, EncodeMechanism eMechanism,
1438cdf0e10cSrcweir         rtl_TextEncoding eCharset, bool bSkippedInitialSlash,
1439cdf0e10cSrcweir         sal_uInt32 nSegmentDelimiter, sal_uInt32 nAltSegmentDelimiter,
1440cdf0e10cSrcweir         sal_uInt32 nQueryDelimiter, sal_uInt32 nFragmentDelimiter,
1441cdf0e10cSrcweir         rtl::OUStringBuffer &rSynPath);
1442cdf0e10cSrcweir 
1443cdf0e10cSrcweir     bool setPath(
1444cdf0e10cSrcweir         rtl::OUString const & rThePath, bool bOctets,
1445cdf0e10cSrcweir         EncodeMechanism eMechanism, rtl_TextEncoding eCharset);
1446cdf0e10cSrcweir 
1447cdf0e10cSrcweir     // Hierarchical Path:
1448cdf0e10cSrcweir 
1449cdf0e10cSrcweir     TOOLS_DLLPRIVATE bool checkHierarchical() const;
1450cdf0e10cSrcweir 
1451cdf0e10cSrcweir     bool appendSegment(
1452cdf0e10cSrcweir         rtl::OUString const & rTheSegment, bool bOctets,
1453cdf0e10cSrcweir         EncodeMechanism eMechanism, rtl_TextEncoding eCharset);
1454cdf0e10cSrcweir 
1455cdf0e10cSrcweir     TOOLS_DLLPRIVATE SubString getSegment(
1456cdf0e10cSrcweir         sal_Int32 nIndex, bool bIgnoreFinalSlash) const;
1457cdf0e10cSrcweir 
1458cdf0e10cSrcweir     bool insertName(
1459cdf0e10cSrcweir         rtl::OUString const & rTheName, bool bOctets, bool bAppendFinalSlash,
1460cdf0e10cSrcweir         sal_Int32 nIndex, bool bIgnoreFinalSlash, EncodeMechanism eMechanism,
1461cdf0e10cSrcweir         rtl_TextEncoding eCharset);
1462cdf0e10cSrcweir 
1463cdf0e10cSrcweir     // Query:
1464cdf0e10cSrcweir 
1465cdf0e10cSrcweir     bool clearQuery();
1466cdf0e10cSrcweir 
1467cdf0e10cSrcweir     bool setQuery(
1468cdf0e10cSrcweir         rtl::OUString const & rTheQuery, bool bOctets,
1469cdf0e10cSrcweir         EncodeMechanism eMechanism, rtl_TextEncoding eCharset);
1470cdf0e10cSrcweir 
1471cdf0e10cSrcweir     // Fragment:
1472cdf0e10cSrcweir 
1473cdf0e10cSrcweir     bool clearFragment();
1474cdf0e10cSrcweir 
1475cdf0e10cSrcweir     bool setFragment(
1476cdf0e10cSrcweir         rtl::OUString const & rTheMark, bool bOctets,
1477cdf0e10cSrcweir         EncodeMechanism eMechanism, rtl_TextEncoding eCharset);
1478cdf0e10cSrcweir 
1479cdf0e10cSrcweir     // FTP URLs:
1480cdf0e10cSrcweir 
1481cdf0e10cSrcweir     enum FTPType { FTP_TYPE_NONE, FTP_TYPE_A, FTP_TYPE_I, FTP_TYPE_D };
1482cdf0e10cSrcweir 
1483cdf0e10cSrcweir     TOOLS_DLLPRIVATE FTPType getFTPType() const;
1484cdf0e10cSrcweir 
1485cdf0e10cSrcweir     // FILE URLs:
1486cdf0e10cSrcweir 
1487cdf0e10cSrcweir     TOOLS_DLLPRIVATE bool hasDosVolume(FSysStyle eStyle) const;
1488cdf0e10cSrcweir 
1489cdf0e10cSrcweir     // IMAP URLs:
1490cdf0e10cSrcweir 
1491cdf0e10cSrcweir     TOOLS_DLLPRIVATE sal_uInt32 getIMAPUID() const;
1492cdf0e10cSrcweir 
1493cdf0e10cSrcweir     // Coding:
1494cdf0e10cSrcweir 
extend(ByteString const & rOctets)1495cdf0e10cSrcweir     static inline rtl::OUString extend(ByteString const & rOctets)
1496cdf0e10cSrcweir     {
1497cdf0e10cSrcweir         return rtl::OUString(rOctets.GetBuffer(), rOctets.Len(),
1498cdf0e10cSrcweir             RTL_TEXTENCODING_ISO_8859_1);
1499cdf0e10cSrcweir     }
1500cdf0e10cSrcweir 
getEscapePrefix(INetProtocol eTheScheme)1501cdf0e10cSrcweir     static inline sal_Char getEscapePrefix(INetProtocol eTheScheme)
1502cdf0e10cSrcweir     { return eTheScheme == INET_PROT_VIM ? '=' : '%'; }
1503cdf0e10cSrcweir 
getEscapePrefix() const1504cdf0e10cSrcweir     inline sal_Char getEscapePrefix() const
1505cdf0e10cSrcweir     { return getEscapePrefix(m_eScheme); }
1506cdf0e10cSrcweir 
1507cdf0e10cSrcweir     TOOLS_DLLPRIVATE static inline void appendEscape(
1508cdf0e10cSrcweir         rtl::OUStringBuffer & rTheText, sal_Char cEscapePrefix,
1509cdf0e10cSrcweir         sal_uInt32 nOctet);
1510cdf0e10cSrcweir 
1511cdf0e10cSrcweir     static rtl::OUString encodeText(
1512cdf0e10cSrcweir         sal_Unicode const * pBegin, sal_Unicode const * pEnd, bool bOctets,
1513cdf0e10cSrcweir         Part ePart, sal_Char cEscapePrefix, EncodeMechanism eMechanism,
1514cdf0e10cSrcweir         rtl_TextEncoding eCharset, bool bKeepVisibleEscapes);
1515cdf0e10cSrcweir 
1516cdf0e10cSrcweir     static inline rtl::OUString encodeText(
1517cdf0e10cSrcweir         rtl::OUString const & rTheText, bool bOctets, Part ePart,
1518cdf0e10cSrcweir         sal_Char cEscapePrefix, EncodeMechanism eMechanism,
1519cdf0e10cSrcweir         rtl_TextEncoding eCharset, bool bKeepVisibleEscapes);
1520cdf0e10cSrcweir 
1521cdf0e10cSrcweir     static rtl::OUString decode(
1522cdf0e10cSrcweir         sal_Unicode const * pBegin, sal_Unicode const * pEnd,
1523cdf0e10cSrcweir         sal_Char cEscapePrefix, DecodeMechanism, rtl_TextEncoding eCharset);
1524cdf0e10cSrcweir 
1525cdf0e10cSrcweir     inline rtl::OUString decode(
1526cdf0e10cSrcweir         SubString const & rSubString, sal_Char cEscapePrefix,
1527cdf0e10cSrcweir         DecodeMechanism eMechanism, rtl_TextEncoding eCharset) const;
1528cdf0e10cSrcweir 
1529cdf0e10cSrcweir     // Specialized helpers:
1530cdf0e10cSrcweir 
1531cdf0e10cSrcweir     TOOLS_DLLPRIVATE static bool scanIPv6reference(
1532cdf0e10cSrcweir         sal_Unicode const *& rBegin, sal_Unicode const * pEnd);
1533cdf0e10cSrcweir };
1534cdf0e10cSrcweir 
1535cdf0e10cSrcweir // static
encodeText(rtl::OUString const & rTheText,bool bOctets,Part ePart,sal_Char cEscapePrefix,EncodeMechanism eMechanism,rtl_TextEncoding eCharset,bool bKeepVisibleEscapes)1536cdf0e10cSrcweir inline rtl::OUString INetURLObject::encodeText(rtl::OUString const & rTheText,
1537cdf0e10cSrcweir 										   bool bOctets, Part ePart,
1538cdf0e10cSrcweir 										   sal_Char cEscapePrefix,
1539cdf0e10cSrcweir 										   EncodeMechanism eMechanism,
1540cdf0e10cSrcweir 										   rtl_TextEncoding eCharset,
1541cdf0e10cSrcweir 										   bool bKeepVisibleEscapes)
1542cdf0e10cSrcweir {
1543cdf0e10cSrcweir 	return encodeText(rTheText.getStr(),
1544cdf0e10cSrcweir 					  rTheText.getStr() + rTheText.getLength(), bOctets, ePart,
1545cdf0e10cSrcweir 					  cEscapePrefix, eMechanism, eCharset,
1546cdf0e10cSrcweir 					  bKeepVisibleEscapes);
1547cdf0e10cSrcweir }
1548cdf0e10cSrcweir 
decode(SubString const & rSubString,sal_Char cEscapePrefix,DecodeMechanism eMechanism,rtl_TextEncoding eCharset) const1549cdf0e10cSrcweir inline rtl::OUString INetURLObject::decode(SubString const & rSubString,
1550cdf0e10cSrcweir 									   sal_Char cEscapePrefix,
1551cdf0e10cSrcweir 									   DecodeMechanism eMechanism,
1552cdf0e10cSrcweir 									   rtl_TextEncoding eCharset) const
1553cdf0e10cSrcweir {
1554cdf0e10cSrcweir     return rSubString.isPresent() ?
1555cdf0e10cSrcweir                decode(m_aAbsURIRef.getStr() + rSubString.getBegin(),
1556cdf0e10cSrcweir                       m_aAbsURIRef.getStr() + rSubString.getEnd(),
1557cdf0e10cSrcweir                       cEscapePrefix, eMechanism, eCharset) :
1558cdf0e10cSrcweir                rtl::OUString();
1559cdf0e10cSrcweir }
1560cdf0e10cSrcweir 
INetURLObject(ByteString const & rTheAbsURIRef,EncodeMechanism eMechanism,rtl_TextEncoding eCharset)1561cdf0e10cSrcweir inline INetURLObject::INetURLObject(ByteString const & rTheAbsURIRef,
1562cdf0e10cSrcweir 									EncodeMechanism eMechanism,
1563cdf0e10cSrcweir 									rtl_TextEncoding eCharset):
1564cdf0e10cSrcweir 	m_eScheme(INET_PROT_NOT_VALID), m_eSmartScheme(INET_PROT_HTTP)
1565cdf0e10cSrcweir {
1566cdf0e10cSrcweir 	setAbsURIRef(extend(rTheAbsURIRef), true, eMechanism, eCharset, false,
1567cdf0e10cSrcweir 				 FSysStyle(0));
1568cdf0e10cSrcweir }
1569cdf0e10cSrcweir 
INetURLObject(rtl::OUString const & rTheAbsURIRef,EncodeMechanism eMechanism,rtl_TextEncoding eCharset)1570cdf0e10cSrcweir inline INetURLObject::INetURLObject(rtl::OUString const & rTheAbsURIRef,
1571cdf0e10cSrcweir 									EncodeMechanism eMechanism,
1572cdf0e10cSrcweir 									rtl_TextEncoding eCharset):
1573cdf0e10cSrcweir 	m_eScheme(INET_PROT_NOT_VALID), m_eSmartScheme(INET_PROT_HTTP)
1574cdf0e10cSrcweir {
1575cdf0e10cSrcweir 	setAbsURIRef(rTheAbsURIRef, false, eMechanism, eCharset, false,
1576cdf0e10cSrcweir 				 FSysStyle(0));
1577cdf0e10cSrcweir }
1578cdf0e10cSrcweir 
SetURL(ByteString const & rTheAbsURIRef,EncodeMechanism eMechanism,rtl_TextEncoding eCharset)1579cdf0e10cSrcweir inline bool INetURLObject::SetURL(ByteString const & rTheAbsURIRef,
1580cdf0e10cSrcweir 								  EncodeMechanism eMechanism,
1581cdf0e10cSrcweir 								  rtl_TextEncoding eCharset)
1582cdf0e10cSrcweir {
1583cdf0e10cSrcweir 	return setAbsURIRef(extend(rTheAbsURIRef), true, eMechanism, eCharset,
1584cdf0e10cSrcweir 						false, FSysStyle(0));
1585cdf0e10cSrcweir }
1586cdf0e10cSrcweir 
SetURL(rtl::OUString const & rTheAbsURIRef,EncodeMechanism eMechanism,rtl_TextEncoding eCharset)1587cdf0e10cSrcweir inline bool INetURLObject::SetURL(rtl::OUString const & rTheAbsURIRef,
1588cdf0e10cSrcweir 								  EncodeMechanism eMechanism,
1589cdf0e10cSrcweir 								  rtl_TextEncoding eCharset)
1590cdf0e10cSrcweir {
1591cdf0e10cSrcweir 	return setAbsURIRef(rTheAbsURIRef, false, eMechanism, eCharset, false,
1592cdf0e10cSrcweir 						FSysStyle(0));
1593cdf0e10cSrcweir }
1594cdf0e10cSrcweir 
INetURLObject(rtl::OUString const & rTheAbsURIRef,INetProtocol eTheSmartScheme,EncodeMechanism eMechanism,rtl_TextEncoding eCharset,FSysStyle eStyle)1595cdf0e10cSrcweir inline INetURLObject::INetURLObject(rtl::OUString const & rTheAbsURIRef,
1596cdf0e10cSrcweir 									INetProtocol eTheSmartScheme,
1597cdf0e10cSrcweir 									EncodeMechanism eMechanism,
1598cdf0e10cSrcweir 									rtl_TextEncoding eCharset,
1599cdf0e10cSrcweir 									FSysStyle eStyle):
1600cdf0e10cSrcweir 	m_eScheme(INET_PROT_NOT_VALID), m_eSmartScheme(eTheSmartScheme)
1601cdf0e10cSrcweir {
1602cdf0e10cSrcweir 	setAbsURIRef(rTheAbsURIRef, false, eMechanism, eCharset, true, eStyle);
1603cdf0e10cSrcweir }
1604cdf0e10cSrcweir 
SetSmartURL(ByteString const & rTheAbsURIRef,EncodeMechanism eMechanism,rtl_TextEncoding eCharset,FSysStyle eStyle)1605cdf0e10cSrcweir inline bool INetURLObject::SetSmartURL(ByteString const & rTheAbsURIRef,
1606cdf0e10cSrcweir 									   EncodeMechanism eMechanism,
1607cdf0e10cSrcweir 									   rtl_TextEncoding eCharset,
1608cdf0e10cSrcweir 									   FSysStyle eStyle)
1609cdf0e10cSrcweir {
1610cdf0e10cSrcweir 	return setAbsURIRef(extend(rTheAbsURIRef), true, eMechanism, eCharset,
1611cdf0e10cSrcweir 						true, eStyle);
1612cdf0e10cSrcweir }
1613cdf0e10cSrcweir 
SetSmartURL(rtl::OUString const & rTheAbsURIRef,EncodeMechanism eMechanism,rtl_TextEncoding eCharset,FSysStyle eStyle)1614cdf0e10cSrcweir inline bool INetURLObject::SetSmartURL(rtl::OUString const & rTheAbsURIRef,
1615cdf0e10cSrcweir 									   EncodeMechanism eMechanism,
1616cdf0e10cSrcweir 									   rtl_TextEncoding eCharset,
1617cdf0e10cSrcweir 									   FSysStyle eStyle)
1618cdf0e10cSrcweir {
1619cdf0e10cSrcweir 	return setAbsURIRef(rTheAbsURIRef, false, eMechanism, eCharset, true,
1620cdf0e10cSrcweir 						eStyle);
1621cdf0e10cSrcweir }
1622cdf0e10cSrcweir 
1623cdf0e10cSrcweir inline INetURLObject
smartRel2Abs(ByteString const & rTheRelURIRef,bool & rWasAbsolute,bool bIgnoreFragment,EncodeMechanism eMechanism,rtl_TextEncoding eCharset,bool bRelativeNonURIs,FSysStyle eStyle) const1624cdf0e10cSrcweir INetURLObject::smartRel2Abs(ByteString const & rTheRelURIRef,
1625cdf0e10cSrcweir 							bool & rWasAbsolute,
1626cdf0e10cSrcweir 							bool bIgnoreFragment,
1627cdf0e10cSrcweir 							EncodeMechanism eMechanism,
1628cdf0e10cSrcweir 							rtl_TextEncoding eCharset,
1629cdf0e10cSrcweir 							bool bRelativeNonURIs,
1630cdf0e10cSrcweir 							FSysStyle eStyle) const
1631cdf0e10cSrcweir {
1632cdf0e10cSrcweir 	INetURLObject aTheAbsURIRef;
1633cdf0e10cSrcweir 	convertRelToAbs(extend(rTheRelURIRef), true, aTheAbsURIRef, rWasAbsolute,
1634cdf0e10cSrcweir 					eMechanism, eCharset, bIgnoreFragment, true,
1635cdf0e10cSrcweir 					bRelativeNonURIs, eStyle);
1636cdf0e10cSrcweir 	return aTheAbsURIRef;
1637cdf0e10cSrcweir }
1638cdf0e10cSrcweir 
1639cdf0e10cSrcweir inline INetURLObject
smartRel2Abs(rtl::OUString const & rTheRelURIRef,bool & rWasAbsolute,bool bIgnoreFragment,EncodeMechanism eMechanism,rtl_TextEncoding eCharset,bool bRelativeNonURIs,FSysStyle eStyle) const1640cdf0e10cSrcweir INetURLObject::smartRel2Abs(rtl::OUString const & rTheRelURIRef,
1641cdf0e10cSrcweir 							bool & rWasAbsolute,
1642cdf0e10cSrcweir 							bool bIgnoreFragment,
1643cdf0e10cSrcweir 							EncodeMechanism eMechanism,
1644cdf0e10cSrcweir 							rtl_TextEncoding eCharset,
1645cdf0e10cSrcweir 							bool bRelativeNonURIs,
1646cdf0e10cSrcweir 							FSysStyle eStyle) const
1647cdf0e10cSrcweir {
1648cdf0e10cSrcweir 	INetURLObject aTheAbsURIRef;
1649cdf0e10cSrcweir 	convertRelToAbs(rTheRelURIRef, false, aTheAbsURIRef, rWasAbsolute,
1650cdf0e10cSrcweir 					eMechanism, eCharset, bIgnoreFragment, true,
1651cdf0e10cSrcweir 					bRelativeNonURIs, eStyle);
1652cdf0e10cSrcweir 	return aTheAbsURIRef;
1653cdf0e10cSrcweir }
1654cdf0e10cSrcweir 
GetNewAbsURL(ByteString const & rTheRelURIRef,INetURLObject * pTheAbsURIRef,EncodeMechanism eMechanism,rtl_TextEncoding eCharset,FSysStyle eStyle,bool bIgnoreFragment) const1655cdf0e10cSrcweir inline bool INetURLObject::GetNewAbsURL(ByteString const & rTheRelURIRef,
1656cdf0e10cSrcweir 										INetURLObject * pTheAbsURIRef,
1657cdf0e10cSrcweir 										EncodeMechanism eMechanism,
1658cdf0e10cSrcweir 										rtl_TextEncoding eCharset,
1659cdf0e10cSrcweir 										FSysStyle eStyle, bool bIgnoreFragment)
1660cdf0e10cSrcweir     const
1661cdf0e10cSrcweir {
1662cdf0e10cSrcweir 	INetURLObject aTheAbsURIRef;
1663cdf0e10cSrcweir 	bool bWasAbsolute;
1664cdf0e10cSrcweir 	if (!convertRelToAbs(extend(rTheRelURIRef), true, aTheAbsURIRef,
1665cdf0e10cSrcweir 						 bWasAbsolute, eMechanism, eCharset, bIgnoreFragment,
1666cdf0e10cSrcweir                          false, false, eStyle))
1667cdf0e10cSrcweir 		return false;
1668cdf0e10cSrcweir 	if (pTheAbsURIRef)
1669cdf0e10cSrcweir 		*pTheAbsURIRef = aTheAbsURIRef;
1670cdf0e10cSrcweir 	return true;
1671cdf0e10cSrcweir }
1672cdf0e10cSrcweir 
GetNewAbsURL(rtl::OUString const & rTheRelURIRef,INetURLObject * pTheAbsURIRef,EncodeMechanism eMechanism,rtl_TextEncoding eCharset,FSysStyle eStyle,bool bIgnoreFragment) const1673cdf0e10cSrcweir inline bool INetURLObject::GetNewAbsURL(rtl::OUString const & rTheRelURIRef,
1674cdf0e10cSrcweir 										INetURLObject * pTheAbsURIRef,
1675cdf0e10cSrcweir 										EncodeMechanism eMechanism,
1676cdf0e10cSrcweir 										rtl_TextEncoding eCharset,
1677cdf0e10cSrcweir 										FSysStyle eStyle, bool bIgnoreFragment)
1678cdf0e10cSrcweir     const
1679cdf0e10cSrcweir {
1680cdf0e10cSrcweir 	INetURLObject aTheAbsURIRef;
1681cdf0e10cSrcweir 	bool bWasAbsolute;
1682cdf0e10cSrcweir 	if (!convertRelToAbs(rTheRelURIRef, false, aTheAbsURIRef, bWasAbsolute,
1683cdf0e10cSrcweir 						 eMechanism, eCharset, bIgnoreFragment, false, false,
1684cdf0e10cSrcweir                          eStyle))
1685cdf0e10cSrcweir 		return false;
1686cdf0e10cSrcweir 	if (pTheAbsURIRef)
1687cdf0e10cSrcweir 		*pTheAbsURIRef = aTheAbsURIRef;
1688cdf0e10cSrcweir 	return true;
1689cdf0e10cSrcweir }
1690cdf0e10cSrcweir 
1691cdf0e10cSrcweir // static
GetRelURL(ByteString const & rTheBaseURIRef,ByteString const & rTheAbsURIRef,EncodeMechanism eEncodeMechanism,DecodeMechanism eDecodeMechanism,rtl_TextEncoding eCharset,FSysStyle eStyle)1692cdf0e10cSrcweir inline rtl::OUString INetURLObject::GetRelURL(ByteString const & rTheBaseURIRef,
1693cdf0e10cSrcweir 										  ByteString const & rTheAbsURIRef,
1694cdf0e10cSrcweir 										  EncodeMechanism eEncodeMechanism,
1695cdf0e10cSrcweir 										  DecodeMechanism eDecodeMechanism,
1696cdf0e10cSrcweir 										  rtl_TextEncoding eCharset,
1697cdf0e10cSrcweir 										  FSysStyle eStyle)
1698cdf0e10cSrcweir {
1699cdf0e10cSrcweir 	rtl::OUString aTheRelURIRef;
1700cdf0e10cSrcweir 	INetURLObject(rTheBaseURIRef, eEncodeMechanism, eCharset).
1701cdf0e10cSrcweir 		convertAbsToRel(extend(rTheAbsURIRef), true, aTheRelURIRef,
1702cdf0e10cSrcweir 						eEncodeMechanism, eDecodeMechanism, eCharset, eStyle);
1703cdf0e10cSrcweir 	return aTheRelURIRef;
1704cdf0e10cSrcweir }
1705cdf0e10cSrcweir 
1706cdf0e10cSrcweir // static
GetRelURL(rtl::OUString const & rTheBaseURIRef,rtl::OUString const & rTheAbsURIRef,EncodeMechanism eEncodeMechanism,DecodeMechanism eDecodeMechanism,rtl_TextEncoding eCharset,FSysStyle eStyle)1707cdf0e10cSrcweir inline rtl::OUString INetURLObject::GetRelURL(rtl::OUString const & rTheBaseURIRef,
1708cdf0e10cSrcweir 										  rtl::OUString const & rTheAbsURIRef,
1709cdf0e10cSrcweir 										  EncodeMechanism eEncodeMechanism,
1710cdf0e10cSrcweir 										  DecodeMechanism eDecodeMechanism,
1711cdf0e10cSrcweir 										  rtl_TextEncoding eCharset,
1712cdf0e10cSrcweir 										  FSysStyle eStyle)
1713cdf0e10cSrcweir {
1714cdf0e10cSrcweir 	rtl::OUString aTheRelURIRef;
1715cdf0e10cSrcweir 	INetURLObject(rTheBaseURIRef, eEncodeMechanism, eCharset).
1716cdf0e10cSrcweir 		convertAbsToRel(rTheAbsURIRef, false, aTheRelURIRef, eEncodeMechanism,
1717cdf0e10cSrcweir 						eDecodeMechanism, eCharset, eStyle);
1718cdf0e10cSrcweir 	return aTheRelURIRef;
1719cdf0e10cSrcweir }
1720cdf0e10cSrcweir 
1721cdf0e10cSrcweir // static
translateToExternal(ByteString const & rTheIntURIRef,rtl::OUString & rTheExtURIRef,DecodeMechanism eDecodeMechanism,rtl_TextEncoding eCharset)1722cdf0e10cSrcweir inline bool INetURLObject::translateToExternal(ByteString const &
1723cdf0e10cSrcweir 											       rTheIntURIRef,
1724cdf0e10cSrcweir 											   rtl::OUString & rTheExtURIRef,
1725cdf0e10cSrcweir 											   DecodeMechanism
1726cdf0e10cSrcweir 											       eDecodeMechanism,
1727cdf0e10cSrcweir 											   rtl_TextEncoding eCharset)
1728cdf0e10cSrcweir {
1729cdf0e10cSrcweir 	rtl::OUString aTheExtURIRef;
1730cdf0e10cSrcweir 	bool bRet = convertIntToExt(extend(rTheIntURIRef), true, aTheExtURIRef,
1731cdf0e10cSrcweir                                 eDecodeMechanism, eCharset);
1732cdf0e10cSrcweir 	rTheExtURIRef = aTheExtURIRef;
1733cdf0e10cSrcweir 	return bRet;
1734cdf0e10cSrcweir }
1735cdf0e10cSrcweir 
1736cdf0e10cSrcweir // static
translateToExternal(rtl::OUString const & rTheIntURIRef,rtl::OUString & rTheExtURIRef,DecodeMechanism eDecodeMechanism,rtl_TextEncoding eCharset)1737cdf0e10cSrcweir inline bool INetURLObject::translateToExternal(rtl::OUString const &
1738cdf0e10cSrcweir 											       rTheIntURIRef,
1739cdf0e10cSrcweir 											   rtl::OUString & rTheExtURIRef,
1740cdf0e10cSrcweir 											   DecodeMechanism
1741cdf0e10cSrcweir 											       eDecodeMechanism,
1742cdf0e10cSrcweir 											   rtl_TextEncoding eCharset)
1743cdf0e10cSrcweir {
1744cdf0e10cSrcweir 	return convertIntToExt(rTheIntURIRef, false, rTheExtURIRef,
1745cdf0e10cSrcweir 						   eDecodeMechanism, eCharset);
1746cdf0e10cSrcweir }
1747cdf0e10cSrcweir 
1748cdf0e10cSrcweir // static
translateToInternal(ByteString const & rTheExtURIRef,rtl::OUString & rTheIntURIRef,DecodeMechanism eDecodeMechanism,rtl_TextEncoding eCharset)1749cdf0e10cSrcweir inline bool INetURLObject::translateToInternal(ByteString const &
1750cdf0e10cSrcweir 											       rTheExtURIRef,
1751cdf0e10cSrcweir 											   rtl::OUString & rTheIntURIRef,
1752cdf0e10cSrcweir 											   DecodeMechanism
1753cdf0e10cSrcweir 											       eDecodeMechanism,
1754cdf0e10cSrcweir 											   rtl_TextEncoding eCharset)
1755cdf0e10cSrcweir {
1756cdf0e10cSrcweir 	rtl::OUString aTheIntURIRef;
1757cdf0e10cSrcweir 	bool bRet = convertExtToInt(extend(rTheExtURIRef), true, aTheIntURIRef,
1758cdf0e10cSrcweir 						   eDecodeMechanism, eCharset);
1759cdf0e10cSrcweir 	rTheIntURIRef = aTheIntURIRef;
1760cdf0e10cSrcweir 	return bRet;
1761cdf0e10cSrcweir }
1762cdf0e10cSrcweir 
1763cdf0e10cSrcweir // static
translateToInternal(rtl::OUString const & rTheExtURIRef,rtl::OUString & rTheIntURIRef,DecodeMechanism eDecodeMechanism,rtl_TextEncoding eCharset)1764cdf0e10cSrcweir inline bool INetURLObject::translateToInternal(rtl::OUString const &
1765cdf0e10cSrcweir                                                    rTheExtURIRef,
1766cdf0e10cSrcweir                                                rtl::OUString & rTheIntURIRef,
1767cdf0e10cSrcweir                                                DecodeMechanism
1768cdf0e10cSrcweir                                                    eDecodeMechanism,
1769cdf0e10cSrcweir                                                rtl_TextEncoding eCharset)
1770cdf0e10cSrcweir {
1771cdf0e10cSrcweir     return convertExtToInt(rTheExtURIRef, false, rTheIntURIRef,
1772cdf0e10cSrcweir                            eDecodeMechanism, eCharset);
1773cdf0e10cSrcweir }
1774cdf0e10cSrcweir 
SetPass(ByteString const & rThePassword,EncodeMechanism eMechanism,rtl_TextEncoding eCharset)1775cdf0e10cSrcweir inline bool INetURLObject::SetPass(ByteString const & rThePassword,
1776cdf0e10cSrcweir 								   EncodeMechanism eMechanism,
1777cdf0e10cSrcweir 								   rtl_TextEncoding eCharset)
1778cdf0e10cSrcweir {
1779cdf0e10cSrcweir 	return rThePassword.Len() == 0 ?
1780cdf0e10cSrcweir 		       clearPassword() :
1781cdf0e10cSrcweir 		       setPassword(extend(rThePassword), true, eMechanism, eCharset);
1782cdf0e10cSrcweir }
1783cdf0e10cSrcweir 
SetPass(rtl::OUString const & rThePassword,EncodeMechanism eMechanism,rtl_TextEncoding eCharset)1784cdf0e10cSrcweir inline bool INetURLObject::SetPass(rtl::OUString const & rThePassword,
1785cdf0e10cSrcweir 								   EncodeMechanism eMechanism,
1786cdf0e10cSrcweir 								   rtl_TextEncoding eCharset)
1787cdf0e10cSrcweir {
1788cdf0e10cSrcweir 	return rThePassword.getLength() == 0 ?
1789cdf0e10cSrcweir 		       clearPassword() :
1790cdf0e10cSrcweir 		       setPassword(rThePassword, false, eMechanism, eCharset);
1791cdf0e10cSrcweir }
1792cdf0e10cSrcweir 
SetUserAndPass(ByteString const & rTheUser,ByteString const & rThePassword,EncodeMechanism eMechanism,rtl_TextEncoding eCharset)1793cdf0e10cSrcweir inline bool INetURLObject::SetUserAndPass(ByteString const & rTheUser,
1794cdf0e10cSrcweir 										  ByteString const & rThePassword,
1795cdf0e10cSrcweir 										  EncodeMechanism eMechanism,
1796cdf0e10cSrcweir 										  rtl_TextEncoding eCharset)
1797cdf0e10cSrcweir {
1798cdf0e10cSrcweir 	return setUser(extend(rTheUser), true, eMechanism, eCharset)
1799cdf0e10cSrcweir 		   && (rThePassword.Len() == 0 ?
1800cdf0e10cSrcweir 			       clearPassword() :
1801cdf0e10cSrcweir 			       setPassword(extend(rThePassword), true, eMechanism,
1802cdf0e10cSrcweir 							   eCharset));
1803cdf0e10cSrcweir }
1804cdf0e10cSrcweir 
SetUserAndPass(rtl::OUString const & rTheUser,rtl::OUString const & rThePassword,EncodeMechanism eMechanism,rtl_TextEncoding eCharset)1805cdf0e10cSrcweir inline bool INetURLObject::SetUserAndPass(rtl::OUString const & rTheUser,
1806cdf0e10cSrcweir 										  rtl::OUString const & rThePassword,
1807cdf0e10cSrcweir 										  EncodeMechanism eMechanism,
1808cdf0e10cSrcweir 										  rtl_TextEncoding eCharset)
1809cdf0e10cSrcweir {
1810cdf0e10cSrcweir 	return setUser(rTheUser, false, eMechanism, eCharset)
1811cdf0e10cSrcweir 		   && (rThePassword.getLength() == 0 ?
1812cdf0e10cSrcweir 			       clearPassword() :
1813cdf0e10cSrcweir 			       setPassword(rThePassword, false, eMechanism, eCharset));
1814cdf0e10cSrcweir }
1815cdf0e10cSrcweir 
1816cdf0e10cSrcweir // static
encodeHostPort(ByteString const & rTheHostPort,EncodeMechanism eMechanism,rtl_TextEncoding eCharset)1817cdf0e10cSrcweir inline rtl::OUString INetURLObject::encodeHostPort(ByteString const &
1818cdf0e10cSrcweir 											       rTheHostPort,
1819cdf0e10cSrcweir 											   EncodeMechanism eMechanism,
1820cdf0e10cSrcweir 											   rtl_TextEncoding eCharset)
1821cdf0e10cSrcweir {
1822cdf0e10cSrcweir 	return encodeHostPort(extend(rTheHostPort), true, eMechanism, eCharset);
1823cdf0e10cSrcweir }
1824cdf0e10cSrcweir 
insertName(rtl::OUString const & rTheName,bool bAppendFinalSlash,sal_Int32 nIndex,bool bIgnoreFinalSlash,EncodeMechanism eMechanism,rtl_TextEncoding eCharset)1825cdf0e10cSrcweir inline bool INetURLObject::insertName(rtl::OUString const & rTheName,
1826cdf0e10cSrcweir 									  bool bAppendFinalSlash,
1827cdf0e10cSrcweir 									  sal_Int32 nIndex,
1828cdf0e10cSrcweir 									  bool bIgnoreFinalSlash,
1829cdf0e10cSrcweir 									  EncodeMechanism eMechanism,
1830cdf0e10cSrcweir 									  rtl_TextEncoding eCharset)
1831cdf0e10cSrcweir {
1832cdf0e10cSrcweir 	return insertName(rTheName, false, bAppendFinalSlash, nIndex,
1833cdf0e10cSrcweir 					  bIgnoreFinalSlash, eMechanism, eCharset);
1834cdf0e10cSrcweir }
1835cdf0e10cSrcweir 
SetParam(ByteString const & rTheQuery,EncodeMechanism eMechanism,rtl_TextEncoding eCharset)1836cdf0e10cSrcweir inline bool INetURLObject::SetParam(ByteString const & rTheQuery,
1837cdf0e10cSrcweir 									EncodeMechanism eMechanism,
1838cdf0e10cSrcweir 									rtl_TextEncoding eCharset)
1839cdf0e10cSrcweir {
1840cdf0e10cSrcweir 	return rTheQuery.Len() == 0 ?
1841cdf0e10cSrcweir 		       clearQuery() :
1842cdf0e10cSrcweir 		       setQuery(extend(rTheQuery), true, eMechanism, eCharset);
1843cdf0e10cSrcweir }
1844cdf0e10cSrcweir 
SetParam(rtl::OUString const & rTheQuery,EncodeMechanism eMechanism,rtl_TextEncoding eCharset)1845cdf0e10cSrcweir inline bool INetURLObject::SetParam(rtl::OUString const & rTheQuery,
1846cdf0e10cSrcweir 									EncodeMechanism eMechanism,
1847cdf0e10cSrcweir 									rtl_TextEncoding eCharset)
1848cdf0e10cSrcweir {
1849cdf0e10cSrcweir 	return rTheQuery.getLength() == 0 ?
1850cdf0e10cSrcweir 		       clearQuery() :
1851cdf0e10cSrcweir 		       setQuery(rTheQuery, false, eMechanism, eCharset);
1852cdf0e10cSrcweir }
1853cdf0e10cSrcweir 
SetMark(ByteString const & rTheFragment,EncodeMechanism eMechanism,rtl_TextEncoding eCharset)1854cdf0e10cSrcweir inline bool INetURLObject::SetMark(ByteString const & rTheFragment,
1855cdf0e10cSrcweir 								   EncodeMechanism eMechanism,
1856cdf0e10cSrcweir 								   rtl_TextEncoding eCharset)
1857cdf0e10cSrcweir {
1858cdf0e10cSrcweir 	return rTheFragment.Len() == 0 ?
1859cdf0e10cSrcweir 		       clearFragment() :
1860cdf0e10cSrcweir 		       setFragment(extend(rTheFragment), true, eMechanism, eCharset);
1861cdf0e10cSrcweir }
1862cdf0e10cSrcweir 
SetMark(rtl::OUString const & rTheFragment,EncodeMechanism eMechanism,rtl_TextEncoding eCharset)1863cdf0e10cSrcweir inline bool INetURLObject::SetMark(rtl::OUString const & rTheFragment,
1864cdf0e10cSrcweir 								   EncodeMechanism eMechanism,
1865cdf0e10cSrcweir 								   rtl_TextEncoding eCharset)
1866cdf0e10cSrcweir {
1867cdf0e10cSrcweir 	return rTheFragment.getLength() == 0 ?
1868cdf0e10cSrcweir 		       clearFragment() :
1869cdf0e10cSrcweir 		       setFragment(rTheFragment, false, eMechanism, eCharset);
1870cdf0e10cSrcweir }
1871cdf0e10cSrcweir 
INetURLObject(rtl::OUString const & rFSysPath,FSysStyle eStyle)1872cdf0e10cSrcweir inline INetURLObject::INetURLObject(rtl::OUString const & rFSysPath,
1873cdf0e10cSrcweir 									FSysStyle eStyle):
1874cdf0e10cSrcweir 	m_eScheme(INET_PROT_NOT_VALID), m_eSmartScheme(INET_PROT_HTTP)
1875cdf0e10cSrcweir {
1876cdf0e10cSrcweir 	setFSysPath(rFSysPath, eStyle);
1877cdf0e10cSrcweir }
1878cdf0e10cSrcweir 
1879cdf0e10cSrcweir // static
encode(ByteString const & rText,Part ePart,sal_Char cEscapePrefix,EncodeMechanism eMechanism,rtl_TextEncoding eCharset)1880cdf0e10cSrcweir inline rtl::OUString INetURLObject::encode(ByteString const & rText, Part ePart,
1881cdf0e10cSrcweir 									   sal_Char cEscapePrefix,
1882cdf0e10cSrcweir 									   EncodeMechanism eMechanism,
1883cdf0e10cSrcweir 									   rtl_TextEncoding eCharset)
1884cdf0e10cSrcweir {
1885cdf0e10cSrcweir 	return encodeText(extend(rText), true, ePart, cEscapePrefix, eMechanism,
1886cdf0e10cSrcweir 					  eCharset, false);
1887cdf0e10cSrcweir }
1888cdf0e10cSrcweir 
1889cdf0e10cSrcweir // static
encode(rtl::OUString const & rText,Part ePart,sal_Char cEscapePrefix,EncodeMechanism eMechanism,rtl_TextEncoding eCharset)1890cdf0e10cSrcweir inline rtl::OUString INetURLObject::encode(rtl::OUString const & rText, Part ePart,
1891cdf0e10cSrcweir 									   sal_Char cEscapePrefix,
1892cdf0e10cSrcweir 									   EncodeMechanism eMechanism,
1893cdf0e10cSrcweir 									   rtl_TextEncoding eCharset)
1894cdf0e10cSrcweir {
1895cdf0e10cSrcweir 	return encodeText(rText, false, ePart, cEscapePrefix, eMechanism,
1896cdf0e10cSrcweir 					  eCharset, false);
1897cdf0e10cSrcweir }
1898cdf0e10cSrcweir 
1899cdf0e10cSrcweir // static
decode(rtl::OUString const & rText,sal_Char cEscapePrefix,DecodeMechanism eMechanism,rtl_TextEncoding eCharset)1900cdf0e10cSrcweir inline rtl::OUString INetURLObject::decode(rtl::OUString const & rText,
1901cdf0e10cSrcweir 									   sal_Char cEscapePrefix,
1902cdf0e10cSrcweir 									   DecodeMechanism eMechanism,
1903cdf0e10cSrcweir 									   rtl_TextEncoding eCharset)
1904cdf0e10cSrcweir {
1905cdf0e10cSrcweir 	return decode(rText.getStr(), rText.getStr() + rText.getLength(),
1906cdf0e10cSrcweir 				  cEscapePrefix, eMechanism, eCharset);
1907cdf0e10cSrcweir }
1908cdf0e10cSrcweir 
decode(rtl::OUStringBuffer const & rText,sal_Char cEscapePrefix,DecodeMechanism eMechanism,rtl_TextEncoding eCharset)1909cdf0e10cSrcweir inline rtl::OUString INetURLObject::decode(rtl::OUStringBuffer const & rText,
1910cdf0e10cSrcweir 									   sal_Char cEscapePrefix,
1911cdf0e10cSrcweir 									   DecodeMechanism eMechanism,
1912cdf0e10cSrcweir 									   rtl_TextEncoding eCharset)
1913cdf0e10cSrcweir {
1914cdf0e10cSrcweir 	return decode(rText.getStr(), rText.getStr() + rText.getLength(),
1915cdf0e10cSrcweir 				  cEscapePrefix, eMechanism, eCharset);
1916cdf0e10cSrcweir }
1917cdf0e10cSrcweir 
1918cdf0e10cSrcweir #endif // _URLOBJ_HXX
1919