\section{Qua\-Z\-I\-O\-Device Class Reference}
\label{classQuaZIODevice}\index{Qua\-Z\-I\-O\-Device@{Qua\-Z\-I\-O\-Device}}


A class to compress/decompress Q\-I\-O\-Device.  




{\ttfamily \#include $<$quaziodevice.\-h$>$}



Inheritance diagram for Qua\-Z\-I\-O\-Device\-:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=126pt]{classQuaZIODevice__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for Qua\-Z\-I\-O\-Device\-:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=126pt]{classQuaZIODevice__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
{\bf Qua\-Z\-I\-O\-Device} (Q\-I\-O\-Device $\ast$io, Q\-Object $\ast$parent=N\-U\-L\-L)
\begin{DoxyCompactList}\small\item\em Constructor. \end{DoxyCompactList}\item 
{\bf $\sim$\-Qua\-Z\-I\-O\-Device} ()\label{classQuaZIODevice_ab3524cef44c240c21e6b7680ee5f42de}

\begin{DoxyCompactList}\small\item\em Destructor. \end{DoxyCompactList}\item 
virtual bool {\bf flush} ()
\begin{DoxyCompactList}\small\item\em Flushes data waiting to be written. \end{DoxyCompactList}\item 
virtual bool {\bf open} (Q\-I\-O\-Device\-::\-Open\-Mode mode)
\begin{DoxyCompactList}\small\item\em Opens the device. \end{DoxyCompactList}\item 
virtual void {\bf close} ()
\begin{DoxyCompactList}\small\item\em Closes this device, but not the underlying one. \end{DoxyCompactList}\item 
Q\-I\-O\-Device $\ast$ {\bf get\-Io\-Device} () const \label{classQuaZIODevice_ad63e7f1717c7d91b3c2c5ace908c98b7}

\begin{DoxyCompactList}\small\item\em Returns the underlying device. \end{DoxyCompactList}\item 
virtual bool {\bf is\-Sequential} () const \label{classQuaZIODevice_af2697f58c228741d3715801bf48a9a8b}

\begin{DoxyCompactList}\small\item\em Returns true. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual qint64 {\bf read\-Data} (char $\ast$data, qint64 max\-Size)\label{classQuaZIODevice_aa12b8bc9c923e543eda9ae22dbd1ecbb}

\begin{DoxyCompactList}\small\item\em Implementation of Q\-I\-O\-Device\-::read\-Data(). \end{DoxyCompactList}\item 
virtual qint64 {\bf write\-Data} (const char $\ast$data, qint64 max\-Size)\label{classQuaZIODevice_aab23b6badbc3548eb71ca86bf6211902}

\begin{DoxyCompactList}\small\item\em Implementation of Q\-I\-O\-Device\-::write\-Data(). \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
A class to compress/decompress Q\-I\-O\-Device. 

This class can be used to compress any data written to Q\-I\-O\-Device or decompress it back. Compressing data sent over a Q\-Tcp\-Socket is a good example. 

\subsection{Constructor \& Destructor Documentation}
\index{Qua\-Z\-I\-O\-Device@{Qua\-Z\-I\-O\-Device}!Qua\-Z\-I\-O\-Device@{Qua\-Z\-I\-O\-Device}}
\index{Qua\-Z\-I\-O\-Device@{Qua\-Z\-I\-O\-Device}!QuaZIODevice@{Qua\-Z\-I\-O\-Device}}
\subsubsection[{Qua\-Z\-I\-O\-Device}]{\setlength{\rightskip}{0pt plus 5cm}Qua\-Z\-I\-O\-Device\-::\-Qua\-Z\-I\-O\-Device (
\begin{DoxyParamCaption}
\item[{Q\-I\-O\-Device $\ast$}]{io, }
\item[{Q\-Object $\ast$}]{parent = {\ttfamily NULL}}
\end{DoxyParamCaption}
)}\label{classQuaZIODevice_a8321ed35ee9b57cf9b1104912e236361}


Constructor. 


\begin{DoxyParams}{Parameters}
{\em io} & The Q\-I\-O\-Device to read/write. \\
\hline
{\em parent} & The parent object, as per Q\-Object logic. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\index{Qua\-Z\-I\-O\-Device@{Qua\-Z\-I\-O\-Device}!flush@{flush}}
\index{flush@{flush}!QuaZIODevice@{Qua\-Z\-I\-O\-Device}}
\subsubsection[{flush}]{\setlength{\rightskip}{0pt plus 5cm}bool Qua\-Z\-I\-O\-Device\-::flush (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaZIODevice_a25f586eb564841b51c395fd17f1cc080}


Flushes data waiting to be written. 

Unfortunately, as Q\-I\-O\-Device doesn't support \doxyref{flush()}{p.}{classQuaZIODevice_a25f586eb564841b51c395fd17f1cc080} by itself, the only thing this method does is write the compressed data into the device using Z\-\_\-\-S\-Y\-N\-C\-\_\-\-F\-L\-U\-S\-H mode. If you need the compressed data to actually be flushed from the buffer of the underlying Q\-I\-O\-Device, you need to call its \doxyref{flush()}{p.}{classQuaZIODevice_a25f586eb564841b51c395fd17f1cc080} method as well, providing it supports it (like Q\-Tcp\-Socket does). Example\-: 
\begin{DoxyCode}
QuaZIODevice dev(&sock);
dev.open(QIODevice::Write);
dev.write(yourDataGoesHere);
dev.flush();
sock->flush(); \textcolor{comment}{// this actually sends data to network}
\end{DoxyCode}


This may change in the future versions of Qua\-Z\-I\-P by implementing an ugly hack\-: trying to cast the Q\-I\-O\-Device using qobject\-\_\-cast to known \doxyref{flush()}{p.}{classQuaZIODevice_a25f586eb564841b51c395fd17f1cc080}-\/supporting subclasses, and calling flush if the resulting pointer is not zero. 

Referenced by close().

\index{Qua\-Z\-I\-O\-Device@{Qua\-Z\-I\-O\-Device}!open@{open}}
\index{open@{open}!QuaZIODevice@{Qua\-Z\-I\-O\-Device}}
\subsubsection[{open}]{\setlength{\rightskip}{0pt plus 5cm}bool Qua\-Z\-I\-O\-Device\-::open (
\begin{DoxyParamCaption}
\item[{Q\-I\-O\-Device\-::\-Open\-Mode}]{mode}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaZIODevice_a175446c18eb20c9aff6faf23f09cc67a}


Opens the device. 


\begin{DoxyParams}{Parameters}
{\em mode} & Neither Q\-I\-O\-Device\-::\-Read\-Write nor Q\-I\-O\-Device\-::\-Append are not supported. \\
\hline
\end{DoxyParams}
\index{Qua\-Z\-I\-O\-Device@{Qua\-Z\-I\-O\-Device}!close@{close}}
\index{close@{close}!QuaZIODevice@{Qua\-Z\-I\-O\-Device}}
\subsubsection[{close}]{\setlength{\rightskip}{0pt plus 5cm}void Qua\-Z\-I\-O\-Device\-::close (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaZIODevice_ad27e447544d57f897316ee6f44535895}


Closes this device, but not the underlying one. 

The underlying Q\-I\-O\-Device is not closed in case you want to write something else to it. 

References flush().



Referenced by $\sim$\-Qua\-Z\-I\-O\-Device().



The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
quazip/quaziodevice.\-h\item 
quazip/quaziodevice.\-cpp\end{DoxyCompactItemize}
