source: s10k/CommonLibs/quazip-0.7.2/doc/latex/classQuaZIODevice.tex@ 1109

Last change on this file since 1109 was 1096, checked in by s10k, 7 years ago

Added zlib, quazip, basicxmlsyntaxhighlighter, conditionalsemaphore and linenumberdisplay libraries. zlib and quazip are pre-compiled, but you can compile them yourself, just delete the dll files (or equivalent binary files to your OS)

File size: 6.6 KB
Line 
1\section{QuaZIODevice Class Reference}
2\label{classQuaZIODevice}\index{QuaZIODevice@{QuaZIODevice}}
3
4
5A class to compress/decompress {\bf QIODevice}.
6
7
8
9
10{\ttfamily \#include $<$quaziodevice.h$>$}
11
12
13
14Inheritance diagram for QuaZIODevice:
15\nopagebreak
16\begin{figure}[H]
17\begin{center}
18\leavevmode
19\includegraphics[width=122pt]{classQuaZIODevice__inherit__graph}
20\end{center}
21\end{figure}
22
23
24Collaboration diagram for QuaZIODevice:
25\nopagebreak
26\begin{figure}[H]
27\begin{center}
28\leavevmode
29\includegraphics[width=122pt]{classQuaZIODevice__coll__graph}
30\end{center}
31\end{figure}
32\subsection*{Public Member Functions}
33\begin{DoxyCompactItemize}
34\item
35{\bf QuaZIODevice} ({\bf QIODevice} $\ast$io, {\bf QObject} $\ast${\bf parent}=NULL)
36\begin{DoxyCompactList}\small\item\em Constructor. \end{DoxyCompactList}\item
37{\bf $\sim$QuaZIODevice} ()\label{classQuaZIODevice_ab3524cef44c240c21e6b7680ee5f42de}
38
39\begin{DoxyCompactList}\small\item\em Destructor. \end{DoxyCompactList}\item
40virtual bool {\bf flush} ()
41\begin{DoxyCompactList}\small\item\em Flushes data waiting to be written. \end{DoxyCompactList}\item
42virtual bool {\bf open} ({\bf QIODevice::OpenMode} mode)
43\begin{DoxyCompactList}\small\item\em Opens the device. \end{DoxyCompactList}\item
44virtual void {\bf close} ()
45\begin{DoxyCompactList}\small\item\em Closes this device, but not the underlying one. \end{DoxyCompactList}\item
46{\bf QIODevice} $\ast$ {\bf getIoDevice} () const \label{classQuaZIODevice_ad63e7f1717c7d91b3c2c5ace908c98b7}
47
48\begin{DoxyCompactList}\small\item\em Returns the underlying device. \end{DoxyCompactList}\item
49virtual bool {\bf isSequential} () const \label{classQuaZIODevice_af2697f58c228741d3715801bf48a9a8b}
50
51\begin{DoxyCompactList}\small\item\em Returns true. \end{DoxyCompactList}\item
52virtual bool {\bf atEnd} () const \label{classQuaZIODevice_ae727c48089ca1b161323ec8423a653ab}
53
54\begin{DoxyCompactList}\small\item\em Returns true iff the end of the compressed stream is reached. \end{DoxyCompactList}\item
55virtual qint64 {\bf bytesAvailable} () const \label{classQuaZIODevice_ac18b45c3d7009c8d231b13fe994ebcb9}
56
57\begin{DoxyCompactList}\small\item\em Returns the number of the bytes buffered. \end{DoxyCompactList}\end{DoxyCompactItemize}
58\subsection*{Protected Member Functions}
59\begin{DoxyCompactItemize}
60\item
61virtual qint64 {\bf readData} (char $\ast$data, qint64 maxSize)\label{classQuaZIODevice_aa12b8bc9c923e543eda9ae22dbd1ecbb}
62
63\begin{DoxyCompactList}\small\item\em Implementation of {\bf QIODevice::readData()}. \end{DoxyCompactList}\item
64virtual qint64 {\bf writeData} (const char $\ast$data, qint64 maxSize)\label{classQuaZIODevice_aab23b6badbc3548eb71ca86bf6211902}
65
66\begin{DoxyCompactList}\small\item\em Implementation of {\bf QIODevice::writeData()}. \end{DoxyCompactList}\end{DoxyCompactItemize}
67
68
69\subsection{Detailed Description}
70A class to compress/decompress {\bf QIODevice}.
71
72This class can be used to compress any data written to {\bf QIODevice} or decompress it back. Compressing data sent over a QTcpSocket is a good example.
73
74\subsection{Constructor \& Destructor Documentation}
75\index{QuaZIODevice@{QuaZIODevice}!QuaZIODevice@{QuaZIODevice}}
76\index{QuaZIODevice@{QuaZIODevice}!QuaZIODevice@{QuaZIODevice}}
77\subsubsection[{QuaZIODevice}]{\setlength{\rightskip}{0pt plus 5cm}QuaZIODevice::QuaZIODevice (
78\begin{DoxyParamCaption}
79\item[{{\bf QIODevice} $\ast$}]{io, }
80\item[{{\bf QObject} $\ast$}]{parent = {\ttfamily NULL}}
81\end{DoxyParamCaption}
82)}\label{classQuaZIODevice_a8321ed35ee9b57cf9b1104912e236361}
83
84
85Constructor.
86
87
88\begin{DoxyParams}{Parameters}
89{\em io} & The {\bf QIODevice} to read/write. \\
90\hline
91{\em parent} & The parent object, as per {\bf QObject} logic. \\
92\hline
93\end{DoxyParams}
94
95
96References QObject::connect(), and QIODevice::readyRead().
97
98
99
100\subsection{Member Function Documentation}
101\index{QuaZIODevice@{QuaZIODevice}!flush@{flush}}
102\index{flush@{flush}!QuaZIODevice@{QuaZIODevice}}
103\subsubsection[{flush}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZIODevice::flush (
104\begin{DoxyParamCaption}
105{}
106\end{DoxyParamCaption}
107)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaZIODevice_a25f586eb564841b51c395fd17f1cc080}
108
109
110Flushes data waiting to be written.
111
112Unfortunately, as {\bf QIODevice} 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\_\-SYNC\_\-FLUSH mode. If you need the compressed data to actually be flushed from the buffer of the underlying {\bf QIODevice}, you need to call its \doxyref{flush()}{p.}{classQuaZIODevice_a25f586eb564841b51c395fd17f1cc080} method as well, providing it supports it (like QTcpSocket does). Example:
113\begin{DoxyCode}
114 QuaZIODevice dev(&sock);
115 dev.open(QIODevice::Write);
116 dev.write(yourDataGoesHere);
117 dev.flush();
118 sock->flush(); // this actually sends data to network
119\end{DoxyCode}
120
121
122This may change in the future versions of QuaZIP by implementing an ugly hack: trying to cast the {\bf QIODevice} using qobject\_\-cast to known \doxyref{flush()}{p.}{classQuaZIODevice_a25f586eb564841b51c395fd17f1cc080}-\/supporting subclasses, and calling flush if the resulting pointer is not zero.
123
124References QString::fromLocal8Bit(), and QIODevice::setErrorString().
125
126
127
128Referenced by close().
129
130\index{QuaZIODevice@{QuaZIODevice}!open@{open}}
131\index{open@{open}!QuaZIODevice@{QuaZIODevice}}
132\subsubsection[{open}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZIODevice::open (
133\begin{DoxyParamCaption}
134\item[{{\bf QIODevice::OpenMode}}]{mode}
135\end{DoxyParamCaption}
136)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaZIODevice_a175446c18eb20c9aff6faf23f09cc67a}
137
138
139Opens the device.
140
141
142\begin{DoxyParams}{Parameters}
143{\em mode} & Neither QIODevice::ReadWrite nor QIODevice::Append are not supported. \\
144\hline
145\end{DoxyParams}
146
147
148References QIODevice::setErrorString(), and QObject::trUtf8().
149
150\index{QuaZIODevice@{QuaZIODevice}!close@{close}}
151\index{close@{close}!QuaZIODevice@{QuaZIODevice}}
152\subsubsection[{close}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZIODevice::close (
153\begin{DoxyParamCaption}
154{}
155\end{DoxyParamCaption}
156)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaZIODevice_ad27e447544d57f897316ee6f44535895}
157
158
159Closes this device, but not the underlying one.
160
161The underlying {\bf QIODevice} is not closed in case you want to write something else to it.
162
163Reimplemented from {\bf QIODevice}.
164
165
166
167References flush(), QIODevice::openMode(), and QIODevice::setErrorString().
168
169
170
171Referenced by $\sim$QuaZIODevice().
172
173
174
175The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
176\item
177quazip/quaziodevice.h\item
178quazip/quaziodevice.cpp\end{DoxyCompactItemize}
Note: See TracBrowser for help on using the repository browser.