\section{KURL Class Reference}
\label{classKURL}\index{KURL@{KURL}}
Represents and parses a URL.  


{\tt \#include $<$kurl.h$>$}

Collaboration diagram for KURL:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=89pt]{classKURL__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf Adjustement\-Flags} \{ {\bf No\-Adjustements} =  0, 
{\bf Strip\-File\-Protocol} =  1
 \}
\item 
enum {\bf Query\-Items\-Options} \{ {\bf Case\-Insensitive\-Keys} =  1
 \}
\begin{CompactList}\small\item\em Options for {\bf query\-Items}{\rm (p.\,\pageref{classKURL_a47})}. \item\end{CompactList}\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KURL} ()
\begin{CompactList}\small\item\em Constructs an empty URL. \item\end{CompactList}\item 
{\bf $\sim$KURL} ()
\begin{CompactList}\small\item\em Destructs the KURL object. \item\end{CompactList}\item 
{\bf KURL} (const  {\bf QString} \&url, int encoding\_\-hint=0)
\begin{CompactList}\small\item\em Usual constructor, to construct from a string. \item\end{CompactList}\item 
{\bf KURL} (const  char $\ast$url, int encoding\_\-hint=0)
\begin{CompactList}\small\item\em Constructor taking a char $\ast$ {\tt url}, which is an \_\-encoded\_\- representation of the URL, exactly like the usual constructor. \item\end{CompactList}\item 
{\bf KURL} (const  {\bf QCString} \&url, int encoding\_\-hint=0)
\begin{CompactList}\small\item\em Constructor taking a {\bf QCString} {\tt url}, which is an \_\-encoded\_\- representation of the URL, exactly like the usual constructor. \item\end{CompactList}\item 
{\bf KURL} (const  {\bf KURL} \&u)
\begin{CompactList}\small\item\em Copy constructor. \item\end{CompactList}\item 
{\bf KURL} (const  {\bf QUrl} \&u)
\begin{CompactList}\small\item\em Converts from a {\bf QUrl}. \item\end{CompactList}\item 
{\bf KURL} (const  {\bf KURL} \&\_\-baseurl, const  {\bf QString} \&\_\-rel\_\-url, int encoding\_\-hint=0)
\begin{CompactList}\small\item\em Constructor allowing relative URLs. \item\end{CompactList}\item 
{\bf QString} {\bf protocol} () const 
\begin{CompactList}\small\item\em Returns the protocol for the URL (i.e., file, http, etc.). \item\end{CompactList}\item 
void {\bf set\-Protocol} (const  {\bf QString} \&\_\-txt)
\begin{CompactList}\small\item\em Sets the protocol for the URL (i.e., file, http, etc.). \item\end{CompactList}\item 
{\bf QString} {\bf user} () const 
\begin{CompactList}\small\item\em Returns the decoded user name (login, user id, ...) included in the URL. \item\end{CompactList}\item 
void {\bf set\-User} (const  {\bf QString} \&\_\-txt)
\begin{CompactList}\small\item\em Sets the user name (login, user id, ...) included in the URL. \item\end{CompactList}\item 
bool {\bf has\-User} () const 
\begin{CompactList}\small\item\em Test to see if this URL has a user name included in it. \item\end{CompactList}\item 
{\bf QString} {\bf pass} () const 
\begin{CompactList}\small\item\em Returns the decoded password (corresponding to {\bf user}{\rm (p.\,\pageref{classKURL_a10})}()) included in the URL. \item\end{CompactList}\item 
void {\bf set\-Pass} (const  {\bf QString} \&\_\-txt)
\begin{CompactList}\small\item\em Sets the password (corresponding to {\bf user}{\rm (p.\,\pageref{classKURL_a10})}()) included in the URL. \item\end{CompactList}\item 
bool {\bf has\-Pass} () const 
\begin{CompactList}\small\item\em Test to see if this URL has a password included in it. \item\end{CompactList}\item 
{\bf QString} {\bf host} () const 
\begin{CompactList}\small\item\em Returns the decoded hostname included in the URL. \item\end{CompactList}\item 
void {\bf set\-Host} (const  {\bf QString} \&\_\-txt)
\begin{CompactList}\small\item\em Sets the hostname included in the URL. \item\end{CompactList}\item 
bool {\bf has\-Host} () const 
\begin{CompactList}\small\item\em Test to see if this URL has a hostname included in it. \item\end{CompactList}\item 
unsigned short int {\bf port} () const 
\begin{CompactList}\small\item\em Returns the port number included in the URL. \item\end{CompactList}\item 
void {\bf set\-Port} (unsigned short int \_\-p)
\begin{CompactList}\small\item\em Sets the port number included in the URL. \item\end{CompactList}\item 
{\bf QString} {\bf path} () const 
\begin{CompactList}\small\item\em Returns the current decoded path. \item\end{CompactList}\item 
{\bf QString} {\bf path} (int \_\-trailing) const 
\item 
void {\bf set\-Path} (const  {\bf QString} \&path)
\begin{CompactList}\small\item\em Sets the path of the URL. \item\end{CompactList}\item 
bool {\bf has\-Path} () const 
\begin{CompactList}\small\item\em Test to see if this URL has a path is included in it. \item\end{CompactList}\item 
void {\bf clean\-Path} (bool clean\-Dir\-Separator=true)
\begin{CompactList}\small\item\em Resolves \char`\"{}.\char`\"{} and \char`\"{}..\char`\"{} components in path. \item\end{CompactList}\item 
void {\bf adjust\-Path} (int \_\-trailing)
\begin{CompactList}\small\item\em Add or remove a trailing slash to/from the path. \item\end{CompactList}\item 
void {\bf set\-Encoded\-Path\-And\-Query} (const  {\bf QString} \&\_\-txt, int encoding\_\-hint=0)
\begin{CompactList}\small\item\em This is useful for HTTP. \item\end{CompactList}\item 
void {\bf set\-Encoded\-Path} (const  {\bf QString} \&\_\-txt, int encoding\_\-hint=0)
\begin{CompactList}\small\item\em Sets the (already encoded) path. \item\end{CompactList}\item 
{\bf QString} {\bf encoded\-Path\-And\-Query} (int \_\-trailing=0, bool \_\-no\_\-empty\_\-path=false, int encoding\_\-hint=0) const 
\begin{CompactList}\small\item\em Returns the encoded path and the query. \item\end{CompactList}\item 
void {\bf set\-Query} (const  {\bf QString} \&\_\-txt, int encoding\_\-hint=0)
\item 
{\bf QString} {\bf query} () const 
\begin{CompactList}\small\item\em Returns the query of the URL. \item\end{CompactList}\item 
{\bf QString} {\bf ref} () const 
\begin{CompactList}\small\item\em The reference is {\em never\/} decoded automatically. \item\end{CompactList}\item 
void {\bf set\-Ref} (const  {\bf QString} \&\_\-txt)
\begin{CompactList}\small\item\em Sets the reference part (everything after '\#'). \item\end{CompactList}\item 
bool {\bf has\-Ref} () const 
\begin{CompactList}\small\item\em Checks whether the URL has a reference part. \item\end{CompactList}\item 
{\bf QString} {\bf html\-Ref} () const 
\begin{CompactList}\small\item\em Returns the HTML reference (the part of the URL after \char`\"{}\#\char`\"{}). \item\end{CompactList}\item 
{\bf QString} {\bf encoded\-Html\-Ref} () const 
\begin{CompactList}\small\item\em Returns the HTML reference (the part of the URL after \char`\"{}\#\char`\"{}) in encoded form. \item\end{CompactList}\item 
void {\bf set\-HTMLRef} (const  {\bf QString} \&\_\-ref)
\begin{CompactList}\small\item\em Sets the HTML-style reference. \item\end{CompactList}\item 
bool {\bf has\-HTMLRef} () const 
\begin{CompactList}\small\item\em Checks whether there is a HTML reference. \item\end{CompactList}\item 
bool {\bf is\-Valid} () const 
\begin{CompactList}\small\item\em Checks whether the URL is well formed. \item\end{CompactList}\item 
bool {\bf is\-Malformed} () const 
\begin{CompactList}\small\item\em {\bf This class or method is obsolete, it is provided for compatibility only.} \item\end{CompactList}\item 
bool {\bf is\-Local\-File} () const 
\begin{CompactList}\small\item\em Checks whether the file is local. \item\end{CompactList}\item 
void {\bf set\-File\-Encoding} (const  {\bf QString} \&encoding)
\begin{CompactList}\small\item\em Adds encoding information to url by adding a \char`\"{}charset\char`\"{} parameter. \item\end{CompactList}\item 
{\bf QString} {\bf file\-Encoding} () const 
\begin{CompactList}\small\item\em Returns encoding information from url, the content of the \char`\"{}charset\char`\"{} parameter. \item\end{CompactList}\item 
bool {\bf has\-Sub\-URL} () const 
\begin{CompactList}\small\item\em Checks whether the URL has any sub URLs. \item\end{CompactList}\item 
void {\bf add\-Path} (const  {\bf QString} \&\_\-txt)
\begin{CompactList}\small\item\em Adds to the current path. \item\end{CompactList}\item 
{\bf QString} {\bf query\-Item} (const  {\bf QString} \&\_\-item) const 
\begin{CompactList}\small\item\em Returns the value of a certain query item. \item\end{CompactList}\item 
{\bf QMap}$<$ {\bf QString}, {\bf QString} $>$ {\bf query\-Items} (int options=0) const 
\begin{CompactList}\small\item\em Returns the list of query items as a map mapping keys to values. \item\end{CompactList}\item 
void {\bf add\-Query\-Item} (const  {\bf QString} \&\_\-item, const  {\bf QString} \&\_\-value, int encoding\_\-hint=0)
\begin{CompactList}\small\item\em Add an additional query item. \item\end{CompactList}\item 
void {\bf remove\-Query\-Item} (const  {\bf QString} \&\_\-item)
\begin{CompactList}\small\item\em Remove an item from the query. \item\end{CompactList}\item 
void {\bf set\-File\-Name} (const  {\bf QString} \&\_\-txt)
\begin{CompactList}\small\item\em Sets the filename of the path. \item\end{CompactList}\item 
{\bf QString} {\bf file\-Name} (bool \_\-ignore\_\-trailing\_\-slash\_\-in\_\-path=true) const 
\begin{CompactList}\small\item\em Returns the filename of the path. \item\end{CompactList}\item 
{\bf QString} {\bf directory} (bool \_\-strip\_\-trailing\_\-slash\_\-from\_\-result=true, bool \_\-ignore\_\-trailing\_\-slash\_\-in\_\-path=true) const 
\begin{CompactList}\small\item\em Returns the directory of the path. \item\end{CompactList}\item 
bool {\bf cd} (const  {\bf QString} \&\_\-dir)
\begin{CompactList}\small\item\em Changes the directory by descending into the given directory. \item\end{CompactList}\item 
{\bf QString} {\bf url} (int \_\-trailing=0, int encoding\_\-hint=0) const 
\begin{CompactList}\small\item\em Returns the URL as string. \item\end{CompactList}\item 
{\bf QString} {\bf pretty\-URL} (int \_\-trailing=0) const 
\begin{CompactList}\small\item\em Returns the URL as string in human-friendly format. \item\end{CompactList}\item 
{\bf QString} {\bf html\-URL} () const 
\begin{CompactList}\small\item\em Returns the URL as string, escaped for HTML. \item\end{CompactList}\item 
{\bf QString} {\bf pretty\-URL} (int \_\-trailing, Adjustement\-Flags \_\-flags) const 
\begin{CompactList}\small\item\em Returns the URL as string, escaped for HTML. \item\end{CompactList}\item 
bool {\bf is\-Empty} () const 
\begin{CompactList}\small\item\em Test to see if the KURL is empty. \item\end{CompactList}\item 
{\bf KURL} {\bf up\-URL} () const 
\begin{CompactList}\small\item\em This function is useful to implement the \char`\"{}Up\char`\"{} button in a file manager for example. \item\end{CompactList}\item 
{\bf KURL} \& {\bf operator=} (const  {\bf KURL} \&\_\-u)\label{classKURL_a60}

\item 
{\bf KURL} \& {\bf operator=} (const  {\bf QString} \&\_\-url)\label{classKURL_a61}

\item 
{\bf KURL} \& {\bf operator=} (const  char $\ast$\_\-url)\label{classKURL_a62}

\item 
{\bf KURL} \& {\bf operator=} (const  {\bf QUrl} \&u)\label{classKURL_a63}

\item 
bool {\bf operator==} (const  {\bf KURL} \&\_\-u) const \label{classKURL_a64}

\item 
bool {\bf operator==} (const  {\bf QString} \&\_\-u) const \label{classKURL_a65}

\item 
bool {\bf operator!=} (const  {\bf KURL} \&\_\-u) const \label{classKURL_a66}

\item 
bool {\bf operator!=} (const  {\bf QString} \&\_\-u) const \label{classKURL_a67}

\item 
bool {\bf cmp} (const  {\bf KURL} \&u, bool ignore\_\-trailing=false) const 
\begin{CompactList}\small\item\em The same as {\bf equals()}{\rm (p.\,\pageref{classKURL_a69})}, just with a less obvious name. \item\end{CompactList}\item 
bool {\bf equals} (const  {\bf KURL} \&u, bool ignore\_\-trailing=false) const 
\begin{CompactList}\small\item\em Compares this url with {\tt u}. \item\end{CompactList}\item 
bool {\bf is\-Parent\-Of} (const  {\bf KURL} \&u) const 
\begin{CompactList}\small\item\em Checks whether the given URL is parent of this URL. \item\end{CompactList}\item 
{\bf QString} {\bf filename} (bool \_\-ignore\_\-trailing\_\-slash\_\-in\_\-path=true) const \label{classKURL_a71}

\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
{\bf List} {\bf split} (const  {\bf QString} \&\_\-url)
\begin{CompactList}\small\item\em Splits nested URLs like {\tt file:/home/weis/kde.tgz\#gzip:/\#tar:/kdebase} A URL like {\tt http://www.kde.org\#tar:/kde/README.hml\#ref1} will be split in {\tt http://www.kde.org} and tar:/kde/README.html\#ref1. \item\end{CompactList}\item 
{\bf List} {\bf split} (const  {\bf KURL} \&\_\-url)
\begin{CompactList}\small\item\em Splits nested URLs like {\tt file:/home/weis/kde.tgz\#gzip:/\#tar:/kdebase} A URL like {\tt http://www.kde.org\#tar:/kde/README.hml\#ref1} will be split in {\tt http://www.kde.org} and tar:/kde/README.html\#ref1. \item\end{CompactList}\item 
{\bf KURL} {\bf join} (const  {\bf List} \&\_\-list)
\begin{CompactList}\small\item\em Reverses {\bf split}{\rm (p.\,\pageref{classKURL_e0})}(). \item\end{CompactList}\item 
{\bf KURL} {\bf from\-Path\-Or\-URL} (const  {\bf QString} \&text)
\begin{CompactList}\small\item\em Creates a KURL object from a {\bf QString} representing either an absolute path or a real URL. \item\end{CompactList}\item 
{\bf QString} {\bf encode\_\-string} (const  {\bf QString} \&str, int encoding\_\-hint=0)
\begin{CompactList}\small\item\em Convenience function. \item\end{CompactList}\item 
{\bf QString} {\bf encode\_\-string\_\-no\_\-slash} (const  {\bf QString} \&str, int encoding\_\-hint=0)
\begin{CompactList}\small\item\em Convenience function. \item\end{CompactList}\item 
{\bf QString} {\bf decode\_\-string} (const  {\bf QString} \&str, int encoding\_\-hint=0)
\begin{CompactList}\small\item\em Convenience function. \item\end{CompactList}\item 
bool {\bf is\-Relative\-URL} (const  {\bf QString} \&\_\-url)
\begin{CompactList}\small\item\em Convenience function. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
void {\bf reset} ()\label{classKURL_b0}

\item 
void {\bf parse} (const  {\bf QString} \&\_\-url, int encoding\_\-hint=0)\label{classKURL_b1}

\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
{\bf QData\-Stream} \& {\bf operator$<$$<$} ({\bf QData\-Stream} \&s, const  {\bf KURL} \&a)\label{classKURL_n0}

\item 
{\bf QData\-Stream} \& {\bf operator$>$$>$} ({\bf QData\-Stream} \&s, {\bf KURL} \&a)\label{classKURL_n1}

\end{CompactItemize}


\subsection{Detailed Description}
Represents and parses a URL. 

A prototypical URL looks like: \small\begin{alltt}
   protocol:/user:password:port/path/to/file.ext#reference
 \end{alltt}\normalsize 


KURL has some restrictions regarding the path encoding. KURL works internally with the decoded path and and encoded query. For example, \small\begin{alltt}
 {\tt http://localhost/cgi-bin/test%20me.pl?cmd=Hello%20you}
 \end{alltt}\normalsize 
 would result in a decoded path \char`\"{}/cgi-bin/test me.pl\char`\"{} and in the encoded query \char`\"{}?cmd=Hello\%20you\char`\"{}. Since path is internally always encoded you may {\em not\/} use \char`\"{}\%00\char`\"{} in the path, although this is OK for the query.

\begin{Desc}
\item[Author:]Torben Weis $<${\tt weis@kde.org}$>$ \end{Desc}




Definition at line 52 of file kurl.h.

\subsection{Member Enumeration Documentation}
\index{KURL@{KURL}!QueryItemsOptions@{QueryItemsOptions}}
\index{QueryItemsOptions@{QueryItemsOptions}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf KURL::Query\-Items\-Options}}\label{classKURL_w4}


Options for {\bf query\-Items}{\rm (p.\,\pageref{classKURL_a47})}. 

Currently, only one option is defined:

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em Case\-Insensitive\-Keys}]normalize query keys to lowercase.\end{description}
\end{Desc}
\begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 486 of file kurl.h.

\subsection{Constructor \& Destructor Documentation}
\index{KURL@{KURL}!KURL@{KURL}}
\index{KURL@{KURL}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KURL::KURL ()}\label{classKURL_a0}


Constructs an empty URL. 



Definition at line 400 of file kurl.cpp.

Referenced by from\-Path\-Or\-URL(), join(), KURL::List::List(), split(), and up\-URL().\index{KURL@{KURL}!~KURL@{$\sim$KURL}}
\index{~KURL@{$\sim$KURL}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KURL::$\sim${\bf KURL} ()}\label{classKURL_a1}


Destructs the KURL object. 



Definition at line 405 of file kurl.cpp.\index{KURL@{KURL}!KURL@{KURL}}
\index{KURL@{KURL}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KURL::KURL (const {\bf QString} \& {\em url}, int {\em encoding\_\-hint} = 0)}\label{classKURL_a2}


Usual constructor, to construct from a string. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em url}]A URL, not a filename. If the URL does not have a protocol part, \char`\"{}file:\char`\"{} is assumed. It is dangerous to feed unix filenames into this function, this will work most of the time but not always. For example \char`\"{}/home/Torben\%20Weis\char`\"{} will be considered a URL pointing to the file \char`\"{}/home/Torben Weis\char`\"{} instead of to the file \char`\"{}/home/Torben\%20Weis\char`\"{}. 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 {\bf set\-Path}{\rm (p.\,\pageref{classKURL_a23})}(). \item[{\em encoding\_\-hint}]MIB of original encoding of URL. \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf QText\-Codec::mib\-Enum()} \end{Desc}


Definition at line 410 of file kurl.cpp.\index{KURL@{KURL}!KURL@{KURL}}
\index{KURL@{KURL}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KURL::KURL (const char $\ast$ {\em url}, int {\em encoding\_\-hint} = 0)}\label{classKURL_a3}


Constructor taking a char $\ast$ {\tt url}, 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. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em url}]A encoded URL. If the URL does not have a protocol part, \char`\"{}file:\char`\"{} is assumed. \item[{\em encoding\_\-hint}]MIB of original encoding of URL. \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf QText\-Codec::mib\-Enum()} \end{Desc}


Definition at line 416 of file kurl.cpp.

References QString::from\-Latin1().\index{KURL@{KURL}!KURL@{KURL}}
\index{KURL@{KURL}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KURL::KURL (const {\bf QCString} \& {\em url}, int {\em encoding\_\-hint} = 0)}\label{classKURL_a4}


Constructor taking a {\bf QCString} {\tt url}, 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. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em url}]A encoded URL. If the URL does not have a protocol part, \char`\"{}file:\char`\"{} is assumed. \item[{\em encoding\_\-hint}]MIB of original encoding of URL. \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf QText\-Codec::mib\-Enum()} \end{Desc}


Definition at line 422 of file kurl.cpp.

References QString::from\-Latin1().\index{KURL@{KURL}!KURL@{KURL}}
\index{KURL@{KURL}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KURL::KURL (const {\bf KURL} \& {\em u})}\label{classKURL_a5}


Copy constructor. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em u}]the KURL to copy \end{description}
\end{Desc}


Definition at line 428 of file kurl.cpp.\index{KURL@{KURL}!KURL@{KURL}}
\index{KURL@{KURL}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KURL::KURL (const {\bf QUrl} \& {\em u})}\label{classKURL_a6}


Converts from a {\bf QUrl}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em u}]the {\bf QUrl} \end{description}
\end{Desc}


Definition at line 463 of file kurl.cpp.\index{KURL@{KURL}!KURL@{KURL}}
\index{KURL@{KURL}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KURL::KURL (const {\bf KURL} \& {\em \_\-baseurl}, const {\bf QString} \& {\em \_\-rel\_\-url}, int {\em encoding\_\-hint} = 0)}\label{classKURL_a7}


Constructor allowing relative URLs. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-baseurl}]The base url. \item[{\em \_\-rel\_\-url}]A relative or absolute URL. If this is an absolute URL then {\tt \_\-baseurl} will be ignored. If this is a relative URL it will be combined with {\tt \_\-baseurl}. Note that \_\-rel\_\-url should be encoded too, in any case. So do NOT pass a path here (use set\-Path or add\-Path instead). \item[{\em encoding\_\-hint}]MIB of original encoding of URL. \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf QText\-Codec::mib\-Enum()} \end{Desc}


Definition at line 469 of file kurl.cpp.

References clean\-Path(), QString::find(), QString::find\-Rev(), QString::is\-Empty(), QString::is\-Null(), is\-Relative\-URL(), QString::length(), m\_\-str\-Host, m\_\-str\-Pass, m\_\-str\-Protocol, m\_\-str\-User, ref(), set\-HTMLRef(), QString::truncate(), and url().

\subsection{Member Function Documentation}
\index{KURL@{KURL}!protocol@{protocol}}
\index{protocol@{protocol}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURL::protocol () const\hspace{0.3cm}{\tt  [inline]}}\label{classKURL_a8}


Returns the protocol for the URL (i.e., file, http, etc.). 

\begin{Desc}
\item[Returns:]the protocol of the URL, does not include the colon. If the URL is malformed, QString::null will be returned. \end{Desc}


Definition at line 168 of file kurl.h.\index{KURL@{KURL}!setProtocol@{setProtocol}}
\index{setProtocol@{setProtocol}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURL::set\-Protocol (const {\bf QString} \& {\em \_\-txt})}\label{classKURL_a9}


Sets the protocol for the URL (i.e., file, http, etc.). 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-txt}]the new protocol of the URL (without colon) \end{description}
\end{Desc}


Definition at line 1643 of file kurl.cpp.\index{KURL@{KURL}!user@{user}}
\index{user@{user}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURL::user () const\hspace{0.3cm}{\tt  [inline]}}\label{classKURL_a10}


Returns the decoded user name (login, user id, ...) included in the URL. 

\begin{Desc}
\item[Returns:]the user name or QString::null if there is no user name \end{Desc}


Definition at line 179 of file kurl.h.\index{KURL@{KURL}!setUser@{setUser}}
\index{setUser@{setUser}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURL::set\-User (const {\bf QString} \& {\em \_\-txt})}\label{classKURL_a11}


Sets the user name (login, user id, ...) included in the URL. 

Special characters in the user name will appear encoded in the URL. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-txt}]the name of the user or QString::null to remove the user \end{description}
\end{Desc}


Definition at line 1650 of file kurl.cpp.\index{KURL@{KURL}!hasUser@{hasUser}}
\index{hasUser@{hasUser}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURL::has\-User () const\hspace{0.3cm}{\tt  [inline]}}\label{classKURL_a12}


Test to see if this URL has a user name included in it. 

\begin{Desc}
\item[Returns:]true if the URL has an non-empty user name \end{Desc}


Definition at line 191 of file kurl.h.

References QString::is\-Empty().

Referenced by pretty\-URL(), and url().\index{KURL@{KURL}!pass@{pass}}
\index{pass@{pass}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURL::pass () const\hspace{0.3cm}{\tt  [inline]}}\label{classKURL_a13}


Returns the decoded password (corresponding to {\bf user}{\rm (p.\,\pageref{classKURL_a10})}()) included in the URL. 

\begin{Desc}
\item[Returns:]the password or QString::null if it does not exist \end{Desc}


Definition at line 197 of file kurl.h.\index{KURL@{KURL}!setPass@{setPass}}
\index{setPass@{setPass}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURL::set\-Pass (const {\bf QString} \& {\em \_\-txt})}\label{classKURL_a14}


Sets the password (corresponding to {\bf user}{\rm (p.\,\pageref{classKURL_a10})}()) 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. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-txt}]the password to set or QString::null to remove the password \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf set\-User}{\rm (p.\,\pageref{classKURL_a11})} 

{\bf has\-User}{\rm (p.\,\pageref{classKURL_a12})} \end{Desc}


Definition at line 1656 of file kurl.cpp.\index{KURL@{KURL}!hasPass@{hasPass}}
\index{hasPass@{hasPass}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURL::has\-Pass () const\hspace{0.3cm}{\tt  [inline]}}\label{classKURL_a15}


Test to see if this URL has a password included in it. 

\begin{Desc}
\item[Returns:]true if there is a non-empty password set \end{Desc}


Definition at line 213 of file kurl.h.

References QString::is\-Empty().

Referenced by url().\index{KURL@{KURL}!host@{host}}
\index{host@{host}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURL::host () const\hspace{0.3cm}{\tt  [inline]}}\label{classKURL_a16}


Returns the decoded hostname included in the URL. 

\begin{Desc}
\item[Returns:]the name of the host or QString::null if no host is set \end{Desc}


Definition at line 219 of file kurl.h.\index{KURL@{KURL}!setHost@{setHost}}
\index{setHost@{setHost}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURL::set\-Host (const {\bf QString} \& {\em \_\-txt})}\label{classKURL_a17}


Sets the hostname included in the URL. 

Special characters in the hostname will appear encoded in the URL. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-txt}]the new name of the host or QString::null to remove the host \end{description}
\end{Desc}


Definition at line 1662 of file kurl.cpp.\index{KURL@{KURL}!hasHost@{hasHost}}
\index{hasHost@{hasHost}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURL::has\-Host () const\hspace{0.3cm}{\tt  [inline]}}\label{classKURL_a18}


Test to see if this URL has a hostname included in it. 

\begin{Desc}
\item[Returns:]true if the URL has a host \end{Desc}


Definition at line 231 of file kurl.h.

References QString::is\-Empty().

Referenced by pretty\-URL(), and url().\index{KURL@{KURL}!port@{port}}
\index{port@{port}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned short int KURL::port () const\hspace{0.3cm}{\tt  [inline]}}\label{classKURL_a19}


Returns the port number included in the URL. 

\begin{Desc}
\item[Returns:]the port number. If there is no port number specified in the URL, returns 0. \end{Desc}


Definition at line 238 of file kurl.h.\index{KURL@{KURL}!setPort@{setPort}}
\index{setPort@{setPort}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURL::set\-Port (unsigned short int {\em \_\-p})}\label{classKURL_a20}


Sets the port number included in the URL. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-p}]the new port number or 0 to have no port number \end{description}
\end{Desc}


Definition at line 1668 of file kurl.cpp.\index{KURL@{KURL}!path@{path}}
\index{path@{path}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURL::path () const\hspace{0.3cm}{\tt  [inline]}}\label{classKURL_a21}


Returns the current decoded path. 

This does {\em not\/} include the query. \begin{Desc}
\item[Returns:]the path of the URL (without query), or QString::null if no path set. \end{Desc}


Definition at line 250 of file kurl.h.

Referenced by KApplication::authorize\-URLAction(), cd(), encoded\-Path\-And\-Query(), equals(), file\-Name(), KApplication::invoke\-Mailer(), is\-Parent\-Of(), path(), set\-File\-Name(), and up\-URL().\index{KURL@{KURL}!path@{path}}
\index{path@{path}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURL::path (int {\em \_\-trailing}) const}\label{classKURL_a22}


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-trailing}]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 \char`\"{}/\char`\"{}, then this character won't be stripped. Reason: \char`\"{}ftp://weis@host\char`\"{} means something completely different than \char`\"{}ftp://weis@host/\char`\"{}. So adding or stripping the '/' would really alter the URL, while \char`\"{}ftp://host/path\char`\"{} and \char`\"{}ftp://host/path/\char`\"{} mean the same directory.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The current decoded path. This does not include the query. Can be QString::null if no path is set. \end{Desc}


Definition at line 1137 of file kurl.cpp.

References path().\index{KURL@{KURL}!setPath@{setPath}}
\index{setPath@{setPath}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURL::set\-Path (const {\bf QString} \& {\em path})}\label{classKURL_a23}


Sets the path of the URL. 

The query is not changed by this function.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em path}]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. \end{description}
\end{Desc}


Definition at line 1673 of file kurl.cpp.

References QString::is\-Empty(), and is\-Empty().

Referenced by KApplication::authorize\-URLAction(), cd(), from\-Path\-Or\-URL(), KCmd\-Line\-Args::make\-URL(), KConfig\-INIBack\-End::parse\-Config\-Files(), KDesktop\-File::read\-URL(), set\-File\-Name(), and KConfig\-INIBack\-End::sync().\index{KURL@{KURL}!hasPath@{hasPath}}
\index{hasPath@{hasPath}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURL::has\-Path () const\hspace{0.3cm}{\tt  [inline]}}\label{classKURL_a24}


Test to see if this URL has a path is included in it. 

\begin{Desc}
\item[Returns:]true if there is a path \end{Desc}


Definition at line 281 of file kurl.h.

References QString::is\-Empty().\index{KURL@{KURL}!cleanPath@{cleanPath}}
\index{cleanPath@{cleanPath}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURL::clean\-Path (bool {\em clean\-Dir\-Separator} = true)}\label{classKURL_a25}


Resolves \char`\"{}.\char`\"{} and \char`\"{}..\char`\"{} components in path. 

Some servers seem not to like the removal of extra '/' even though it is against the specification in RFC 2396.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em clean\-Dir\-Separator}]if true, occurrances of consecutive directory separators (e.g. /foo//bar) are cleaned up as well. \end{description}
\end{Desc}


Definition at line 1038 of file kurl.cpp.

Referenced by KURL(), KCmd\-Line\-Args::make\-URL(), and set\-File\-Name().\index{KURL@{KURL}!adjustPath@{adjustPath}}
\index{adjustPath@{adjustPath}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURL::adjust\-Path (int {\em \_\-trailing})}\label{classKURL_a26}


Add or remove a trailing slash to/from the path. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-trailing}]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 \char`\"{}/\char`\"{}, then this character won't be stripped. Reason: \char`\"{}ftp://weis@host\char`\"{} means something completely different than \char`\"{}ftp://weis@host/\char`\"{}. So adding or stripping the '/' would really alter the URL, while \char`\"{}ftp://host/path\char`\"{} and \char`\"{}ftp://host/path/\char`\"{} mean the same directory. \end{description}
\end{Desc}


Definition at line 1075 of file kurl.cpp.

References QString::is\-Empty().\index{KURL@{KURL}!setEncodedPathAndQuery@{setEncodedPathAndQuery}}
\index{setEncodedPathAndQuery@{setEncodedPathAndQuery}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURL::set\-Encoded\-Path\-And\-Query (const {\bf QString} \& {\em \_\-txt}, int {\em encoding\_\-hint} = 0)}\label{classKURL_a27}


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. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-txt}]the new path and query. \item[{\em encoding\_\-hint}]MIB of original encoding of {\tt \_\-txt} . \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf QText\-Codec::mib\-Enum()} \end{Desc}


Definition at line 1122 of file kurl.cpp.

References QString::find(), QString::left(), QString::length(), QString::right(), set\-Encoded\-Path(), and set\-Query().\index{KURL@{KURL}!setEncodedPath@{setEncodedPath}}
\index{setEncodedPath@{setEncodedPath}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURL::set\-Encoded\-Path (const {\bf QString} \& {\em \_\-txt}, int {\em encoding\_\-hint} = 0)}\label{classKURL_a28}


Sets the (already encoded) path. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-txt}]the new path \item[{\em encoding\_\-hint}]MIB of original encoding of {\tt \_\-txt} . \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf QText\-Codec::mib\-Enum()} \end{Desc}


Definition at line 1106 of file kurl.cpp.

References KGlobal::static\-QString().

Referenced by set\-Encoded\-Path\-And\-Query(), and set\-File\-Name().\index{KURL@{KURL}!encodedPathAndQuery@{encodedPathAndQuery}}
\index{encodedPathAndQuery@{encodedPathAndQuery}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURL::encoded\-Path\-And\-Query (int {\em \_\-trailing} = 0, bool {\em \_\-no\_\-empty\_\-path} = false, int {\em encoding\_\-hint} = 0) const}\label{classKURL_a29}


Returns the encoded path and the query. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-trailing}]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 \char`\"{}/\char`\"{}, then this character won't be stripped. Reason: \char`\"{}ftp://weis@host\char`\"{} means something completely different than \char`\"{}ftp://weis@host/\char`\"{}. So adding or stripping the '/' would really alter the URL, while \char`\"{}ftp://host/path\char`\"{} and \char`\"{}ftp://host/path/\char`\"{} mean the same directory. \item[{\em \_\-no\_\-empty\_\-path}]If set to true then an empty path is substituted by \char`\"{}/\char`\"{}. \item[{\em encoding\_\-hint}]MIB of desired encoding of URL. \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf QText\-Codec::mib\-Enum()} \end{Desc}
\begin{Desc}
\item[Returns:]The concatenation if the encoded path , '?' and the encoded query. \end{Desc}


Definition at line 1085 of file kurl.cpp.

References QString::is\-Empty(), QString::is\-Null(), and path().

Referenced by url().\index{KURL@{KURL}!setQuery@{setQuery}}
\index{setQuery@{setQuery}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURL::set\-Query (const {\bf QString} \& {\em \_\-txt}, int {\em encoding\_\-hint} = 0)}\label{classKURL_a30}


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-txt}]This is considered to be encoded. This has a good reason: The query may contain the 0 character.\end{description}
\end{Desc}
The query should start with a '?'. If it doesn't '?' is prepended. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em encoding\_\-hint}]Reserved, should be 0. \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf QText\-Codec::mib\-Enum()} \end{Desc}


Definition at line 1683 of file kurl.cpp.

References QString::latin1(), QString::length(), and QString::mid().

Referenced by set\-Encoded\-Path\-And\-Query(), set\-File\-Encoding(), and up\-URL().\index{KURL@{KURL}!query@{query}}
\index{query@{query}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURL::query () const}\label{classKURL_a31}


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. \begin{Desc}
\item[Returns:]The encoded query, or QString::null if there is none. \end{Desc}


Definition at line 1727 of file kurl.cpp.

References QString::is\-Null().

Referenced by file\-Encoding(), KApplication::invoke\-Mailer(), set\-File\-Encoding(), and up\-URL().\index{KURL@{KURL}!ref@{ref}}
\index{ref@{ref}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURL::ref () const\hspace{0.3cm}{\tt  [inline]}}\label{classKURL_a32}


The reference is {\em never\/} decoded automatically. 

\begin{Desc}
\item[Returns:]the undecoded reference, or QString::null if there is none \end{Desc}


Definition at line 366 of file kurl.h.

Referenced by encoded\-Html\-Ref(), html\-Ref(), KURL(), and split().\index{KURL@{KURL}!setRef@{setRef}}
\index{setRef@{setRef}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURL::set\-Ref (const {\bf QString} \& {\em \_\-txt})\hspace{0.3cm}{\tt  [inline]}}\label{classKURL_a33}


Sets the reference part (everything after '\#'). 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-txt}]The encoded reference (or QString::null to remove it). \end{description}
\end{Desc}


Definition at line 372 of file kurl.h.\index{KURL@{KURL}!hasRef@{hasRef}}
\index{hasRef@{hasRef}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURL::has\-Ref () const\hspace{0.3cm}{\tt  [inline]}}\label{classKURL_a34}


Checks whether the URL has a reference part. 

\begin{Desc}
\item[Returns:]true if the URL has a reference part. In a URL like {\tt http://www.kde.org/kdebase.tar\#tar:/README} it would return true, too. \end{Desc}


Definition at line 380 of file kurl.h.

References QString::is\-Null().

Referenced by has\-HTMLRef(), pretty\-URL(), and url().\index{KURL@{KURL}!htmlRef@{htmlRef}}
\index{htmlRef@{htmlRef}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURL::html\-Ref () const}\label{classKURL_a35}


Returns the HTML reference (the part of the URL after \char`\"{}\#\char`\"{}). 

\begin{Desc}
\item[Returns:]The HTML-style reference. \end{Desc}
\begin{Desc}
\item[See also:]{\bf split}{\rm (p.\,\pageref{classKURL_e0})} 

{\bf has\-Sub\-URL}{\rm (p.\,\pageref{classKURL_a44})} 

{\bf encoded\-Html\-Ref}{\rm (p.\,\pageref{classKURL_a36})} \end{Desc}


Definition at line 1594 of file kurl.cpp.

References QValue\-List$<$ KURL $>$::begin(), has\-Sub\-URL(), ref(), and split().\index{KURL@{KURL}!encodedHtmlRef@{encodedHtmlRef}}
\index{encodedHtmlRef@{encodedHtmlRef}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURL::encoded\-Html\-Ref () const}\label{classKURL_a36}


Returns the HTML reference (the part of the URL after \char`\"{}\#\char`\"{}) in encoded form. 

\begin{Desc}
\item[Returns:]The HTML-style reference in its original form. \end{Desc}


Definition at line 1605 of file kurl.cpp.

References QValue\-List$<$ KURL $>$::begin(), has\-Sub\-URL(), ref(), and split().\index{KURL@{KURL}!setHTMLRef@{setHTMLRef}}
\index{setHTMLRef@{setHTMLRef}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURL::set\-HTMLRef (const {\bf QString} \& {\em \_\-ref})}\label{classKURL_a37}


Sets the HTML-style reference. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-ref}]The new reference. This is considered to be {\em not\/} encoded in contrast to {\bf set\-Ref}{\rm (p.\,\pageref{classKURL_a33})}(). Use QString::null to remove it. \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf html\-Ref()}{\rm (p.\,\pageref{classKURL_a35})} \end{Desc}


Definition at line 1616 of file kurl.cpp.

References QValue\-List$<$ KURL $>$::begin(), has\-Sub\-URL(), join(), and split().

Referenced by cd(), and KURL().\index{KURL@{KURL}!hasHTMLRef@{hasHTMLRef}}
\index{hasHTMLRef@{hasHTMLRef}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURL::has\-HTMLRef () const}\label{classKURL_a38}


Checks whether there is a HTML reference. 

\begin{Desc}
\item[Returns:]true if the URL has an HTML-style reference. \end{Desc}
\begin{Desc}
\item[See also:]{\bf html\-Ref()}{\rm (p.\,\pageref{classKURL_a35})} \end{Desc}


Definition at line 1631 of file kurl.cpp.

References QValue\-List$<$ KURL $>$::begin(), has\-Ref(), has\-Sub\-URL(), and split().\index{KURL@{KURL}!isValid@{isValid}}
\index{isValid@{isValid}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURL::is\-Valid () const\hspace{0.3cm}{\tt  [inline]}}\label{classKURL_a39}


Checks whether the URL is well formed. 

\begin{Desc}
\item[Returns:]false if the URL is malformed. This function does {\em not\/} test whether sub URLs are well-formed, too. \end{Desc}


Definition at line 419 of file kurl.h.

Referenced by is\-Malformed().\index{KURL@{KURL}!isMalformed@{isMalformed}}
\index{isMalformed@{isMalformed}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURL::is\-Malformed () const\hspace{0.3cm}{\tt  [inline]}}\label{classKURL_a40}


{\bf This class or method is obsolete, it is provided for compatibility only.} 



Definition at line 423 of file kurl.h.

References is\-Valid().

Referenced by equals(), and is\-Parent\-Of().\index{KURL@{KURL}!isLocalFile@{isLocalFile}}
\index{isLocalFile@{isLocalFile}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURL::is\-Local\-File () const}\label{classKURL_a41}


Checks whether the file is local. 

\begin{Desc}
\item[Returns:]true if the file is a plain local file and has no filter protocols attached to it. \end{Desc}


Definition at line 1142 of file kurl.cpp.

References has\-Sub\-URL(), QString::is\-Empty(), and KGlobal::static\-QString().

Referenced by file\-Encoding(), and set\-File\-Encoding().\index{KURL@{KURL}!setFileEncoding@{setFileEncoding}}
\index{setFileEncoding@{setFileEncoding}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURL::set\-File\-Encoding (const {\bf QString} \& {\em encoding})}\label{classKURL_a42}


Adds encoding information to url by adding a \char`\"{}charset\char`\"{} parameter. 

If there is already a charset parameter, it will be replaced. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em encoding}]the encoding to add or QString::null to remove the encoding. \end{description}
\end{Desc}


Definition at line 1152 of file kurl.cpp.

References decode\_\-string(), encode\_\-string(), QString::is\-Empty(), is\-Local\-File(), QString\-List::join(), QString::mid(), query(), set\-Query(), QString\-List::split(), and QString::starts\-With().\index{KURL@{KURL}!fileEncoding@{fileEncoding}}
\index{fileEncoding@{fileEncoding}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURL::file\-Encoding () const}\label{classKURL_a43}


Returns encoding information from url, the content of the \char`\"{}charset\char`\"{} parameter. 

\begin{Desc}
\item[Returns:]An encoding suitable for {\bf QText\-Codec::codec\-For\-Name()} or QString::null if not encoding was specified. \end{Desc}


Definition at line 1181 of file kurl.cpp.

References decode\_\-string(), QString::is\-Empty(), is\-Local\-File(), QString::mid(), query(), QString\-List::split(), and QString::starts\-With().\index{KURL@{KURL}!hasSubURL@{hasSubURL}}
\index{hasSubURL@{hasSubURL}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURL::has\-Sub\-URL () const}\label{classKURL_a44}


Checks whether the URL has any sub URLs. 

See {\bf split}{\rm (p.\,\pageref{classKURL_e0})}() for examples for sub URLs. \begin{Desc}
\item[Returns:]true if the file has at least one sub URL. \end{Desc}
\begin{Desc}
\item[See also:]{\bf split}{\rm (p.\,\pageref{classKURL_e0})} \end{Desc}


Definition at line 1206 of file kurl.cpp.

References QString::is\-Empty(), and QString::starts\-With().

Referenced by cd(), encoded\-Html\-Ref(), has\-HTMLRef(), html\-Ref(), is\-Local\-File(), set\-HTMLRef(), split(), and up\-URL().\index{KURL@{KURL}!addPath@{addPath}}
\index{addPath@{addPath}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURL::add\-Path (const {\bf QString} \& {\em \_\-txt})}\label{classKURL_a45}


Adds to the current path. 

Assumes that the current path is a directory. {\tt \_\-txt} 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 {\tt \_\-txt} has a leading '/' then this one is stripped.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-txt}]The text to add. It is considered to be decoded. \end{description}
\end{Desc}


Definition at line 1446 of file kurl.cpp.

References QString::is\-Empty(), QString::length(), and QString::mid().\index{KURL@{KURL}!queryItem@{queryItem}}
\index{queryItem@{queryItem}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURL::query\-Item (const {\bf QString} \& {\em \_\-item}) const}\label{classKURL_a46}


Returns the value of a certain query item. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-item}]Item whose value we want\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the value of the given query item name or QString::null if the specified item does not exist. \end{Desc}


Definition at line 1834 of file kurl.cpp.

References decode\_\-string(), QString::from\-Latin1(), QString::length(), QString::replace(), and QString\-List::split().\index{KURL@{KURL}!queryItems@{queryItems}}
\index{queryItems@{queryItems}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QMap}$<$ {\bf QString}, {\bf QString} $>$ KURL::query\-Items (int {\em options} = 0) const}\label{classKURL_a47}


Returns the list of query items as a map mapping keys to values. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em options}]any of {\bf Query\-Items\-Options}{\rm (p.\,\pageref{classKURL_w4})} {\em ored together.\/}\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]{\em  the map of query items or the empty map if the url has no query items.\/}\end{Desc}
\begin{Desc}
\item[Since:]{\em  3.1 \/}\end{Desc}


Definition at line 1803 of file kurl.cpp.

References decode\_\-string(), QString::from\-Latin1(), QMap$<$ QString, QString $>$::insert(), QString::is\-Empty(), KStd\-Action::name(), QString::replace(), and QString\-List::split().\index{KURL@{KURL}!addQueryItem@{addQueryItem}}
\index{addQueryItem@{addQueryItem}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURL::add\-Query\-Item (const {\bf QString} \& {\em \_\-item}, const {\bf QString} \& {\em \_\-value}, int {\em encoding\_\-hint} = 0)}\label{classKURL_a48}


Add an additional query item. 

To replace an existing query item, the item should first be removed with {\bf remove\-Query\-Item}{\rm (p.\,\pageref{classKURL_a49})}()

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-item}]Name of item to add \item[{\em \_\-value}]Value of item to add \item[{\em encoding\_\-hint}]MIB of encoding to use for \_\-value. \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf QText\-Codec::mib\-Enum()} \end{Desc}


Definition at line 1883 of file kurl.cpp.

References QString::is\-Empty().\index{KURL@{KURL}!removeQueryItem@{removeQueryItem}}
\index{removeQueryItem@{removeQueryItem}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURL::remove\-Query\-Item (const {\bf QString} \& {\em \_\-item})}\label{classKURL_a49}


Remove an item from the query. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-item}]Item to be removed \end{description}
\end{Desc}


Definition at line 1860 of file kurl.cpp.

References QString\-List::join(), QString::length(), and QString\-List::split().\index{KURL@{KURL}!setFileName@{setFileName}}
\index{setFileName@{setFileName}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURL::set\-File\-Name (const {\bf QString} \& {\em \_\-txt})}\label{classKURL_a50}


Sets the filename of the path. 

In comparison to {\bf add\-Path}{\rm (p.\,\pageref{classKURL_a45})}() this function does not assume that the current path is a directory. This is only assumed if the current path ends with '/'.

Any reference is reset.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-txt}]The filename to be set. It is considered to be decoded. If the current path ends with '/' then {\tt \_\-txt} int just appended, otherwise all text behind the last '/' in the current path is erased and {\tt \_\-txt} is appended then. It does not matter whether {\tt \_\-txt} starts with '/' or not. \end{description}
\end{Desc}


Definition at line 999 of file kurl.cpp.

References clean\-Path(), encode\_\-string(), QString::find\-Rev(), QString::is\-Empty(), QString::mid(), path(), QString::right(), set\-Encoded\-Path(), set\-Path(), and QString::truncate().\index{KURL@{KURL}!fileName@{fileName}}
\index{fileName@{fileName}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURL::file\-Name (bool {\em \_\-ignore\_\-trailing\_\-slash\_\-in\_\-path} = true) const}\label{classKURL_a51}


Returns the filename of the path. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-ignore\_\-trailing\_\-slash\_\-in\_\-path}]This tells whether a trailing '/' should be ignored. This means that the function would return \char`\"{}torben\char`\"{} for {\tt {\tt file:/hallo/torben/}} and {\tt {\tt file:/hallo/torben}}. If the flag is set to false, then everything behind the last '/' is considered to be the filename. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The filename of the current path. The returned string is decoded. Null if there is no file (and thus no path). \end{Desc}


Definition at line 1392 of file kurl.cpp.

References QString::contains(), QString::find\-Rev(), QString::is\-Empty(), QString::left(), QString::length(), QString::mid(), and path().\index{KURL@{KURL}!directory@{directory}}
\index{directory@{directory}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURL::directory (bool {\em \_\-strip\_\-trailing\_\-slash\_\-from\_\-result} = true, bool {\em \_\-ignore\_\-trailing\_\-slash\_\-in\_\-path} = true) const}\label{classKURL_a52}


Returns the directory of the path. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-strip\_\-trailing\_\-slash\_\-from\_\-result}]tells whether the returned result should end with '/' or not. If the path is empty or just \char`\"{}/\char`\"{} then this flag has no effect. \item[{\em \_\-ignore\_\-trailing\_\-slash\_\-in\_\-path}]means that {\tt {\tt file:/hallo/torben}} and {\tt {\tt file:/hallo/torben/}\char`\"{}} would both return {\tt /hallo/} or {\tt /hallo} depending on the other flag \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The directory part of the current path. Everything between the last and the second last '/' is returned. For example {\tt {\tt file:/hallo/torben/}} would return \char`\"{}/hallo/torben/\char`\"{} while {\tt {\tt file:/hallo/torben}} would return \char`\"{}hallo/\char`\"{}. The returned string is decoded. QString::null is returned when there is no path. \end{Desc}


Definition at line 1474 of file kurl.cpp.

References QString::find\-Rev(), QString::is\-Empty(), and QString::left().

Referenced by KConfig\-INIBack\-End::parse\-Config\-Files(), and KConfig\-INIBack\-End::sync().\index{KURL@{KURL}!cd@{cd}}
\index{cd@{cd}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURL::cd (const {\bf QString} \& {\em \_\-dir})}\label{classKURL_a53}


Changes the directory by descending into the given directory. 

It is assumed the current URL represents a directory. If {\tt dir} starts with a \char`\"{}/\char`\"{} the current URL will be \char`\"{}protocol://host/dir\char`\"{} otherwise {\tt \_\-dir} will be appended to the path. {\tt \_\-dir} can be \char`\"{}..\char`\"{} This function won't strip protocols. That means that when you are in {\tt file:/dir/dir2/my.tgz\#tar:/} and you do cd(\char`\"{}..\char`\"{}) you will still be in {\tt file:/dir/dir2/my.tgz\#tar:/}

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-dir}]the directory to change to \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful \end{Desc}


Definition at line 1508 of file kurl.cpp.

References has\-Sub\-URL(), QDir::home\-Dir\-Path(), QString::is\-Empty(), join(), QValue\-List$<$ KURL $>$::last(), QString::length(), path(), QString::right(), set\-HTMLRef(), set\-Path(), and split().

Referenced by up\-URL().\index{KURL@{KURL}!url@{url}}
\index{url@{url}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURL::url (int {\em \_\-trailing} = 0, int {\em encoding\_\-hint} = 0) const}\label{classKURL_a54}


Returns the URL as string. 

\begin{Desc}
\item[Returns:]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.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-trailing}]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. \item[{\em encoding\_\-hint}]MIB of encoding to use. \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf QText\-Codec::mib\-Enum()} \end{Desc}


Definition at line 1225 of file kurl.cpp.

References encoded\-Path\-And\-Query(), QString::find(), has\-Host(), has\-Pass(), has\-Ref(), has\-User(), QString::is\-Empty(), and QString::sprintf().

Referenced by from\-Path\-Or\-URL(), join(), KURL(), KDesktop\-File::read\-URL(), and split().\index{KURL@{KURL}!prettyURL@{prettyURL}}
\index{prettyURL@{prettyURL}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURL::pretty\-URL (int {\em \_\-trailing} = 0) const}\label{classKURL_a55}


Returns the URL as string in human-friendly format. 

Example: {\tt http://localhost:8080/test.cgi?test=hello} world\&name=fred \begin{Desc}
\item[Returns:]A human readable URL, with no non-necessary encodings/escaped characters. Password will not be shown. \end{Desc}


Definition at line 1275 of file kurl.cpp.

References QString::find(), has\-Host(), has\-Ref(), has\-User(), QString::is\-Empty(), QString::is\-Null(), and QString::sprintf().

Referenced by html\-URL(), and pretty\-URL().\index{KURL@{KURL}!htmlURL@{htmlURL}}
\index{htmlURL@{htmlURL}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURL::html\-URL () const}\label{classKURL_a56}


Returns the URL as string, escaped for HTML. 

\begin{Desc}
\item[Returns:]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. \end{Desc}


Definition at line 1331 of file kurl.cpp.

References QStyle\-Sheet::escape(), and pretty\-URL().\index{KURL@{KURL}!prettyURL@{prettyURL}}
\index{prettyURL@{prettyURL}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURL::pretty\-URL (int {\em \_\-trailing}, Adjustement\-Flags {\em \_\-flags}) const}\label{classKURL_a57}


Returns the URL as string, escaped for HTML. 

Example: {\tt http://localhost:8080/test.cgi?test=hello} world\&name=fred \begin{Desc}
\item[Returns:]A human readable URL, with no non-necessary encodings/escaped characters. Password will not be shown. \end{Desc}


Definition at line 1323 of file kurl.cpp.

References pretty\-URL(), QString::remove(), and QString::starts\-With().\index{KURL@{KURL}!isEmpty@{isEmpty}}
\index{isEmpty@{isEmpty}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURL::is\-Empty () const}\label{classKURL_a58}


Test to see if the KURL is empty. 

\begin{Desc}
\item[Returns:]true if the URL is empty \end{Desc}


Definition at line 561 of file kurl.cpp.

References QString::is\-Empty().

Referenced by KApplication::authorize\-URLAction(), and set\-Path().\index{KURL@{KURL}!upURL@{upURL}}
\index{upURL@{upURL}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KURL} KURL::up\-URL () const}\label{classKURL_a59}


This function is useful to implement the \char`\"{}Up\char`\"{} button in a file manager for example. 

{\bf cd}{\rm (p.\,\pageref{classKURL_a53})}() never strips a sub-protocol. That means that if you are in {\tt file:/home/x.tgz\#gzip:/\#tar:/} and hit the up button you expect to see {\tt 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. \begin{Desc}
\item[Returns:]a URL that is a level higher \end{Desc}


Definition at line 1560 of file kurl.cpp.

References cd(), QValue\-List$<$ KURL $>$::count(), QValue\-List$<$ KURL $>$::from\-Last(), has\-Sub\-URL(), QValue\-List$<$ KURL $>$::is\-Empty(), QString::is\-Empty(), join(), KURL(), QValue\-List$<$ KURL $>$::last(), path(), query(), QValue\-List$<$ KURL $>$::remove(), set\-Query(), and split().\index{KURL@{KURL}!cmp@{cmp}}
\index{cmp@{cmp}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURL::cmp (const {\bf KURL} \& {\em u}, bool {\em ignore\_\-trailing} = false) const}\label{classKURL_a68}


The same as {\bf equals()}{\rm (p.\,\pageref{classKURL_a69})}, just with a less obvious name. 

Compares this url with {\tt u}. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ignore\_\-trailing}]set to true to ignore trailing '/' characters. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if both urls are the same \end{Desc}
\begin{Desc}
\item[See also:]operator==. This function should be used if you want to ignore trailing '/' characters. {\bf This class or method is obsolete, it is provided for compatibility only.} \end{Desc}


Definition at line 935 of file kurl.cpp.

References equals().\index{KURL@{KURL}!equals@{equals}}
\index{equals@{equals}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURL::equals (const {\bf KURL} \& {\em u}, bool {\em ignore\_\-trailing} = false) const}\label{classKURL_a69}


Compares this url with {\tt u}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ignore\_\-trailing}]set to true to ignore trailing '/' characters. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if both urls are the same \end{Desc}
\begin{Desc}
\item[See also:]operator==. This function should be used if you want to ignore trailing '/' characters. \end{Desc}
\begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 940 of file kurl.cpp.

References is\-Malformed(), m\_\-i\-Port, m\_\-str\-Host, m\_\-str\-Pass, m\_\-str\-Protocol, m\_\-str\-Query\_\-encoded, m\_\-str\-Ref\_\-encoded, m\_\-str\-User, and path().

Referenced by cmp().\index{KURL@{KURL}!isParentOf@{isParentOf}}
\index{isParentOf@{isParentOf}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURL::is\-Parent\-Of (const {\bf KURL} \& {\em u}) const}\label{classKURL_a70}


Checks whether the given URL is parent of this URL. 

For instance, {\tt ftp://host/dir/} is a parent of {\tt ftp://host/dir/subdir/subsubdir/.} \begin{Desc}
\item[Returns:]true if this url is a parent of {\tt u} (or the same URL as {\tt u}) \end{Desc}


Definition at line 967 of file kurl.cpp.

References QString::is\-Empty(), is\-Malformed(), QString::length(), m\_\-i\-Port, m\_\-str\-Host, m\_\-str\-Pass, m\_\-str\-Protocol, m\_\-str\-Query\_\-encoded, m\_\-str\-Ref\_\-encoded, m\_\-str\-User, path(), and QString::starts\-With().\index{KURL@{KURL}!split@{split}}
\index{split@{split}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KURL::List} KURL::split (const {\bf QString} \& {\em \_\-url})\hspace{0.3cm}{\tt  [static]}}\label{classKURL_e0}


Splits nested URLs like {\tt file:/home/weis/kde.tgz\#gzip:/\#tar:/kdebase} A URL like {\tt http://www.kde.org\#tar:/kde/README.hml\#ref1} will be split in {\tt http://www.kde.org} and tar:/kde/README.html\#ref1. 

That means in turn that \char`\"{}\#ref1\char`\"{} 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.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-url}]The URL that has to be split. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]An empty list on error or the list of split URLs. \end{Desc}
\begin{Desc}
\item[See also:]{\bf has\-Sub\-URL}{\rm (p.\,\pageref{classKURL_a44})} \end{Desc}


Definition at line 1368 of file kurl.cpp.

References KURL().

Referenced by cd(), encoded\-Html\-Ref(), has\-HTMLRef(), html\-Ref(), set\-HTMLRef(), and up\-URL().\index{KURL@{KURL}!split@{split}}
\index{split@{split}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KURL::List} KURL::split (const {\bf KURL} \& {\em \_\-url})\hspace{0.3cm}{\tt  [static]}}\label{classKURL_e1}


Splits nested URLs like {\tt file:/home/weis/kde.tgz\#gzip:/\#tar:/kdebase} A URL like {\tt http://www.kde.org\#tar:/kde/README.hml\#ref1} will be split in {\tt http://www.kde.org} and tar:/kde/README.html\#ref1. 

That means in turn that \char`\"{}\#ref1\char`\"{} 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.

\begin{Desc}
\item[Returns:]An empty list on error or the list of split URLs.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-url}]The URL that has to be split. \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf has\-Sub\-URL}{\rm (p.\,\pageref{classKURL_a44})} \end{Desc}


Definition at line 1336 of file kurl.cpp.

References QValue\-List$<$ KURL $>$::append(), QValue\-List$<$ KURL $>$::begin(), QValue\-List$<$ KURL $>$::end(), has\-Sub\-URL(), QValue\-List$<$ KURL $>$::Iterator(), KURL(), m\_\-str\-Ref\_\-encoded, ref(), and url().\index{KURL@{KURL}!join@{join}}
\index{join@{join}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KURL} KURL::join (const {\bf List} \& {\em \_\-list})\hspace{0.3cm}{\tt  [static]}}\label{classKURL_e2}


Reverses {\bf split}{\rm (p.\,\pageref{classKURL_e0})}(). 

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. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-list}]the list to join \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the joined URL \end{Desc}


Definition at line 1373 of file kurl.cpp.

References QValue\-List$<$ KURL $>$::Const\-Iterator(), QValue\-List$<$ KURL $>$::end(), QValue\-List$<$ KURL $>$::from\-Last(), QValue\-List$<$ KURL $>$::is\-Empty(), KURL(), m\_\-str\-Ref\_\-encoded, and url().

Referenced by cd(), set\-HTMLRef(), and up\-URL().\index{KURL@{KURL}!fromPathOrURL@{fromPathOrURL}}
\index{fromPathOrURL@{fromPathOrURL}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KURL} KURL::from\-Path\-Or\-URL (const {\bf QString} \& {\em text})\hspace{0.3cm}{\tt  [static]}}\label{classKURL_e3}


Creates a KURL object from a {\bf QString} representing either an absolute path or a real URL. 

Use this method instead of \small\begin{alltt}
 {\bf QString} someDir = ...
 KURL url = someDir;
 \end{alltt}\normalsize 


Otherwise some characters (e.g. the '\#') won't be encoded properly. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]the string representation of the URL to convert \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the new KURL \end{Desc}
\begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 1894 of file kurl.cpp.

References QString::is\-Empty(), KURL(), set\-Path(), and url().\index{KURL@{KURL}!encode_string@{encode\_\-string}}
\index{encode_string@{encode\_\-string}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURL::encode\_\-string (const {\bf QString} \& {\em str}, int {\em encoding\_\-hint} = 0)\hspace{0.3cm}{\tt  [static]}}\label{classKURL_e4}


Convenience function. 

Convert unicoded string to local encoding and use -style encoding for all common delimiters / non-ascii characters. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em str}]String to encode (can be QString::null). \item[{\em encoding\_\-hint}]MIB of encoding to use. \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf QText\-Codec::mib\-Enum()} \end{Desc}
\begin{Desc}
\item[Returns:]the encoded string \end{Desc}


Definition at line 1739 of file kurl.cpp.

Referenced by set\-File\-Encoding(), and set\-File\-Name().\index{KURL@{KURL}!encode_string_no_slash@{encode\_\-string\_\-no\_\-slash}}
\index{encode_string_no_slash@{encode\_\-string\_\-no\_\-slash}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURL::encode\_\-string\_\-no\_\-slash (const {\bf QString} \& {\em str}, int {\em encoding\_\-hint} = 0)\hspace{0.3cm}{\tt  [static]}}\label{classKURL_e5}


Convenience function. 

Convert unicoded string to local encoding and use -style encoding for all common delimiters / non-ascii characters as well as the slash '/'. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em str}]String to encode \item[{\em encoding\_\-hint}]MIB of encoding to use. \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf QText\-Codec::mib\-Enum()} \end{Desc}


Definition at line 1744 of file kurl.cpp.\index{KURL@{KURL}!decode_string@{decode\_\-string}}
\index{decode_string@{decode\_\-string}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURL::decode\_\-string (const {\bf QString} \& {\em str}, int {\em encoding\_\-hint} = 0)\hspace{0.3cm}{\tt  [static]}}\label{classKURL_e6}


Convenience function. 

Decode -style encoding and convert from local encoding to unicode.

Reverse of {\bf encode\_\-string()}{\rm (p.\,\pageref{classKURL_e4})} \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em str}]String to decode (can be QString::null). \item[{\em encoding\_\-hint}]MIB of original encoding of {\tt str} . \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf QText\-Codec::mib\-Enum()} \end{Desc}


Definition at line 1734 of file kurl.cpp.

Referenced by file\-Encoding(), KApplication::invoke\-Mailer(), query\-Item(), query\-Items(), and set\-File\-Encoding().\index{KURL@{KURL}!isRelativeURL@{isRelativeURL}}
\index{isRelativeURL@{isRelativeURL}!KURL@{KURL}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURL::is\-Relative\-URL (const {\bf QString} \& {\em \_\-url})\hspace{0.3cm}{\tt  [static]}}\label{classKURL_e7}


Convenience function. 

Returns whether '\_\-url' is likely to be a \char`\"{}relative\char`\"{} URL instead of an \char`\"{}absolute\char`\"{} URL. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-url}]URL to examine \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true when the URL is likely to be \char`\"{}relative\char`\"{}, false otherwise. \end{Desc}


Definition at line 348 of file kurl.cpp.

References QChar::latin1(), QString::length(), and QString::unicode().

Referenced by KURL(), and KCmd\-Line\-Args::make\-URL().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kurl.h\item 
kurl.cpp\end{CompactItemize}
