metaforce/hecl-gui/quazip/doc/html/classQuaZIODevice.html

210 lines
12 KiB
HTML
Raw Normal View History

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>QuaZIP: QuaZIODevice Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.4 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">QuaZIP&#160;<span id="projectnumber">quazip-0-6-2</span></div>
</td>
</tr>
</tbody>
</table>
</div>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="dirs.html"><span>Directories</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> </div>
<div class="headertitle">
<div class="title">QuaZIODevice Class Reference</div> </div>
</div>
<div class="contents">
<!-- doxytag: class="QuaZIODevice" -->
<p>A class to compress/decompress QIODevice.
<a href="classQuaZIODevice.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="quaziodevice_8h_source.html">quaziodevice.h</a>&gt;</code></p>
<p><a href="classQuaZIODevice-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQuaZIODevice.html#a8321ed35ee9b57cf9b1104912e236361">QuaZIODevice</a> (QIODevice *io, QObject *parent=NULL)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor. <a href="#a8321ed35ee9b57cf9b1104912e236361"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab3524cef44c240c21e6b7680ee5f42de"></a><!-- doxytag: member="QuaZIODevice::~QuaZIODevice" ref="ab3524cef44c240c21e6b7680ee5f42de" args="()" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQuaZIODevice.html#ab3524cef44c240c21e6b7680ee5f42de">~QuaZIODevice</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <br/></td></tr>
<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>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Flushes data waiting to be written. <a href="#a25f586eb564841b51c395fd17f1cc080"></a><br/></td></tr>
<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> (QIODevice::OpenMode mode)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Opens the device. <a href="#a175446c18eb20c9aff6faf23f09cc67a"></a><br/></td></tr>
<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>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Closes this device, but not the underlying one. <a href="#ad27e447544d57f897316ee6f44535895"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad63e7f1717c7d91b3c2c5ace908c98b7"></a><!-- doxytag: member="QuaZIODevice::getIoDevice" ref="ad63e7f1717c7d91b3c2c5ace908c98b7" args="() const " -->
QIODevice *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQuaZIODevice.html#ad63e7f1717c7d91b3c2c5ace908c98b7">getIoDevice</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the underlying device. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af2697f58c228741d3715801bf48a9a8b"></a><!-- doxytag: member="QuaZIODevice::isSequential" ref="af2697f58c228741d3715801bf48a9a8b" args="() const " -->
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQuaZIODevice.html#af2697f58c228741d3715801bf48a9a8b">isSequential</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<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)" -->
virtual qint64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQuaZIODevice.html#aa12b8bc9c923e543eda9ae22dbd1ecbb">readData</a> (char *data, qint64 maxSize)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Implementation of QIODevice::readData(). <br/></td></tr>
<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)" -->
virtual qint64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQuaZIODevice.html#aab23b6badbc3548eb71ca86bf6211902">writeData</a> (const char *data, qint64 maxSize)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Implementation of QIODevice::writeData(). <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>A class to compress/decompress QIODevice. </p>
<p>This class can be used to compress any data written to QIODevice or decompress it back. Compressing data sent over a QTcpSocket is a good example. </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a8321ed35ee9b57cf9b1104912e236361"></a><!-- doxytag: member="QuaZIODevice::QuaZIODevice" ref="a8321ed35ee9b57cf9b1104912e236361" args="(QIODevice *io, QObject *parent=NULL)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">QuaZIODevice::QuaZIODevice </td>
<td>(</td>
<td class="paramtype">QIODevice *&#160;</td>
<td class="paramname"><em>io</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">QObject *&#160;</td>
<td class="paramname"><em>parent</em> = <code>NULL</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructor. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">io</td><td>The QIODevice to read/write. </td></tr>
<tr><td class="paramname">parent</td><td>The parent object, as per QObject logic. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a25f586eb564841b51c395fd17f1cc080"></a><!-- doxytag: member="QuaZIODevice::flush" ref="a25f586eb564841b51c395fd17f1cc080" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool QuaZIODevice::flush </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Flushes data waiting to be written. </p>
<p>Unfortunately, as QIODevice 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 QIODevice, 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>
<div class="fragment"><pre class="fragment"> <a class="code" href="classQuaZIODevice.html" title="A class to compress/decompress QIODevice.">QuaZIODevice</a> dev(&amp;sock);
dev.open(QIODevice::Write);
dev.write(yourDataGoesHere);
dev.flush();
sock-&gt;flush(); <span class="comment">// this actually sends data to network</span>
</pre></div><p>This may change in the future versions of QuaZIP by implementing an ugly hack: trying to cast the QIODevice 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>
<p>Referenced by <a class="el" href="classQuaZIODevice.html#ad27e447544d57f897316ee6f44535895">close()</a>.</p>
</div>
</div>
<a class="anchor" id="a175446c18eb20c9aff6faf23f09cc67a"></a><!-- doxytag: member="QuaZIODevice::open" ref="a175446c18eb20c9aff6faf23f09cc67a" args="(QIODevice::OpenMode mode)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool QuaZIODevice::open </td>
<td>(</td>
<td class="paramtype">QIODevice::OpenMode&#160;</td>
<td class="paramname"><em>mode</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Opens the device. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">mode</td><td>Neither QIODevice::ReadWrite nor QIODevice::Append are not supported. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ad27e447544d57f897316ee6f44535895"></a><!-- doxytag: member="QuaZIODevice::close" ref="ad27e447544d57f897316ee6f44535895" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void QuaZIODevice::close </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Closes this device, but not the underlying one. </p>
<p>The underlying QIODevice is not closed in case you want to write something else to it. </p>
<p>References <a class="el" href="classQuaZIODevice.html#a25f586eb564841b51c395fd17f1cc080">flush()</a>.</p>
<p>Referenced by <a class="el" href="classQuaZIODevice.html#ab3524cef44c240c21e6b7680ee5f42de">~QuaZIODevice()</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>quazip/<a class="el" href="quaziodevice_8h_source.html">quaziodevice.h</a></li>
<li>quazip/quaziodevice.cpp</li>
</ul>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Sun Feb 9 2014 20:17:04 for QuaZIP by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>