source: Vago/Libs/quazip-0.7.2/doc/html/classQuaZIODevice.html@ 1050

Last change on this file since 1050 was 1050, checked in by s10k, 8 years ago
File size: 17.9 KB
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5<title>QuaZIP: QuaZIODevice Class Reference</title>
6<link href="tabs.css" rel="stylesheet" type="text/css"/>
7<link href="doxygen.css" rel="stylesheet" type="text/css"/>
8</head>
9<body>
10<!-- Generated by Doxygen 1.7.4 -->
11<div id="top">
12<div id="titlearea">
13<table cellspacing="0" cellpadding="0">
14 <tbody>
15 <tr style="height: 56px;">
16 <td style="padding-left: 0.5em;">
17 <div id="projectname">QuaZIP&#160;<span id="projectnumber">quazip-0-7-2</span></div>
18 </td>
19 </tr>
20 </tbody>
21</table>
22</div>
23 <div id="navrow1" class="tabs">
24 <ul class="tablist">
25 <li><a href="index.html"><span>Main&#160;Page</span></a></li>
26 <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
27 <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
28 <li><a href="files.html"><span>Files</span></a></li>
29 <li><a href="dirs.html"><span>Directories</span></a></li>
30 </ul>
31 </div>
32 <div id="navrow2" class="tabs2">
33 <ul class="tablist">
34 <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
35 <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
36 <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
37 </ul>
38 </div>
39</div>
40<div class="header">
41 <div class="summary">
42<a href="#pub-methods">Public Member Functions</a> &#124;
43<a href="#pro-methods">Protected Member Functions</a> </div>
44 <div class="headertitle">
45<div class="title">QuaZIODevice Class Reference</div> </div>
46</div>
47<div class="contents">
48<!-- doxytag: class="QuaZIODevice" --><!-- doxytag: inherits="QIODevice" -->
49<p>A class to compress/decompress <a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qiodevice.html">QIODevice</a>.
50 <a href="classQuaZIODevice.html#details">More...</a></p>
51
52<p><code>#include &lt;<a class="el" href="quaziodevice_8h_source.html">quaziodevice.h</a>&gt;</code></p>
53<div class="dynheader">
54Inheritance diagram for QuaZIODevice:</div>
55<div class="dyncontent">
56<div class="center"><img src="classQuaZIODevice__inherit__graph.png" border="0" usemap="#QuaZIODevice_inherit__map" alt="Inheritance graph"/></div>
57<map name="QuaZIODevice_inherit__map" id="QuaZIODevice_inherit__map">
58<area shape="rect" id="node2" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qiodevice.html" title="QIODevice" alt="" coords="16,80,99,107"/>
59<area shape="rect" id="node4" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qobject.html" title="QObject" alt="" coords="22,5,92,32"/>
60</map>
61<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
62<div class="dynheader">
63Collaboration diagram for QuaZIODevice:</div>
64<div class="dyncontent">
65<div class="center"><img src="classQuaZIODevice__coll__graph.png" border="0" usemap="#QuaZIODevice_coll__map" alt="Collaboration graph"/></div>
66<map name="QuaZIODevice_coll__map" id="QuaZIODevice_coll__map">
67<area shape="rect" id="node2" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qiodevice.html" title="QIODevice" alt="" coords="16,80,99,107"/>
68<area shape="rect" id="node4" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qobject.html" title="QObject" alt="" coords="22,5,92,32"/>
69</map>
70<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
71
72<p><a href="classQuaZIODevice-members.html">List of all members.</a></p>
73<table class="memberdecls">
74<tr><td colspan="2"><h2><a name="pub-methods"></a>
75Public Member Functions</h2></td></tr>
76<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQuaZIODevice.html#a8321ed35ee9b57cf9b1104912e236361">QuaZIODevice</a> (<a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qiodevice.html">QIODevice</a> *io, <a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qobject.html">QObject</a> *<a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qobject.html#parent">parent</a>=NULL)</td></tr>
77<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor. <a href="#a8321ed35ee9b57cf9b1104912e236361"></a><br/></td></tr>
78<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab3524cef44c240c21e6b7680ee5f42de"></a><!-- doxytag: member="QuaZIODevice::~QuaZIODevice" ref="ab3524cef44c240c21e6b7680ee5f42de" args="()" -->
79&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQuaZIODevice.html#ab3524cef44c240c21e6b7680ee5f42de">~QuaZIODevice</a> ()</td></tr>
80<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <br/></td></tr>
81<tr><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQuaZIODevice.html#a25f586eb564841b51c395fd17f1cc080">flush</a> ()</td></tr>
82<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Flushes data waiting to be written. <a href="#a25f586eb564841b51c395fd17f1cc080"></a><br/></td></tr>
83<tr><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQuaZIODevice.html#a175446c18eb20c9aff6faf23f09cc67a">open</a> (<a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qiodevice.html#OpenModeFlag-enum">QIODevice::OpenMode</a> mode)</td></tr>
84<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Opens the device. <a href="#a175446c18eb20c9aff6faf23f09cc67a"></a><br/></td></tr>
85<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQuaZIODevice.html#ad27e447544d57f897316ee6f44535895">close</a> ()</td></tr>
86<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Closes this device, but not the underlying one. <a href="#ad27e447544d57f897316ee6f44535895"></a><br/></td></tr>
87<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad63e7f1717c7d91b3c2c5ace908c98b7"></a><!-- doxytag: member="QuaZIODevice::getIoDevice" ref="ad63e7f1717c7d91b3c2c5ace908c98b7" args="() const " -->
88<a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qiodevice.html">QIODevice</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQuaZIODevice.html#ad63e7f1717c7d91b3c2c5ace908c98b7">getIoDevice</a> () const </td></tr>
89<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the underlying device. <br/></td></tr>
90<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af2697f58c228741d3715801bf48a9a8b"></a><!-- doxytag: member="QuaZIODevice::isSequential" ref="af2697f58c228741d3715801bf48a9a8b" args="() const " -->
91virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQuaZIODevice.html#af2697f58c228741d3715801bf48a9a8b">isSequential</a> () const </td></tr>
92<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true. <br/></td></tr>
93<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae727c48089ca1b161323ec8423a653ab"></a><!-- doxytag: member="QuaZIODevice::atEnd" ref="ae727c48089ca1b161323ec8423a653ab" args="() const " -->
94virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQuaZIODevice.html#ae727c48089ca1b161323ec8423a653ab">atEnd</a> () const </td></tr>
95<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true iff the end of the compressed stream is reached. <br/></td></tr>
96<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac18b45c3d7009c8d231b13fe994ebcb9"></a><!-- doxytag: member="QuaZIODevice::bytesAvailable" ref="ac18b45c3d7009c8d231b13fe994ebcb9" args="() const " -->
97virtual qint64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQuaZIODevice.html#ac18b45c3d7009c8d231b13fe994ebcb9">bytesAvailable</a> () const </td></tr>
98<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of the bytes buffered. <br/></td></tr>
99<tr><td colspan="2"><h2><a name="pro-methods"></a>
100Protected Member Functions</h2></td></tr>
101<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa12b8bc9c923e543eda9ae22dbd1ecbb"></a><!-- doxytag: member="QuaZIODevice::readData" ref="aa12b8bc9c923e543eda9ae22dbd1ecbb" args="(char *data, qint64 maxSize)" -->
102virtual qint64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQuaZIODevice.html#aa12b8bc9c923e543eda9ae22dbd1ecbb">readData</a> (char *data, qint64 maxSize)</td></tr>
103<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Implementation of <a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qiodevice.html#readData">QIODevice::readData()</a>. <br/></td></tr>
104<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aab23b6badbc3548eb71ca86bf6211902"></a><!-- doxytag: member="QuaZIODevice::writeData" ref="aab23b6badbc3548eb71ca86bf6211902" args="(const char *data, qint64 maxSize)" -->
105virtual qint64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQuaZIODevice.html#aab23b6badbc3548eb71ca86bf6211902">writeData</a> (const char *data, qint64 maxSize)</td></tr>
106<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Implementation of <a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qiodevice.html#writeData">QIODevice::writeData()</a>. <br/></td></tr>
107</table>
108<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
109<div class="textblock"><p>A class to compress/decompress <a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qiodevice.html">QIODevice</a>. </p>
110<p>This class can be used to compress any data written to <a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qiodevice.html">QIODevice</a> or decompress it back. Compressing data sent over a QTcpSocket is a good example. </p>
111</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
112<a class="anchor" id="a8321ed35ee9b57cf9b1104912e236361"></a><!-- doxytag: member="QuaZIODevice::QuaZIODevice" ref="a8321ed35ee9b57cf9b1104912e236361" args="(QIODevice *io, QObject *parent=NULL)" -->
113<div class="memitem">
114<div class="memproto">
115 <table class="memname">
116 <tr>
117 <td class="memname">QuaZIODevice::QuaZIODevice </td>
118 <td>(</td>
119 <td class="paramtype"><a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qiodevice.html">QIODevice</a> *&#160;</td>
120 <td class="paramname"><em>io</em>, </td>
121 </tr>
122 <tr>
123 <td class="paramkey"></td>
124 <td></td>
125 <td class="paramtype"><a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qobject.html">QObject</a> *&#160;</td>
126 <td class="paramname"><em>parent</em> = <code>NULL</code>&#160;</td>
127 </tr>
128 <tr>
129 <td></td>
130 <td>)</td>
131 <td></td><td></td>
132 </tr>
133 </table>
134</div>
135<div class="memdoc">
136
137<p>Constructor. </p>
138<dl><dt><b>Parameters:</b></dt><dd>
139 <table class="params">
140 <tr><td class="paramname">io</td><td>The <a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qiodevice.html">QIODevice</a> to read/write. </td></tr>
141 <tr><td class="paramname">parent</td><td>The parent object, as per <a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qobject.html">QObject</a> logic. </td></tr>
142 </table>
143 </dd>
144</dl>
145
146<p>References <a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qobject.html#connect">QObject::connect()</a>, and <a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qiodevice.html#readyRead">QIODevice::readyRead()</a>.</p>
147
148</div>
149</div>
150<hr/><h2>Member Function Documentation</h2>
151<a class="anchor" id="a25f586eb564841b51c395fd17f1cc080"></a><!-- doxytag: member="QuaZIODevice::flush" ref="a25f586eb564841b51c395fd17f1cc080" args="()" -->
152<div class="memitem">
153<div class="memproto">
154 <table class="memname">
155 <tr>
156 <td class="memname">bool QuaZIODevice::flush </td>
157 <td>(</td>
158 <td class="paramname"></td><td>)</td>
159 <td><code> [virtual]</code></td>
160 </tr>
161 </table>
162</div>
163<div class="memdoc">
164
165<p>Flushes data waiting to be written. </p>
166<p>Unfortunately, as <a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qiodevice.html">QIODevice</a> doesn't support <a class="el" href="classQuaZIODevice.html#a25f586eb564841b51c395fd17f1cc080" title="Flushes data waiting to be written.">flush()</a> 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 <a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qiodevice.html">QIODevice</a>, you need to call its <a class="el" href="classQuaZIODevice.html#a25f586eb564841b51c395fd17f1cc080" title="Flushes data waiting to be written.">flush()</a> method as well, providing it supports it (like QTcpSocket does). Example: </p>
167<div class="fragment"><pre class="fragment"> <a class="code" href="classQuaZIODevice.html" title="A class to compress/decompress QIODevice.">QuaZIODevice</a> dev(&amp;sock);
168 dev.open(QIODevice::Write);
169 dev.write(yourDataGoesHere);
170 dev.flush();
171 sock-&gt;flush(); <span class="comment">// this actually sends data to network</span>
172</pre></div><p>This may change in the future versions of QuaZIP by implementing an ugly hack: trying to cast the <a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qiodevice.html">QIODevice</a> using qobject_cast to known <a class="el" href="classQuaZIODevice.html#a25f586eb564841b51c395fd17f1cc080" title="Flushes data waiting to be written.">flush()</a>-supporting subclasses, and calling flush if the resulting pointer is not zero. </p>
173
174<p>References <a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qstring.html#fromLocal8Bit">QString::fromLocal8Bit()</a>, and <a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qiodevice.html#setErrorString">QIODevice::setErrorString()</a>.</p>
175
176<p>Referenced by <a class="el" href="classQuaZIODevice.html#ad27e447544d57f897316ee6f44535895">close()</a>.</p>
177
178</div>
179</div>
180<a class="anchor" id="a175446c18eb20c9aff6faf23f09cc67a"></a><!-- doxytag: member="QuaZIODevice::open" ref="a175446c18eb20c9aff6faf23f09cc67a" args="(QIODevice::OpenMode mode)" -->
181<div class="memitem">
182<div class="memproto">
183 <table class="memname">
184 <tr>
185 <td class="memname">bool QuaZIODevice::open </td>
186 <td>(</td>
187 <td class="paramtype"><a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qiodevice.html#OpenModeFlag-enum">QIODevice::OpenMode</a>&#160;</td>
188 <td class="paramname"><em>mode</em></td><td>)</td>
189 <td><code> [virtual]</code></td>
190 </tr>
191 </table>
192</div>
193<div class="memdoc">
194
195<p>Opens the device. </p>
196<dl><dt><b>Parameters:</b></dt><dd>
197 <table class="params">
198 <tr><td class="paramname">mode</td><td>Neither QIODevice::ReadWrite nor QIODevice::Append are not supported. </td></tr>
199 </table>
200 </dd>
201</dl>
202
203<p>References <a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qiodevice.html#setErrorString">QIODevice::setErrorString()</a>, and <a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qobject-obsolete.html#trUtf8">QObject::trUtf8()</a>.</p>
204
205</div>
206</div>
207<a class="anchor" id="ad27e447544d57f897316ee6f44535895"></a><!-- doxytag: member="QuaZIODevice::close" ref="ad27e447544d57f897316ee6f44535895" args="()" -->
208<div class="memitem">
209<div class="memproto">
210 <table class="memname">
211 <tr>
212 <td class="memname">void QuaZIODevice::close </td>
213 <td>(</td>
214 <td class="paramname"></td><td>)</td>
215 <td><code> [virtual]</code></td>
216 </tr>
217 </table>
218</div>
219<div class="memdoc">
220
221<p>Closes this device, but not the underlying one. </p>
222<p>The underlying <a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qiodevice.html">QIODevice</a> is not closed in case you want to write something else to it. </p>
223
224<p>Reimplemented from <a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qiodevice.html#close">QIODevice</a>.</p>
225
226<p>References <a class="el" href="classQuaZIODevice.html#a25f586eb564841b51c395fd17f1cc080">flush()</a>, <a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qiodevice.html#openMode">QIODevice::openMode()</a>, and <a class="elRef" doxygen="qtcore.tags:http://doc.qt.io/qt-5//" href="http://doc.qt.io/qt-5/qiodevice.html#setErrorString">QIODevice::setErrorString()</a>.</p>
227
228<p>Referenced by <a class="el" href="classQuaZIODevice.html#ab3524cef44c240c21e6b7680ee5f42de">~QuaZIODevice()</a>.</p>
229
230</div>
231</div>
232<hr/>The documentation for this class was generated from the following files:<ul>
233<li>quazip/<a class="el" href="quaziodevice_8h_source.html">quaziodevice.h</a></li>
234<li>quazip/quaziodevice.cpp</li>
235</ul>
236</div>
237<hr class="footer"/><address class="footer"><small>Generated on Sun Apr 3 2016 08:26:25 for QuaZIP by&#160;
238<a href="http://www.doxygen.org/index.html">
239<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
240</body>
241</html>
Note: See TracBrowser for help on using the repository browser.