\section{KRemote\-Encoding Class Reference}
\label{classKRemoteEncoding}\index{KRemoteEncoding@{KRemoteEncoding}}
Allows encoding and decoding properly remote filenames into Unicode. A class for handling remote filenames.  


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

Collaboration diagram for KRemote\-Encoding:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=67pt]{classKRemoteEncoding__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KRemote\-Encoding} (const char $\ast$name=0L)
\item 
virtual {\bf $\sim$KRemote\-Encoding} ()
\item 
{\bf QString} {\bf decode} (const {\bf QCString} \&name) const 
\item 
{\bf QCString} {\bf encode} (const {\bf QString} \&name) const 
\item 
{\bf QCString} {\bf encode} (const {\bf KURL} \&url) const 
\item 
{\bf QCString} {\bf directory} (const {\bf KURL} \&url, bool ignore\_\-trailing\_\-slash=true) const 
\item 
{\bf QCString} {\bf file\-Name} (const {\bf KURL} \&url) const 
\item 
const char $\ast$ {\bf encoding} () const 
\item 
void {\bf set\-Encoding} (const char $\ast$name)
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKRemoteEncoding_b0}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf QText\-Codec} $\ast$ {\bf codec}\label{classKRemoteEncoding_p0}

\end{CompactItemize}


\subsection{Detailed Description}
Allows encoding and decoding properly remote filenames into Unicode. A class for handling remote filenames. 

Certain protocols do not specify an appropriate encoding for decoding their 8-bit data into proper Unicode forms. Therefore, ioslaves should use this class in order to convert those forms into QStrings before creating the respective {\bf KIO::UDSEntry}{\rm (p.\,\pageref{namespaceKIO_a2})}. The same is true for decoding URLs to its components.

Each {\bf KIO::Slave\-Base}{\rm (p.\,\pageref{classKIO_1_1SlaveBase})} has one object of this kind, even if it is not necessary. It can be accessed through {\bf KIO::Slave\-Base::remote\-Encoding}{\rm (p.\,\pageref{classKIO_1_1SlaveBase_a34})}.

\begin{Desc}
\item[Author:]Thiago Macieira $<${\tt thiago.macieira@kdemail.net}$>$ \end{Desc}
\begin{Desc}
\item[Since:]3.3 \end{Desc}




Definition at line 44 of file kremoteencoding.h.

\subsection{Constructor \& Destructor Documentation}
\index{KRemoteEncoding@{KRemote\-Encoding}!KRemoteEncoding@{KRemoteEncoding}}
\index{KRemoteEncoding@{KRemoteEncoding}!KRemoteEncoding@{KRemote\-Encoding}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KRemote\-Encoding::KRemote\-Encoding (const char $\ast$ {\em name} = {\tt 0L})\hspace{0.3cm}{\tt  [explicit]}}\label{classKRemoteEncoding_a0}


Constructor. 

Constructs this object to use the given encoding name. If {\tt name} is a null pointer, the standard encoding will be used. 

Definition at line 25 of file kremoteencoding.cpp.

References set\-Encoding().\index{KRemoteEncoding@{KRemote\-Encoding}!~KRemoteEncoding@{$\sim$KRemoteEncoding}}
\index{~KRemoteEncoding@{$\sim$KRemoteEncoding}!KRemoteEncoding@{KRemote\-Encoding}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KRemote\-Encoding::$\sim${\bf KRemote\-Encoding} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKRemoteEncoding_a1}


Destructor. 



Definition at line 31 of file kremoteencoding.cpp.

\subsection{Member Function Documentation}
\index{KRemoteEncoding@{KRemote\-Encoding}!decode@{decode}}
\index{decode@{decode}!KRemoteEncoding@{KRemote\-Encoding}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KRemote\-Encoding::decode (const {\bf QCString} \& {\em name}) const}\label{classKRemoteEncoding_a2}


Converts the given full pathname or filename to Unicode. 

This function is supposed to work for dirnames, filenames or a full pathname. 

Definition at line 36 of file kremoteencoding.cpp.

References QString::from\-Latin1(), QText\-Codec::from\-Unicode(), KString\-Handler::is\-Utf8(), QText\-Codec::mib\-Enum(), and QText\-Codec::to\-Unicode().\index{KRemoteEncoding@{KRemote\-Encoding}!encode@{encode}}
\index{encode@{encode}!KRemoteEncoding@{KRemote\-Encoding}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QCString} KRemote\-Encoding::encode (const {\bf QString} \& {\em name}) const}\label{classKRemoteEncoding_a3}


Converts the given name from Unicode. 

This function is supposed to work for dirnames, filenames or a full pathname. 

Definition at line 51 of file kremoteencoding.cpp.

References QText\-Codec::from\-Unicode(), QString::latin1(), and QText\-Codec::to\-Unicode().

Referenced by directory(), encode(), and file\-Name().\index{KRemoteEncoding@{KRemote\-Encoding}!encode@{encode}}
\index{encode@{encode}!KRemoteEncoding@{KRemote\-Encoding}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QCString} KRemote\-Encoding::encode (const {\bf KURL} \& {\em url}) const}\label{classKRemoteEncoding_a4}


Converts the given URL into its 8-bit components. 



Definition at line 60 of file kremoteencoding.cpp.

References encode().\index{KRemoteEncoding@{KRemote\-Encoding}!directory@{directory}}
\index{directory@{directory}!KRemoteEncoding@{KRemote\-Encoding}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QCString} KRemote\-Encoding::directory (const {\bf KURL} \& {\em url}, bool {\em ignore\_\-trailing\_\-slash} = {\tt true}) const}\label{classKRemoteEncoding_a5}


Converts the given URL into 8-bit form and separate the dirname from the filename. 

This is useful for slave functions like stat or get.

The dirname is returned with the final slash always stripped 

Definition at line 65 of file kremoteencoding.cpp.

References encode().\index{KRemoteEncoding@{KRemote\-Encoding}!fileName@{fileName}}
\index{fileName@{fileName}!KRemoteEncoding@{KRemote\-Encoding}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QCString} KRemote\-Encoding::file\-Name (const {\bf KURL} \& {\em url}) const}\label{classKRemoteEncoding_a6}


Converts the given URL into 8-bit form and retrieve the filename. 



Definition at line 72 of file kremoteencoding.cpp.

References encode().\index{KRemoteEncoding@{KRemote\-Encoding}!encoding@{encoding}}
\index{encoding@{encoding}!KRemoteEncoding@{KRemote\-Encoding}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ KRemote\-Encoding::encoding () const\hspace{0.3cm}{\tt  [inline]}}\label{classKRemoteEncoding_a7}


Returns the encoding being used. 



Definition at line 96 of file kremoteencoding.h.\index{KRemoteEncoding@{KRemote\-Encoding}!setEncoding@{setEncoding}}
\index{setEncoding@{setEncoding}!KRemoteEncoding@{KRemote\-Encoding}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRemote\-Encoding::set\-Encoding (const char $\ast$ {\em name})}\label{classKRemoteEncoding_a8}


Sets the encoding being used. 

This function does not change the global configuration.

Pass a null pointer in {\tt name} to revert to the standard encoding. 

Definition at line 77 of file kremoteencoding.cpp.

References QText\-Codec::codec\-For\-Mib(), QText\-Codec::codec\-For\-Name(), endl(), k\_\-funcinfo, kd\-Debug(), and QText\-Codec::name().

Referenced by KRemote\-Encoding().

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