.TH "KURL" 3 "28 Jan 2004" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KURL \- Represents and parses a URL.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kurl.h>\fP
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBAdjustementFlags\fP { \fBNoAdjustements\fP =  0, \fBStripFileProtocol\fP =  1 }"
.br
.ti -1c
.RI "enum \fBQueryItemsOptions\fP { \fBCaseInsensitiveKeys\fP =  1 }"
.br
.RI "\fIOptions for \fBqueryItems\fP. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKURL\fP ()"
.br
.RI "\fIConstructs an empty URL. \fP"
.ti -1c
.RI "\fB~KURL\fP ()"
.br
.RI "\fIDestructs the KURL object. \fP"
.ti -1c
.RI "\fBKURL\fP (const  \fBQString\fP &url, int encoding_hint=0)"
.br
.RI "\fIUsual constructor, to construct from a string. \fP"
.ti -1c
.RI "\fBKURL\fP (const  char *url, int encoding_hint=0)"
.br
.RI "\fIConstructor taking a char * \fCurl\fP, which is an _encoded_ representation of the URL, exactly like the usual constructor. \fP"
.ti -1c
.RI "\fBKURL\fP (const  \fBQCString\fP &url, int encoding_hint=0)"
.br
.RI "\fIConstructor taking a \fBQCString\fP \fCurl\fP, which is an _encoded_ representation of the URL, exactly like the usual constructor. \fP"
.ti -1c
.RI "\fBKURL\fP (const  \fBKURL\fP &u)"
.br
.RI "\fICopy constructor. \fP"
.ti -1c
.RI "\fBKURL\fP (const  \fBQUrl\fP &u)"
.br
.RI "\fIConverts from a \fBQUrl\fP. \fP"
.ti -1c
.RI "\fBKURL\fP (const  \fBKURL\fP &_baseurl, const  \fBQString\fP &_rel_url, int encoding_hint=0)"
.br
.RI "\fIConstructor allowing relative URLs. \fP"
.ti -1c
.RI "\fBQString\fP \fBprotocol\fP () const "
.br
.RI "\fIReturns the protocol for the URL (i.e., file, http, etc.). \fP"
.ti -1c
.RI "void \fBsetProtocol\fP (const  \fBQString\fP &_txt)"
.br
.RI "\fISets the protocol for the URL (i.e., file, http, etc.). \fP"
.ti -1c
.RI "\fBQString\fP \fBuser\fP () const "
.br
.RI "\fIReturns the decoded user name (login, user id, ...) included in the URL. \fP"
.ti -1c
.RI "void \fBsetUser\fP (const  \fBQString\fP &_txt)"
.br
.RI "\fISets the user name (login, user id, ...) included in the URL. \fP"
.ti -1c
.RI "bool \fBhasUser\fP () const "
.br
.RI "\fITest to see if this URL has a user name included in it. \fP"
.ti -1c
.RI "\fBQString\fP \fBpass\fP () const "
.br
.RI "\fIReturns the decoded password (corresponding to \fBuser\fP()) included in the URL. \fP"
.ti -1c
.RI "void \fBsetPass\fP (const  \fBQString\fP &_txt)"
.br
.RI "\fISets the password (corresponding to \fBuser\fP()) included in the URL. \fP"
.ti -1c
.RI "bool \fBhasPass\fP () const "
.br
.RI "\fITest to see if this URL has a password included in it. \fP"
.ti -1c
.RI "\fBQString\fP \fBhost\fP () const "
.br
.RI "\fIReturns the decoded hostname included in the URL. \fP"
.ti -1c
.RI "void \fBsetHost\fP (const  \fBQString\fP &_txt)"
.br
.RI "\fISets the hostname included in the URL. \fP"
.ti -1c
.RI "bool \fBhasHost\fP () const "
.br
.RI "\fITest to see if this URL has a hostname included in it. \fP"
.ti -1c
.RI "unsigned short int \fBport\fP () const "
.br
.RI "\fIReturns the port number included in the URL. \fP"
.ti -1c
.RI "void \fBsetPort\fP (unsigned short int _p)"
.br
.RI "\fISets the port number included in the URL. \fP"
.ti -1c
.RI "\fBQString\fP \fBpath\fP () const "
.br
.RI "\fIReturns the current decoded path. \fP"
.ti -1c
.RI "\fBQString\fP \fBpath\fP (int _trailing) const "
.br
.ti -1c
.RI "void \fBsetPath\fP (const  \fBQString\fP &path)"
.br
.RI "\fISets the path of the URL. \fP"
.ti -1c
.RI "bool \fBhasPath\fP () const "
.br
.RI "\fITest to see if this URL has a path is included in it. \fP"
.ti -1c
.RI "void \fBcleanPath\fP (bool cleanDirSeparator=true)"
.br
.RI "\fIResolves '.' and '..' components in path. \fP"
.ti -1c
.RI "void \fBadjustPath\fP (int _trailing)"
.br
.RI "\fIAdd or remove a trailing slash to/from the path. \fP"
.ti -1c
.RI "void \fBsetEncodedPathAndQuery\fP (const  \fBQString\fP &_txt, int encoding_hint=0)"
.br
.RI "\fIThis is useful for HTTP. \fP"
.ti -1c
.RI "void \fBsetEncodedPath\fP (const  \fBQString\fP &_txt, int encoding_hint=0)"
.br
.RI "\fISets the (already encoded) path. \fP"
.ti -1c
.RI "\fBQString\fP \fBencodedPathAndQuery\fP (int _trailing=0, bool _no_empty_path=false, int encoding_hint=0) const "
.br
.RI "\fIReturns the encoded path and the query. \fP"
.ti -1c
.RI "void \fBsetQuery\fP (const  \fBQString\fP &_txt, int encoding_hint=0)"
.br
.ti -1c
.RI "\fBQString\fP \fBquery\fP () const "
.br
.RI "\fIReturns the query of the URL. \fP"
.ti -1c
.RI "\fBQString\fP \fBref\fP () const "
.br
.RI "\fIThe reference is \fInever\fP decoded automatically. \fP"
.ti -1c
.RI "void \fBsetRef\fP (const  \fBQString\fP &_txt)"
.br
.RI "\fISets the reference part (everything after '#'). \fP"
.ti -1c
.RI "bool \fBhasRef\fP () const "
.br
.RI "\fIChecks whether the URL has a reference part. \fP"
.ti -1c
.RI "\fBQString\fP \fBhtmlRef\fP () const "
.br
.RI "\fIReturns the HTML reference (the part of the URL after '#'). \fP"
.ti -1c
.RI "\fBQString\fP \fBencodedHtmlRef\fP () const "
.br
.RI "\fIReturns the HTML reference (the part of the URL after '#') in encoded form. \fP"
.ti -1c
.RI "void \fBsetHTMLRef\fP (const  \fBQString\fP &_ref)"
.br
.RI "\fISets the HTML-style reference. \fP"
.ti -1c
.RI "bool \fBhasHTMLRef\fP () const "
.br
.RI "\fIChecks whether there is a HTML reference. \fP"
.ti -1c
.RI "bool \fBisValid\fP () const "
.br
.RI "\fIChecks whether the URL is well formed. \fP"
.ti -1c
.RI "bool \fBisMalformed\fP () const "
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP \fP"
.ti -1c
.RI "bool \fBisLocalFile\fP () const "
.br
.RI "\fIChecks whether the file is local. \fP"
.ti -1c
.RI "void \fBsetFileEncoding\fP (const  \fBQString\fP &encoding)"
.br
.RI "\fIAdds encoding information to url by adding a 'charset' parameter. \fP"
.ti -1c
.RI "\fBQString\fP \fBfileEncoding\fP () const "
.br
.RI "\fIReturns encoding information from url, the content of the 'charset' parameter. \fP"
.ti -1c
.RI "bool \fBhasSubURL\fP () const "
.br
.RI "\fIChecks whether the URL has any sub URLs. \fP"
.ti -1c
.RI "void \fBaddPath\fP (const  \fBQString\fP &_txt)"
.br
.RI "\fIAdds to the current path. \fP"
.ti -1c
.RI "\fBQString\fP \fBqueryItem\fP (const  \fBQString\fP &_item) const "
.br
.RI "\fIReturns the value of a certain query item. \fP"
.ti -1c
.RI "\fBQMap\fP< \fBQString\fP, \fBQString\fP > \fBqueryItems\fP (int options=0) const "
.br
.RI "\fIReturns the list of query items as a map mapping keys to values. \fP"
.ti -1c
.RI "void \fBaddQueryItem\fP (const  \fBQString\fP &_item, const  \fBQString\fP &_value, int encoding_hint=0)"
.br
.RI "\fIAdd an additional query item. \fP"
.ti -1c
.RI "void \fBremoveQueryItem\fP (const  \fBQString\fP &_item)"
.br
.RI "\fIRemove an item from the query. \fP"
.ti -1c
.RI "void \fBsetFileName\fP (const  \fBQString\fP &_txt)"
.br
.RI "\fISets the filename of the path. \fP"
.ti -1c
.RI "\fBQString\fP \fBfileName\fP (bool _ignore_trailing_slash_in_path=true) const "
.br
.RI "\fIReturns the filename of the path. \fP"
.ti -1c
.RI "\fBQString\fP \fBdirectory\fP (bool _strip_trailing_slash_from_result=true, bool _ignore_trailing_slash_in_path=true) const "
.br
.RI "\fIReturns the directory of the path. \fP"
.ti -1c
.RI "bool \fBcd\fP (const  \fBQString\fP &_dir)"
.br
.RI "\fIChanges the directory by descending into the given directory. \fP"
.ti -1c
.RI "\fBQString\fP \fBurl\fP (int _trailing=0, int encoding_hint=0) const "
.br
.RI "\fIReturns the URL as string. \fP"
.ti -1c
.RI "\fBQString\fP \fBprettyURL\fP (int _trailing=0) const "
.br
.RI "\fIReturns the URL as string in human-friendly format. \fP"
.ti -1c
.RI "\fBQString\fP \fBhtmlURL\fP () const "
.br
.RI "\fIReturns the URL as string, escaped for HTML. \fP"
.ti -1c
.RI "\fBQString\fP \fBprettyURL\fP (int _trailing, AdjustementFlags _flags) const "
.br
.RI "\fIReturns the URL as string, escaped for HTML. \fP"
.ti -1c
.RI "bool \fBisEmpty\fP () const "
.br
.RI "\fITest to see if the KURL is empty. \fP"
.ti -1c
.RI "\fBKURL\fP \fBupURL\fP () const "
.br
.RI "\fIThis function is useful to implement the 'Up' button in a file manager for example. \fP"
.ti -1c
.RI "\fBKURL\fP & \fBoperator=\fP (const  \fBKURL\fP &_u)"
.br
.ti -1c
.RI "\fBKURL\fP & \fBoperator=\fP (const  \fBQString\fP &_url)"
.br
.ti -1c
.RI "\fBKURL\fP & \fBoperator=\fP (const  char *_url)"
.br
.ti -1c
.RI "\fBKURL\fP & \fBoperator=\fP (const  \fBQUrl\fP &u)"
.br
.ti -1c
.RI "bool \fBoperator==\fP (const  \fBKURL\fP &_u) const "
.br
.ti -1c
.RI "bool \fBoperator==\fP (const  \fBQString\fP &_u) const "
.br
.ti -1c
.RI "bool \fBoperator!=\fP (const  \fBKURL\fP &_u) const "
.br
.ti -1c
.RI "bool \fBoperator!=\fP (const  \fBQString\fP &_u) const "
.br
.ti -1c
.RI "bool \fBcmp\fP (const  \fBKURL\fP &u, bool ignore_trailing=false) const "
.br
.RI "\fIThe same as \fBequals()\fP, just with a less obvious name. \fP"
.ti -1c
.RI "bool \fBequals\fP (const  \fBKURL\fP &u, bool ignore_trailing=false) const "
.br
.RI "\fICompares this url with \fCu\fP. \fP"
.ti -1c
.RI "bool \fBisParentOf\fP (const  \fBKURL\fP &u) const "
.br
.RI "\fIChecks whether the given URL is parent of this URL. \fP"
.ti -1c
.RI "\fBQString\fP \fBfilename\fP (bool _ignore_trailing_slash_in_path=true) const "
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "\fBList\fP \fBsplit\fP (const  \fBQString\fP &_url)"
.br
.RI "\fISplits nested URLs like file:/home/weis/kde.tgz#gzip:/#tar:/kdebase A URL like http://www.kde.org#tar:/kde/README.hml#ref1 will be split in http://www.kde.org and tar:/kde/README.html#ref1. \fP"
.ti -1c
.RI "\fBList\fP \fBsplit\fP (const  \fBKURL\fP &_url)"
.br
.RI "\fISplits nested URLs like file:/home/weis/kde.tgz#gzip:/#tar:/kdebase A URL like http://www.kde.org#tar:/kde/README.hml#ref1 will be split in http://www.kde.org and tar:/kde/README.html#ref1. \fP"
.ti -1c
.RI "\fBKURL\fP \fBjoin\fP (const  \fBList\fP &_list)"
.br
.RI "\fIReverses \fBsplit\fP(). \fP"
.ti -1c
.RI "\fBKURL\fP \fBfromPathOrURL\fP (const  \fBQString\fP &text)"
.br
.RI "\fICreates a KURL object from a \fBQString\fP representing either an absolute path or a real URL. \fP"
.ti -1c
.RI "\fBQString\fP \fBencode_string\fP (const  \fBQString\fP &str, int encoding_hint=0)"
.br
.RI "\fIConvenience function. \fP"
.ti -1c
.RI "\fBQString\fP \fBencode_string_no_slash\fP (const  \fBQString\fP &str, int encoding_hint=0)"
.br
.RI "\fIConvenience function. \fP"
.ti -1c
.RI "\fBQString\fP \fBdecode_string\fP (const  \fBQString\fP &str, int encoding_hint=0)"
.br
.RI "\fIConvenience function. \fP"
.ti -1c
.RI "bool \fBisRelativeURL\fP (const  \fBQString\fP &_url)"
.br
.RI "\fIConvenience function. \fP"
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "void \fBreset\fP ()"
.br
.ti -1c
.RI "void \fBparse\fP (const  \fBQString\fP &_url, int encoding_hint=0)"
.br
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "\fBQDataStream\fP & \fBoperator<<\fP (\fBQDataStream\fP &s, const  \fBKURL\fP &a)"
.br
.ti -1c
.RI "\fBQDataStream\fP & \fBoperator>>\fP (\fBQDataStream\fP &s, \fBKURL\fP &a)"
.br
.in -1c
.SH "Detailed Description"
.PP 
Represents and parses a URL. 

A prototypical URL looks like: 
.PP
.nf

   protocol:/user:password:port/path/to/file.ext#reference
 
.PP
.PP
KURL has some restrictions regarding the path encoding. KURL works internally with the decoded path and and encoded query. For example, 
.PP
.nf

 http://localhost/cgi-bin/test%20me.pl?cmd=Hello%20you
 
.PP
 would result in a decoded path '/cgi-bin/test me.pl' and in the encoded query '?cmd=Hello%20you'. Since path is internally always encoded you may \fInot\fP use '%00' in the path, although this is OK for the query.
.PP
\fBAuthor:\fP
.RS 4
Torben Weis <weis@kde.org> 
.RE
.PP

.PP
Definition at line 52 of file kurl.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "enum \fBKURL::QueryItemsOptions\fP"
.PP
Options for \fBqueryItems\fP. Currently, only one option is defined:
.PP
\fBParameters:\fP
.RS 4
\fICaseInsensitiveKeys\fP normalize query keys to lowercase.
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 486 of file kurl.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KURL::KURL ()"
.PP
Constructs an empty URL. Definition at line 400 of file kurl.cpp.
.PP
Referenced by fromPathOrURL(), join(), KURL::List::List(), split(), and upURL().
.SS "KURL::~\fBKURL\fP ()"
.PP
Destructs the KURL object. Definition at line 405 of file kurl.cpp.
.SS "KURL::KURL (const \fBQString\fP & url, int encoding_hint = 0)"
.PP
Usual constructor, to construct from a string. \fBParameters:\fP
.RS 4
\fIurl\fP A URL, not a filename. If the URL does not have a protocol part, 'file:' is assumed. It is dangerous to feed unix filenames into this function, this will work most of the time but not always. For example '/home/Torben%20Weis' will be considered a URL pointing to the file '/home/Torben Weis' instead of to the file '/home/Torben%20Weis'. This means that if you have a usual UNIX like path you should not use this constructor. Instead create an empty url and set the path by using \fBsetPath\fP(). 
.br
\fIencoding_hint\fP MIB of original encoding of URL. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBQTextCodec::mibEnum()\fP 
.RE
.PP
Definition at line 410 of file kurl.cpp.
.SS "KURL::KURL (const char * url, int encoding_hint = 0)"
.PP
Constructor taking a char * \fCurl\fP, which is an _encoded_ representation of the URL, exactly like the usual constructor. This is useful when then URL, in its encoded form, is strictly ascii. 
.PP
\fBParameters:\fP
.RS 4
\fIurl\fP A encoded URL. If the URL does not have a protocol part, 'file:' is assumed. 
.br
\fIencoding_hint\fP MIB of original encoding of URL. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBQTextCodec::mibEnum()\fP 
.RE
.PP
Definition at line 416 of file kurl.cpp.
.PP
References QString::fromLatin1().
.SS "KURL::KURL (const \fBQCString\fP & url, int encoding_hint = 0)"
.PP
Constructor taking a \fBQCString\fP \fCurl\fP, which is an _encoded_ representation of the URL, exactly like the usual constructor. This is useful when then URL, in its encoded form, is strictly ascii. 
.PP
\fBParameters:\fP
.RS 4
\fIurl\fP A encoded URL. If the URL does not have a protocol part, 'file:' is assumed. 
.br
\fIencoding_hint\fP MIB of original encoding of URL. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBQTextCodec::mibEnum()\fP 
.RE
.PP
Definition at line 422 of file kurl.cpp.
.PP
References QString::fromLatin1().
.SS "KURL::KURL (const \fBKURL\fP & u)"
.PP
Copy constructor. \fBParameters:\fP
.RS 4
\fIu\fP the KURL to copy 
.RE
.PP
Definition at line 428 of file kurl.cpp.
.SS "KURL::KURL (const \fBQUrl\fP & u)"
.PP
Converts from a \fBQUrl\fP. \fBParameters:\fP
.RS 4
\fIu\fP the \fBQUrl\fP 
.RE
.PP
Definition at line 463 of file kurl.cpp.
.SS "KURL::KURL (const \fBKURL\fP & _baseurl, const \fBQString\fP & _rel_url, int encoding_hint = 0)"
.PP
Constructor allowing relative URLs. \fBParameters:\fP
.RS 4
\fI_baseurl\fP The base url. 
.br
\fI_rel_url\fP A relative or absolute URL. If this is an absolute URL then \fC_baseurl\fP will be ignored. If this is a relative URL it will be combined with \fC_baseurl\fP. Note that _rel_url should be encoded too, in any case. So do NOT pass a path here (use setPath or addPath instead). 
.br
\fIencoding_hint\fP MIB of original encoding of URL. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBQTextCodec::mibEnum()\fP 
.RE
.PP
Definition at line 469 of file kurl.cpp.
.PP
References cleanPath(), QString::find(), QString::findRev(), QString::isEmpty(), QString::isNull(), isRelativeURL(), QString::length(), m_strHost, m_strPass, m_strProtocol, m_strUser, ref(), setHTMLRef(), QString::truncate(), and url().
.SH "Member Function Documentation"
.PP 
.SS "\fBQString\fP KURL::protocol () const\fC [inline]\fP"
.PP
Returns the protocol for the URL (i.e., file, http, etc.). \fBReturns:\fP
.RS 4
the protocol of the URL, does not include the colon. If the URL is malformed, QString::null will be returned. 
.RE
.PP
Definition at line 168 of file kurl.h.
.SS "void KURL::setProtocol (const \fBQString\fP & _txt)"
.PP
Sets the protocol for the URL (i.e., file, http, etc.). \fBParameters:\fP
.RS 4
\fI_txt\fP the new protocol of the URL (without colon) 
.RE
.PP
Definition at line 1643 of file kurl.cpp.
.SS "\fBQString\fP KURL::user () const\fC [inline]\fP"
.PP
Returns the decoded user name (login, user id, ...) included in the URL. \fBReturns:\fP
.RS 4
the user name or QString::null if there is no user name 
.RE
.PP
Definition at line 179 of file kurl.h.
.SS "void KURL::setUser (const \fBQString\fP & _txt)"
.PP
Sets the user name (login, user id, ...) included in the URL. Special characters in the user name will appear encoded in the URL. 
.PP
\fBParameters:\fP
.RS 4
\fI_txt\fP the name of the user or QString::null to remove the user 
.RE
.PP
Definition at line 1650 of file kurl.cpp.
.SS "bool KURL::hasUser () const\fC [inline]\fP"
.PP
Test to see if this URL has a user name included in it. \fBReturns:\fP
.RS 4
true if the URL has an non-empty user name 
.RE
.PP
Definition at line 191 of file kurl.h.
.PP
References QString::isEmpty().
.PP
Referenced by prettyURL(), and url().
.SS "\fBQString\fP KURL::pass () const\fC [inline]\fP"
.PP
Returns the decoded password (corresponding to \fBuser\fP()) included in the URL. \fBReturns:\fP
.RS 4
the password or QString::null if it does not exist 
.RE
.PP
Definition at line 197 of file kurl.h.
.SS "void KURL::setPass (const \fBQString\fP & _txt)"
.PP
Sets the password (corresponding to \fBuser\fP()) included in the URL. Special characters in the password will appear encoded in the URL. Note that a password can only appear in a URL string if you also set a user. 
.PP
\fBParameters:\fP
.RS 4
\fI_txt\fP the password to set or QString::null to remove the password 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetUser\fP 
.PP
\fBhasUser\fP 
.RE
.PP
Definition at line 1656 of file kurl.cpp.
.SS "bool KURL::hasPass () const\fC [inline]\fP"
.PP
Test to see if this URL has a password included in it. \fBReturns:\fP
.RS 4
true if there is a non-empty password set 
.RE
.PP
Definition at line 213 of file kurl.h.
.PP
References QString::isEmpty().
.PP
Referenced by url().
.SS "\fBQString\fP KURL::host () const\fC [inline]\fP"
.PP
Returns the decoded hostname included in the URL. \fBReturns:\fP
.RS 4
the name of the host or QString::null if no host is set 
.RE
.PP
Definition at line 219 of file kurl.h.
.SS "void KURL::setHost (const \fBQString\fP & _txt)"
.PP
Sets the hostname included in the URL. Special characters in the hostname will appear encoded in the URL. 
.PP
\fBParameters:\fP
.RS 4
\fI_txt\fP the new name of the host or QString::null to remove the host 
.RE
.PP
Definition at line 1662 of file kurl.cpp.
.SS "bool KURL::hasHost () const\fC [inline]\fP"
.PP
Test to see if this URL has a hostname included in it. \fBReturns:\fP
.RS 4
true if the URL has a host 
.RE
.PP
Definition at line 231 of file kurl.h.
.PP
References QString::isEmpty().
.PP
Referenced by prettyURL(), and url().
.SS "unsigned short int KURL::port () const\fC [inline]\fP"
.PP
Returns the port number included in the URL. \fBReturns:\fP
.RS 4
the port number. If there is no port number specified in the URL, returns 0. 
.RE
.PP
Definition at line 238 of file kurl.h.
.SS "void KURL::setPort (unsigned short int _p)"
.PP
Sets the port number included in the URL. \fBParameters:\fP
.RS 4
\fI_p\fP the new port number or 0 to have no port number 
.RE
.PP
Definition at line 1668 of file kurl.cpp.
.SS "\fBQString\fP KURL::path () const\fC [inline]\fP"
.PP
Returns the current decoded path. This does \fInot\fP include the query. 
.PP
\fBReturns:\fP
.RS 4
the path of the URL (without query), or QString::null if no path set. 
.RE
.PP
Definition at line 250 of file kurl.h.
.PP
Referenced by KApplication::authorizeURLAction(), cd(), encodedPathAndQuery(), equals(), fileName(), KApplication::invokeMailer(), isParentOf(), path(), setFileName(), and upURL().
.SS "\fBQString\fP KURL::path (int _trailing) const"
.PP
\fBParameters:\fP
.RS 4
\fI_trailing\fP May be ( -1, 0 +1 ). -1 strips a trailing '/', +1 adds a trailing '/' if there is none yet and 0 returns the path unchanged. If the URL has no path, then no '/' is added anyway. And on the other side: If the path is '/', then this character won't be stripped. Reason: 'ftp://weis@host' means something completely different than 'ftp://weis@host/'. So adding or stripping the '/' would really alter the URL, while 'ftp://host/path' and 'ftp://host/path/' mean the same directory.
.RE
.PP
\fBReturns:\fP
.RS 4
The current decoded path. This does not include the query. Can be QString::null if no path is set. 
.RE
.PP
Definition at line 1137 of file kurl.cpp.
.PP
References path().
.SS "void KURL::setPath (const \fBQString\fP & path)"
.PP
Sets the path of the URL. The query is not changed by this function.
.PP
\fBParameters:\fP
.RS 4
\fIpath\fP The new path. This is considered to be decoded. This means: 3f does not become decoded and the ? does not indicate the start of the query part. Can be QString::null to delete the path. 
.RE
.PP
Definition at line 1673 of file kurl.cpp.
.PP
References QString::isEmpty(), and isEmpty().
.PP
Referenced by KApplication::authorizeURLAction(), cd(), fromPathOrURL(), KCmdLineArgs::makeURL(), KConfigINIBackEnd::parseConfigFiles(), KDesktopFile::readURL(), setFileName(), and KConfigINIBackEnd::sync().
.SS "bool KURL::hasPath () const\fC [inline]\fP"
.PP
Test to see if this URL has a path is included in it. \fBReturns:\fP
.RS 4
true if there is a path 
.RE
.PP
Definition at line 281 of file kurl.h.
.PP
References QString::isEmpty().
.SS "void KURL::cleanPath (bool cleanDirSeparator = true)"
.PP
Resolves '.' and '..' components in path. Some servers seem not to like the removal of extra '/' even though it is against the specification in RFC 2396.
.PP
\fBParameters:\fP
.RS 4
\fIcleanDirSeparator\fP if true, occurrances of consecutive directory separators (e.g. /foo//bar) are cleaned up as well. 
.RE
.PP
Definition at line 1038 of file kurl.cpp.
.PP
Referenced by KURL(), KCmdLineArgs::makeURL(), and setFileName().
.SS "void KURL::adjustPath (int _trailing)"
.PP
Add or remove a trailing slash to/from the path. \fBParameters:\fP
.RS 4
\fI_trailing\fP May be ( -1, 0 +1 ). -1 strips a trailing '/', +1 adds a trailing '/' if there is none yet and 0 returns the path unchanged. If the URL has no path, then no '/' is added anyway. And on the other side: If the path is '/', then this character won't be stripped. Reason: 'ftp://weis@host' means something completely different than 'ftp://weis@host/'. So adding or stripping the '/' would really alter the URL, while 'ftp://host/path' and 'ftp://host/path/' mean the same directory. 
.RE
.PP
Definition at line 1075 of file kurl.cpp.
.PP
References QString::isEmpty().
.SS "void KURL::setEncodedPathAndQuery (const \fBQString\fP & _txt, int encoding_hint = 0)"
.PP
This is useful for HTTP. It looks first for '?' and decodes then. The encoded path is the concatenation of the current path and the query. 
.PP
\fBParameters:\fP
.RS 4
\fI_txt\fP the new path and query. 
.br
\fIencoding_hint\fP MIB of original encoding of \fC_txt\fP . 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBQTextCodec::mibEnum()\fP 
.RE
.PP
Definition at line 1122 of file kurl.cpp.
.PP
References QString::find(), QString::left(), QString::length(), QString::right(), setEncodedPath(), and setQuery().
.SS "void KURL::setEncodedPath (const \fBQString\fP & _txt, int encoding_hint = 0)"
.PP
Sets the (already encoded) path. \fBParameters:\fP
.RS 4
\fI_txt\fP the new path 
.br
\fIencoding_hint\fP MIB of original encoding of \fC_txt\fP . 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBQTextCodec::mibEnum()\fP 
.RE
.PP
Definition at line 1106 of file kurl.cpp.
.PP
References KGlobal::staticQString().
.PP
Referenced by setEncodedPathAndQuery(), and setFileName().
.SS "\fBQString\fP KURL::encodedPathAndQuery (int _trailing = 0, bool _no_empty_path = false, int encoding_hint = 0) const"
.PP
Returns the encoded path and the query. \fBParameters:\fP
.RS 4
\fI_trailing\fP May be ( -1, 0 +1 ). -1 strips a trailing '/', +1 adds a trailing '/' if there is none yet and 0 returns the path unchanged. If the URL has no path, then no '/' is added anyway. And on the other side: If the path is '/', then this character won't be stripped. Reason: 'ftp://weis@host' means something completely different than 'ftp://weis@host/'. So adding or stripping the '/' would really alter the URL, while 'ftp://host/path' and 'ftp://host/path/' mean the same directory. 
.br
\fI_no_empty_path\fP If set to true then an empty path is substituted by '/'. 
.br
\fIencoding_hint\fP MIB of desired encoding of URL. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBQTextCodec::mibEnum()\fP 
.RE
.PP
\fBReturns:\fP
.RS 4
The concatenation if the encoded path , '?' and the encoded query. 
.RE
.PP
Definition at line 1085 of file kurl.cpp.
.PP
References QString::isEmpty(), QString::isNull(), and path().
.PP
Referenced by url().
.SS "void KURL::setQuery (const \fBQString\fP & _txt, int encoding_hint = 0)"
.PP
\fBParameters:\fP
.RS 4
\fI_txt\fP This is considered to be encoded. This has a good reason: The query may contain the 0 character.
.RE
.PP
The query should start with a '?'. If it doesn't '?' is prepended. 
.PP
\fBParameters:\fP
.RS 4
\fIencoding_hint\fP Reserved, should be 0. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBQTextCodec::mibEnum()\fP 
.RE
.PP
Definition at line 1683 of file kurl.cpp.
.PP
References QString::latin1(), QString::length(), and QString::mid().
.PP
Referenced by setEncodedPathAndQuery(), setFileEncoding(), and upURL().
.SS "\fBQString\fP KURL::query () const"
.PP
Returns the query of the URL. The query may contain the 0 character. If a query is present it always starts with a '?'. A single '?' means an empty query. An empty string means no query. 
.PP
\fBReturns:\fP
.RS 4
The encoded query, or QString::null if there is none. 
.RE
.PP
Definition at line 1727 of file kurl.cpp.
.PP
References QString::isNull().
.PP
Referenced by fileEncoding(), KApplication::invokeMailer(), setFileEncoding(), and upURL().
.SS "\fBQString\fP KURL::ref () const\fC [inline]\fP"
.PP
The reference is \fInever\fP decoded automatically. \fBReturns:\fP
.RS 4
the undecoded reference, or QString::null if there is none 
.RE
.PP
Definition at line 366 of file kurl.h.
.PP
Referenced by encodedHtmlRef(), htmlRef(), KURL(), and split().
.SS "void KURL::setRef (const \fBQString\fP & _txt)\fC [inline]\fP"
.PP
Sets the reference part (everything after '#'). \fBParameters:\fP
.RS 4
\fI_txt\fP The encoded reference (or QString::null to remove it). 
.RE
.PP
Definition at line 372 of file kurl.h.
.SS "bool KURL::hasRef () const\fC [inline]\fP"
.PP
Checks whether the URL has a reference part. \fBReturns:\fP
.RS 4
true if the URL has a reference part. In a URL like http://www.kde.org/kdebase.tar#tar:/README it would return true, too. 
.RE
.PP
Definition at line 380 of file kurl.h.
.PP
References QString::isNull().
.PP
Referenced by hasHTMLRef(), prettyURL(), and url().
.SS "\fBQString\fP KURL::htmlRef () const"
.PP
Returns the HTML reference (the part of the URL after '#'). \fBReturns:\fP
.RS 4
The HTML-style reference. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsplit\fP 
.PP
\fBhasSubURL\fP 
.PP
\fBencodedHtmlRef\fP 
.RE
.PP
Definition at line 1594 of file kurl.cpp.
.PP
References QValueList< KURL >::begin(), hasSubURL(), ref(), and split().
.SS "\fBQString\fP KURL::encodedHtmlRef () const"
.PP
Returns the HTML reference (the part of the URL after '#') in encoded form. \fBReturns:\fP
.RS 4
The HTML-style reference in its original form. 
.RE
.PP
Definition at line 1605 of file kurl.cpp.
.PP
References QValueList< KURL >::begin(), hasSubURL(), ref(), and split().
.SS "void KURL::setHTMLRef (const \fBQString\fP & _ref)"
.PP
Sets the HTML-style reference. \fBParameters:\fP
.RS 4
\fI_ref\fP The new reference. This is considered to be \fInot\fP encoded in contrast to \fBsetRef\fP(). Use QString::null to remove it. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBhtmlRef()\fP 
.RE
.PP
Definition at line 1616 of file kurl.cpp.
.PP
References QValueList< KURL >::begin(), hasSubURL(), join(), and split().
.PP
Referenced by cd(), and KURL().
.SS "bool KURL::hasHTMLRef () const"
.PP
Checks whether there is a HTML reference. \fBReturns:\fP
.RS 4
true if the URL has an HTML-style reference. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBhtmlRef()\fP 
.RE
.PP
Definition at line 1631 of file kurl.cpp.
.PP
References QValueList< KURL >::begin(), hasRef(), hasSubURL(), and split().
.SS "bool KURL::isValid () const\fC [inline]\fP"
.PP
Checks whether the URL is well formed. \fBReturns:\fP
.RS 4
false if the URL is malformed. This function does \fInot\fP test whether sub URLs are well-formed, too. 
.RE
.PP
Definition at line 419 of file kurl.h.
.PP
Referenced by isMalformed().
.SS "bool KURL::isMalformed () const\fC [inline]\fP"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP Definition at line 423 of file kurl.h.
.PP
References isValid().
.PP
Referenced by equals(), and isParentOf().
.SS "bool KURL::isLocalFile () const"
.PP
Checks whether the file is local. \fBReturns:\fP
.RS 4
true if the file is a plain local file and has no filter protocols attached to it. 
.RE
.PP
Definition at line 1142 of file kurl.cpp.
.PP
References hasSubURL(), QString::isEmpty(), and KGlobal::staticQString().
.PP
Referenced by fileEncoding(), and setFileEncoding().
.SS "void KURL::setFileEncoding (const \fBQString\fP & encoding)"
.PP
Adds encoding information to url by adding a 'charset' parameter. If there is already a charset parameter, it will be replaced. 
.PP
\fBParameters:\fP
.RS 4
\fIencoding\fP the encoding to add or QString::null to remove the encoding. 
.RE
.PP
Definition at line 1152 of file kurl.cpp.
.PP
References decode_string(), encode_string(), QString::isEmpty(), isLocalFile(), QStringList::join(), QString::mid(), query(), setQuery(), QStringList::split(), and QString::startsWith().
.SS "\fBQString\fP KURL::fileEncoding () const"
.PP
Returns encoding information from url, the content of the 'charset' parameter. \fBReturns:\fP
.RS 4
An encoding suitable for \fBQTextCodec::codecForName()\fP or QString::null if not encoding was specified. 
.RE
.PP
Definition at line 1181 of file kurl.cpp.
.PP
References decode_string(), QString::isEmpty(), isLocalFile(), QString::mid(), query(), QStringList::split(), and QString::startsWith().
.SS "bool KURL::hasSubURL () const"
.PP
Checks whether the URL has any sub URLs. See \fBsplit\fP() for examples for sub URLs. 
.PP
\fBReturns:\fP
.RS 4
true if the file has at least one sub URL. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsplit\fP 
.RE
.PP
Definition at line 1206 of file kurl.cpp.
.PP
References QString::isEmpty(), and QString::startsWith().
.PP
Referenced by cd(), encodedHtmlRef(), hasHTMLRef(), htmlRef(), isLocalFile(), setHTMLRef(), split(), and upURL().
.SS "void KURL::addPath (const \fBQString\fP & _txt)"
.PP
Adds to the current path. Assumes that the current path is a directory. \fC_txt\fP is appended to the current path. The function adds '/' if needed while concatenating. This means it does not matter whether the current path has a trailing '/' or not. If there is none, it becomes appended. If \fC_txt\fP has a leading '/' then this one is stripped.
.PP
\fBParameters:\fP
.RS 4
\fI_txt\fP The text to add. It is considered to be decoded. 
.RE
.PP
Definition at line 1446 of file kurl.cpp.
.PP
References QString::isEmpty(), QString::length(), and QString::mid().
.SS "\fBQString\fP KURL::queryItem (const \fBQString\fP & _item) const"
.PP
Returns the value of a certain query item. \fBParameters:\fP
.RS 4
\fI_item\fP Item whose value we want
.RE
.PP
\fBReturns:\fP
.RS 4
the value of the given query item name or QString::null if the specified item does not exist. 
.RE
.PP
Definition at line 1834 of file kurl.cpp.
.PP
References decode_string(), QString::fromLatin1(), QString::length(), QString::replace(), and QStringList::split().
.SS "\fBQMap\fP< \fBQString\fP, \fBQString\fP > KURL::queryItems (int options = 0) const"
.PP
Returns the list of query items as a map mapping keys to values. \fBParameters:\fP
.RS 4
\fIoptions\fP any of \fBQueryItemsOptions\fP \fIored together.\fP
.RE
.PP
\fBReturns:\fP
.RS 4
\fI the map of query items or the empty map if the url has no query items.\fP
.RE
.PP
\fBSince:\fP
.RS 4
\fI 3.1 \fP
.RE
.PP
Definition at line 1803 of file kurl.cpp.
.PP
References decode_string(), QString::fromLatin1(), QMap< QString, QString >::insert(), QString::isEmpty(), KStdAction::name(), QString::replace(), and QStringList::split().
.SS "void KURL::addQueryItem (const \fBQString\fP & _item, const \fBQString\fP & _value, int encoding_hint = 0)"
.PP
Add an additional query item. To replace an existing query item, the item should first be removed with \fBremoveQueryItem\fP()
.PP
\fBParameters:\fP
.RS 4
\fI_item\fP Name of item to add 
.br
\fI_value\fP Value of item to add 
.br
\fIencoding_hint\fP MIB of encoding to use for _value. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBQTextCodec::mibEnum()\fP 
.RE
.PP
Definition at line 1883 of file kurl.cpp.
.PP
References QString::isEmpty().
.SS "void KURL::removeQueryItem (const \fBQString\fP & _item)"
.PP
Remove an item from the query. \fBParameters:\fP
.RS 4
\fI_item\fP Item to be removed 
.RE
.PP
Definition at line 1860 of file kurl.cpp.
.PP
References QStringList::join(), QString::length(), and QStringList::split().
.SS "void KURL::setFileName (const \fBQString\fP & _txt)"
.PP
Sets the filename of the path. In comparison to \fBaddPath\fP() this function does not assume that the current path is a directory. This is only assumed if the current path ends with '/'.
.PP
Any reference is reset.
.PP
\fBParameters:\fP
.RS 4
\fI_txt\fP The filename to be set. It is considered to be decoded. If the current path ends with '/' then \fC_txt\fP int just appended, otherwise all text behind the last '/' in the current path is erased and \fC_txt\fP is appended then. It does not matter whether \fC_txt\fP starts with '/' or not. 
.RE
.PP
Definition at line 999 of file kurl.cpp.
.PP
References cleanPath(), encode_string(), QString::findRev(), QString::isEmpty(), QString::mid(), path(), QString::right(), setEncodedPath(), setPath(), and QString::truncate().
.SS "\fBQString\fP KURL::fileName (bool _ignore_trailing_slash_in_path = true) const"
.PP
Returns the filename of the path. \fBParameters:\fP
.RS 4
\fI_ignore_trailing_slash_in_path\fP This tells whether a trailing '/' should be ignored. This means that the function would return 'torben' for \fCfile:/hallo/torben/\fP and \fCfile:/hallo/torben\fP. If the flag is set to false, then everything behind the last '/' is considered to be the filename. 
.RE
.PP
\fBReturns:\fP
.RS 4
The filename of the current path. The returned string is decoded. Null if there is no file (and thus no path). 
.RE
.PP
Definition at line 1392 of file kurl.cpp.
.PP
References QString::contains(), QString::findRev(), QString::isEmpty(), QString::left(), QString::length(), QString::mid(), and path().
.SS "\fBQString\fP KURL::directory (bool _strip_trailing_slash_from_result = true, bool _ignore_trailing_slash_in_path = true) const"
.PP
Returns the directory of the path. \fBParameters:\fP
.RS 4
\fI_strip_trailing_slash_from_result\fP tells whether the returned result should end with '/' or not. If the path is empty or just '/' then this flag has no effect. 
.br
\fI_ignore_trailing_slash_in_path\fP means that \fCfile:/hallo/torben\fP and \fCfile:/hallo/torben/'\fP would both return \fC/hallo/\fP or \fC/hallo\fP depending on the other flag 
.RE
.PP
\fBReturns:\fP
.RS 4
The directory part of the current path. Everything between the last and the second last '/' is returned. For example \fCfile:/hallo/torben/\fP would return '/hallo/torben/' while \fCfile:/hallo/torben\fP would return 'hallo/'. The returned string is decoded. QString::null is returned when there is no path. 
.RE
.PP
Definition at line 1474 of file kurl.cpp.
.PP
References QString::findRev(), QString::isEmpty(), and QString::left().
.PP
Referenced by KConfigINIBackEnd::parseConfigFiles(), and KConfigINIBackEnd::sync().
.SS "bool KURL::cd (const \fBQString\fP & _dir)"
.PP
Changes the directory by descending into the given directory. It is assumed the current URL represents a directory. If \fCdir\fP starts with a '/' the current URL will be 'protocol://host/dir' otherwise \fC_dir\fP will be appended to the path. \fC_dir\fP can be '..' This function won't strip protocols. That means that when you are in file:/dir/dir2/my.tgz#tar:/ and you do cd('..') you will still be in file:/dir/dir2/my.tgz#tar:/
.PP
\fBParameters:\fP
.RS 4
\fI_dir\fP the directory to change to 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful 
.RE
.PP
Definition at line 1508 of file kurl.cpp.
.PP
References hasSubURL(), QDir::homeDirPath(), QString::isEmpty(), join(), QValueList< KURL >::last(), QString::length(), path(), QString::right(), setHTMLRef(), setPath(), and split().
.PP
Referenced by upURL().
.SS "\fBQString\fP KURL::url (int _trailing = 0, int encoding_hint = 0) const"
.PP
Returns the URL as string. \fBReturns:\fP
.RS 4
The complete URL, with all escape sequences intact, encoded in a given charset. This is used in particular for encoding URLs in UTF-8 before using them in a drag and drop operation.
.RE
.PP
\fBParameters:\fP
.RS 4
\fI_trailing\fP This may be ( -1, 0 +1 ). -1 strips a trailing '/' from the path, +1 adds a trailing '/' if there is none yet and 0 returns the path unchanged. 
.br
\fIencoding_hint\fP MIB of encoding to use. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBQTextCodec::mibEnum()\fP 
.RE
.PP
Definition at line 1225 of file kurl.cpp.
.PP
References encodedPathAndQuery(), QString::find(), hasHost(), hasPass(), hasRef(), hasUser(), QString::isEmpty(), and QString::sprintf().
.PP
Referenced by fromPathOrURL(), join(), KURL(), KDesktopFile::readURL(), and split().
.SS "\fBQString\fP KURL::prettyURL (int _trailing = 0) const"
.PP
Returns the URL as string in human-friendly format. Example: http://localhost:8080/test.cgi?test=hello world&name=fred 
.PP
\fBReturns:\fP
.RS 4
A human readable URL, with no non-necessary encodings/escaped characters. Password will not be shown. 
.RE
.PP
Definition at line 1275 of file kurl.cpp.
.PP
References QString::find(), hasHost(), hasRef(), hasUser(), QString::isEmpty(), QString::isNull(), and QString::sprintf().
.PP
Referenced by htmlURL(), and prettyURL().
.SS "\fBQString\fP KURL::htmlURL () const"
.PP
Returns the URL as string, escaped for HTML. \fBReturns:\fP
.RS 4
A human readable URL, with no non-necessary encodings/escaped characters which is html encoded for safe inclusion in html or rich text. Password will not be shown. 
.RE
.PP
Definition at line 1331 of file kurl.cpp.
.PP
References QStyleSheet::escape(), and prettyURL().
.SS "\fBQString\fP KURL::prettyURL (int _trailing, AdjustementFlags _flags) const"
.PP
Returns the URL as string, escaped for HTML. Example: http://localhost:8080/test.cgi?test=hello world&name=fred 
.PP
\fBReturns:\fP
.RS 4
A human readable URL, with no non-necessary encodings/escaped characters. Password will not be shown. 
.RE
.PP
Definition at line 1323 of file kurl.cpp.
.PP
References prettyURL(), QString::remove(), and QString::startsWith().
.SS "bool KURL::isEmpty () const"
.PP
Test to see if the KURL is empty. \fBReturns:\fP
.RS 4
true if the URL is empty 
.RE
.PP
Definition at line 561 of file kurl.cpp.
.PP
References QString::isEmpty().
.PP
Referenced by KApplication::authorizeURLAction(), and setPath().
.SS "\fBKURL\fP KURL::upURL () const"
.PP
This function is useful to implement the 'Up' button in a file manager for example. \fBcd\fP() never strips a sub-protocol. That means that if you are in file:/home/x.tgz#gzip:/#tar:/ and hit the up button you expect to see file:/home. The algorithm tries to go up on the right-most URL. If that is not possible it strips the right most URL. It continues stripping URLs. 
.PP
\fBReturns:\fP
.RS 4
a URL that is a level higher 
.RE
.PP
Definition at line 1560 of file kurl.cpp.
.PP
References cd(), QValueList< KURL >::count(), QValueList< KURL >::fromLast(), hasSubURL(), QValueList< KURL >::isEmpty(), QString::isEmpty(), join(), KURL(), QValueList< KURL >::last(), path(), query(), QValueList< KURL >::remove(), setQuery(), and split().
.SS "bool KURL::cmp (const \fBKURL\fP & u, bool ignore_trailing = false) const"
.PP
The same as \fBequals()\fP, just with a less obvious name. Compares this url with \fCu\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIignore_trailing\fP set to true to ignore trailing '/' characters. 
.RE
.PP
\fBReturns:\fP
.RS 4
true if both urls are the same 
.RE
.PP
\fBSee also:\fP
.RS 4
operator==. This function should be used if you want to ignore trailing '/' characters. \fBThis class or method is obsolete, it is provided for compatibility only.\fP 
.RE
.PP
Definition at line 935 of file kurl.cpp.
.PP
References equals().
.SS "bool KURL::equals (const \fBKURL\fP & u, bool ignore_trailing = false) const"
.PP
Compares this url with \fCu\fP. \fBParameters:\fP
.RS 4
\fIignore_trailing\fP set to true to ignore trailing '/' characters. 
.RE
.PP
\fBReturns:\fP
.RS 4
true if both urls are the same 
.RE
.PP
\fBSee also:\fP
.RS 4
operator==. This function should be used if you want to ignore trailing '/' characters. 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 940 of file kurl.cpp.
.PP
References isMalformed(), m_iPort, m_strHost, m_strPass, m_strProtocol, m_strQuery_encoded, m_strRef_encoded, m_strUser, and path().
.PP
Referenced by cmp().
.SS "bool KURL::isParentOf (const \fBKURL\fP & u) const"
.PP
Checks whether the given URL is parent of this URL. For instance, ftp://host/dir/ is a parent of ftp://host/dir/subdir/subsubdir/. 
.PP
\fBReturns:\fP
.RS 4
true if this url is a parent of \fCu\fP (or the same URL as \fCu\fP) 
.RE
.PP
Definition at line 967 of file kurl.cpp.
.PP
References QString::isEmpty(), isMalformed(), QString::length(), m_iPort, m_strHost, m_strPass, m_strProtocol, m_strQuery_encoded, m_strRef_encoded, m_strUser, path(), and QString::startsWith().
.SS "\fBKURL::List\fP KURL::split (const \fBQString\fP & _url)\fC [static]\fP"
.PP
Splits nested URLs like file:/home/weis/kde.tgz#gzip:/#tar:/kdebase A URL like http://www.kde.org#tar:/kde/README.hml#ref1 will be split in http://www.kde.org and tar:/kde/README.html#ref1. That means in turn that '#ref1' is an HTML-style reference and not a new sub URL. Since HTML-style references mark a certain position in a document this reference is appended to every URL. The idea behind this is that browsers, for example, only look at the first URL while the rest is not of interest to them.
.PP
\fBParameters:\fP
.RS 4
\fI_url\fP The URL that has to be split. 
.RE
.PP
\fBReturns:\fP
.RS 4
An empty list on error or the list of split URLs. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBhasSubURL\fP 
.RE
.PP
Definition at line 1368 of file kurl.cpp.
.PP
References KURL().
.PP
Referenced by cd(), encodedHtmlRef(), hasHTMLRef(), htmlRef(), setHTMLRef(), and upURL().
.SS "\fBKURL::List\fP KURL::split (const \fBKURL\fP & _url)\fC [static]\fP"
.PP
Splits nested URLs like file:/home/weis/kde.tgz#gzip:/#tar:/kdebase A URL like http://www.kde.org#tar:/kde/README.hml#ref1 will be split in http://www.kde.org and tar:/kde/README.html#ref1. That means in turn that '#ref1' is an HTML-style reference and not a new sub URL. Since HTML-style references mark a certain position in a document this reference is appended to every URL. The idea behind this is that browsers, for example, only look at the first URL while the rest is not of interest to them.
.PP
\fBReturns:\fP
.RS 4
An empty list on error or the list of split URLs.
.RE
.PP
\fBParameters:\fP
.RS 4
\fI_url\fP The URL that has to be split. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBhasSubURL\fP 
.RE
.PP
Definition at line 1336 of file kurl.cpp.
.PP
References QValueList< KURL >::append(), QValueList< KURL >::begin(), QValueList< KURL >::end(), hasSubURL(), QValueList< KURL >::Iterator(), KURL(), m_strRef_encoded, ref(), and url().
.SS "\fBKURL\fP KURL::join (const \fBList\fP & _list)\fC [static]\fP"
.PP
Reverses \fBsplit\fP(). Only the first URL may have a reference. This reference is considered to be HTML-like and is appended at the end of the resulting joined URL. 
.PP
\fBParameters:\fP
.RS 4
\fI_list\fP the list to join 
.RE
.PP
\fBReturns:\fP
.RS 4
the joined URL 
.RE
.PP
Definition at line 1373 of file kurl.cpp.
.PP
References QValueList< KURL >::ConstIterator(), QValueList< KURL >::end(), QValueList< KURL >::fromLast(), QValueList< KURL >::isEmpty(), KURL(), m_strRef_encoded, and url().
.PP
Referenced by cd(), setHTMLRef(), and upURL().
.SS "\fBKURL\fP KURL::fromPathOrURL (const \fBQString\fP & text)\fC [static]\fP"
.PP
Creates a KURL object from a \fBQString\fP representing either an absolute path or a real URL. Use this method instead of 
.PP
.nf

 \fBQString\fP someDir = ...
 KURL url = someDir;
 
.PP
.PP
Otherwise some characters (e.g. the '#') won't be encoded properly. 
.PP
\fBParameters:\fP
.RS 4
\fItext\fP the string representation of the URL to convert 
.RE
.PP
\fBReturns:\fP
.RS 4
the new KURL 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 1894 of file kurl.cpp.
.PP
References QString::isEmpty(), KURL(), setPath(), and url().
.SS "\fBQString\fP KURL::encode_string (const \fBQString\fP & str, int encoding_hint = 0)\fC [static]\fP"
.PP
Convenience function. Convert unicoded string to local encoding and use -style encoding for all common delimiters / non-ascii characters. 
.PP
\fBParameters:\fP
.RS 4
\fIstr\fP String to encode (can be QString::null). 
.br
\fIencoding_hint\fP MIB of encoding to use. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBQTextCodec::mibEnum()\fP 
.RE
.PP
\fBReturns:\fP
.RS 4
the encoded string 
.RE
.PP
Definition at line 1739 of file kurl.cpp.
.PP
Referenced by setFileEncoding(), and setFileName().
.SS "\fBQString\fP KURL::encode_string_no_slash (const \fBQString\fP & str, int encoding_hint = 0)\fC [static]\fP"
.PP
Convenience function. Convert unicoded string to local encoding and use -style encoding for all common delimiters / non-ascii characters as well as the slash '/'. 
.PP
\fBParameters:\fP
.RS 4
\fIstr\fP String to encode 
.br
\fIencoding_hint\fP MIB of encoding to use. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBQTextCodec::mibEnum()\fP 
.RE
.PP
Definition at line 1744 of file kurl.cpp.
.SS "\fBQString\fP KURL::decode_string (const \fBQString\fP & str, int encoding_hint = 0)\fC [static]\fP"
.PP
Convenience function. Decode -style encoding and convert from local encoding to unicode.
.PP
Reverse of \fBencode_string()\fP 
.PP
\fBParameters:\fP
.RS 4
\fIstr\fP String to decode (can be QString::null). 
.br
\fIencoding_hint\fP MIB of original encoding of \fCstr\fP . 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBQTextCodec::mibEnum()\fP 
.RE
.PP
Definition at line 1734 of file kurl.cpp.
.PP
Referenced by fileEncoding(), KApplication::invokeMailer(), queryItem(), queryItems(), and setFileEncoding().
.SS "bool KURL::isRelativeURL (const \fBQString\fP & _url)\fC [static]\fP"
.PP
Convenience function. Returns whether '_url' is likely to be a 'relative' URL instead of an 'absolute' URL. 
.PP
\fBParameters:\fP
.RS 4
\fI_url\fP URL to examine 
.RE
.PP
\fBReturns:\fP
.RS 4
true when the URL is likely to be 'relative', false otherwise. 
.RE
.PP
Definition at line 348 of file kurl.cpp.
.PP
References QChar::latin1(), QString::length(), and QString::unicode().
.PP
Referenced by KURL(), and KCmdLineArgs::makeURL().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
