\section{KFilter\-Base Class Reference}
\label{classKFilterBase}\index{KFilterBase@{KFilterBase}}
This is the base class for compression filters such as gzip and bzip2.  


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

Inheritance diagram for KFilter\-Base:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=52pt]{classKFilterBase__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KFilter\-Base:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=85pt]{classKFilterBase__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf Result} \{ {\bf OK}, 
{\bf END}, 
{\bf ERROR}
 \}
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
void {\bf set\-Device} ({\bf QIODevice} $\ast$dev, bool autodelete=false)
\item 
{\bf QIODevice} $\ast$ {\bf device} ()
\item 
virtual void {\bf init} (int mode)=0\label{classKFilterBase_a4}

\item 
virtual int {\bf mode} () const =0\label{classKFilterBase_a5}

\item 
virtual void {\bf terminate} ()\label{classKFilterBase_a6}

\item 
virtual void {\bf reset} ()\label{classKFilterBase_a7}

\item 
virtual bool {\bf read\-Header} ()=0\label{classKFilterBase_a8}

\item 
virtual bool {\bf write\-Header} (const {\bf QCString} \&filename)=0\label{classKFilterBase_a9}

\item 
virtual void {\bf set\-Out\-Buffer} (char $\ast$data, uint maxlen)=0\label{classKFilterBase_a10}

\item 
virtual void {\bf set\-In\-Buffer} (const char $\ast$data, uint size)=0\label{classKFilterBase_a11}

\item 
virtual bool {\bf in\-Buffer\-Empty} () const \label{classKFilterBase_a12}

\item 
virtual int {\bf in\-Buffer\-Available} () const =0\label{classKFilterBase_a13}

\item 
virtual bool {\bf out\-Buffer\-Full} () const \label{classKFilterBase_a14}

\item 
virtual int {\bf out\-Buffer\-Available} () const =0\label{classKFilterBase_a15}

\item 
virtual Result {\bf uncompress} ()=0\label{classKFilterBase_a16}

\item 
virtual Result {\bf compress} (bool finish)=0\label{classKFilterBase_a17}

\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static {\bf KFilter\-Base} $\ast$ {\bf find\-Filter\-By\-File\-Name} (const {\bf QString} \&file\-Name)
\item 
static {\bf KFilter\-Base} $\ast$ {\bf find\-Filter\-By\-Mime\-Type} (const {\bf QString} \&mime\-Type)
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKFilterBase_b0}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf QIODevice} $\ast$ {\bf m\_\-dev}\label{classKFilterBase_p0}

\item 
bool {\bf m\_\-b\-Auto\-Del}\label{classKFilterBase_p1}

\end{CompactItemize}


\subsection{Detailed Description}
This is the base class for compression filters such as gzip and bzip2. 

It's pretty much internal. Don't use directly, use {\bf KFilter\-Dev}{\rm (p.\,\pageref{classKFilterDev})} instead. 



Definition at line 38 of file kfilterbase.h.

\subsection{Member Function Documentation}
\index{KFilterBase@{KFilter\-Base}!setDevice@{setDevice}}
\index{setDevice@{setDevice}!KFilterBase@{KFilter\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFilter\-Base::set\-Device ({\bf QIODevice} $\ast$ {\em dev}, bool {\em autodelete} = {\tt false})}\label{classKFilterBase_a2}


Sets the device on which the filter will work. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dev}]the device on which the filter will work \item[{\em autodelete}]if true, {\tt dev} is deleted when the filter is deleted \end{description}
\end{Desc}


Definition at line 36 of file kfilterbase.cpp.

Referenced by KFilter\-Dev::device(), and KFilter\-Dev::device\-For\-File().\index{KFilterBase@{KFilter\-Base}!device@{device}}
\index{device@{device}!KFilterBase@{KFilter\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QIODevice}$\ast$ KFilter\-Base::device ()\hspace{0.3cm}{\tt  [inline]}}\label{classKFilterBase_a3}


Returns the device on which the filter will work. 

\begin{Desc}
\item[Returns:]the device on which the filter will work \end{Desc}


Definition at line 58 of file kfilterbase.h.

Referenced by KFilter\-Dev::at(), KFilter\-Dev::close(), and KFilter\-Dev::open().\index{KFilterBase@{KFilter\-Base}!findFilterByFileName@{findFilterByFileName}}
\index{findFilterByFileName@{findFilterByFileName}!KFilterBase@{KFilter\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KFilter\-Base} $\ast$ KFilter\-Base::find\-Filter\-By\-File\-Name (const {\bf QString} \& {\em file\-Name})\hspace{0.3cm}{\tt  [static]}}\label{classKFilterBase_e0}


Call this to create the appropriate filter for the file named {\tt file\-Name}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em file\-Name}]the name of the file to filter \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the filter for the {\tt file\-Name}, or 0 if not found \end{Desc}


Definition at line 42 of file kfilterbase.cpp.

References endl(), KMime\-Type::find\-By\-Path(), find\-Filter\-By\-Mime\-Type(), and kd\-Debug().

Referenced by KFilter\-Dev::device\-For\-File().\index{KFilterBase@{KFilter\-Base}!findFilterByMimeType@{findFilterByMimeType}}
\index{findFilterByMimeType@{findFilterByMimeType}!KFilterBase@{KFilter\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KFilter\-Base} $\ast$ KFilter\-Base::find\-Filter\-By\-Mime\-Type (const {\bf QString} \& {\em mime\-Type})\hspace{0.3cm}{\tt  [static]}}\label{classKFilterBase_e1}


Call this to create the appropriate filter for the mimetype {\tt mime\-Type}. 

For instance application/x-gzip. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em mime\-Type}]the mime type of the file to filter \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the filter for the {\tt mime\-Type}, or 0 if not found \end{Desc}


Definition at line 49 of file kfilterbase.cpp.

References QValue\-List::begin(), QValue\-List::count(), KLib\-Factory::create(), QValue\-List::end(), endl(), KLib\-Loader::factory(), kd\-Debug(), kd\-Warning(), KTrader::query(), KLib\-Loader::self(), and KTrader::self().

Referenced by KFilter\-Dev::device(), KFilter\-Dev::device\-For\-File(), and find\-Filter\-By\-File\-Name().

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