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

165 lines
9.1 KiB
HTML

<!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: QuaChecksum32 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> </div>
<div class="headertitle">
<div class="title">QuaChecksum32 Class Reference</div> </div>
</div>
<div class="contents">
<!-- doxytag: class="QuaChecksum32" -->
<p>Checksum interface.
<a href="classQuaChecksum32.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="quachecksum32_8h_source.html">quazip/quachecksum32.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for QuaChecksum32:</div>
<div class="dyncontent">
<div class="center"><img src="classQuaChecksum32__inherit__graph.png" border="0" usemap="#QuaChecksum32_inherit__map" alt="Inheritance graph"/></div>
<map name="QuaChecksum32_inherit__map" id="QuaChecksum32_inherit__map">
<area shape="rect" id="node3" href="classQuaAdler32.html" title="Adler32 checksum." alt="" coords="5,80,96,107"/>
<area shape="rect" id="node5" href="classQuaCrc32.html" title="CRC32 checksum." alt="" coords="120,80,200,107"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<p><a href="classQuaChecksum32-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">virtual quint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQuaChecksum32.html#a14d800fcfd55b2ae11ef07d3924fe0b1">calculate</a> (const QByteArray &amp;data)=0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates the checksum for data. <a href="#a14d800fcfd55b2ae11ef07d3924fe0b1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad3f5db3c76b00069db9bda333cb49d57"></a><!-- doxytag: member="QuaChecksum32::reset" ref="ad3f5db3c76b00069db9bda333cb49d57" args="()=0" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQuaChecksum32.html#ad3f5db3c76b00069db9bda333cb49d57">reset</a> ()=0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Resets the calculation on a checksun for a stream. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQuaChecksum32.html#a63a6ed3171f9243214d307da67557f7e">update</a> (const QByteArray &amp;buf)=0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the calculated checksum for the stream. <a href="#a63a6ed3171f9243214d307da67557f7e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual quint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQuaChecksum32.html#afd836e7534194fce08356be6a8336da7">value</a> ()=0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Value of the checksum calculated for the stream passed throw <a class="el" href="classQuaChecksum32.html#a63a6ed3171f9243214d307da67557f7e" title="Updates the calculated checksum for the stream.">update()</a>. <a href="#afd836e7534194fce08356be6a8336da7"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Checksum interface. </p>
<p>This is an interface for 32 bit checksums. Classes implementing this interface can calcunate a certin checksum in a single step: </p>
<div class="fragment"><pre class="fragment"> QChecksum32 *crc32 = <span class="keyword">new</span> <a class="code" href="classQuaCrc32.html" title="CRC32 checksum.">QuaCrc32</a>();
rasoult = crc32-&gt;calculate(data);
</pre></div><p> or by streaming the data: </p>
<div class="fragment"><pre class="fragment"> QChecksum32 *crc32 = <span class="keyword">new</span> <a class="code" href="classQuaCrc32.html" title="CRC32 checksum.">QuaCrc32</a>();
<span class="keywordflow">while</span>(!fileA.atEnd())
crc32-&gt;update(fileA.read(bufSize));
resoultA = crc32-&gt;value();
crc32-&gt;reset();
<span class="keywordflow">while</span>(!fileB.atEnd())
crc32-&gt;update(fileB.read(bufSize));
resoultB = crc32-&gt;value();
</pre></div> </div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a14d800fcfd55b2ae11ef07d3924fe0b1"></a><!-- doxytag: member="QuaChecksum32::calculate" ref="a14d800fcfd55b2ae11ef07d3924fe0b1" args="(const QByteArray &amp;data)=0" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual quint32 QuaChecksum32::calculate </td>
<td>(</td>
<td class="paramtype">const QByteArray &amp;&#160;</td>
<td class="paramname"><em>data</em></td><td>)</td>
<td><code> [pure virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Calculates the checksum for data. </p>
<p><em>data</em> source data </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>data checksum</dd></dl>
<p>This function has no efect on the value returned by <a class="el" href="classQuaChecksum32.html#afd836e7534194fce08356be6a8336da7" title="Value of the checksum calculated for the stream passed throw update().">value()</a>. </p>
<p>Implemented in <a class="el" href="classQuaAdler32.html#a350e84fd000ebfa3c33503336a7b21bb">QuaAdler32</a>, and <a class="el" href="classQuaCrc32.html#aaf6fdf6e36e55c97bf9eab6ec65ecb9e">QuaCrc32</a>.</p>
</div>
</div>
<a class="anchor" id="a63a6ed3171f9243214d307da67557f7e"></a><!-- doxytag: member="QuaChecksum32::update" ref="a63a6ed3171f9243214d307da67557f7e" args="(const QByteArray &amp;buf)=0" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual void QuaChecksum32::update </td>
<td>(</td>
<td class="paramtype">const QByteArray &amp;&#160;</td>
<td class="paramname"><em>buf</em></td><td>)</td>
<td><code> [pure virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Updates the calculated checksum for the stream. </p>
<p><em>buf</em> next portion of data from the stream </p>
<p>Implemented in <a class="el" href="classQuaAdler32.html#aba24f7b16aa0cdc26f81a9ad687fc653">QuaAdler32</a>, and <a class="el" href="classQuaCrc32.html#a5015d80e04afe6e6d094155b7e99888e">QuaCrc32</a>.</p>
</div>
</div>
<a class="anchor" id="afd836e7534194fce08356be6a8336da7"></a><!-- doxytag: member="QuaChecksum32::value" ref="afd836e7534194fce08356be6a8336da7" args="()=0" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual quint32 QuaChecksum32::value </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [pure virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Value of the checksum calculated for the stream passed throw <a class="el" href="classQuaChecksum32.html#a63a6ed3171f9243214d307da67557f7e" title="Updates the calculated checksum for the stream.">update()</a>. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>checksum </dd></dl>
<p>Implemented in <a class="el" href="classQuaAdler32.html#a2022e1db95c23cef220b335e44d74fb1">QuaAdler32</a>, and <a class="el" href="classQuaCrc32.html#a957ce46a53862f75c89d6a3ac4f73389">QuaCrc32</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>quazip/<a class="el" href="quachecksum32_8h_source.html">quachecksum32.h</a></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>