<!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>Kyoto Cabinet: kyotocabinet::ZLIB 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.6.3 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</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> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="classes.html"><span>Class Index</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="namespacekyotocabinet.html">kyotocabinet</a>::<a class="el" href="classkyotocabinet_1_1ZLIB.html">ZLIB</a> </div> </div> <div class="contents"> <h1>kyotocabinet::ZLIB Class Reference</h1><!-- doxytag: class="kyotocabinet::ZLIB" --> <p><a class="el" href="classkyotocabinet_1_1ZLIB.html" title="ZLIB compressor.">ZLIB</a> compressor. <a href="#_details">More...</a></p> <p><code>#include <kccompress.h></code></p> <p><a href="classkyotocabinet_1_1ZLIB-members.html">List of all members.</a></p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td colspan="2"><h2>Public Types</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1ZLIB.html#a0a0cc3f4a13c705f8f6754301a9b3b57">Mode</a> { <a class="el" href="classkyotocabinet_1_1ZLIB.html#a0a0cc3f4a13c705f8f6754301a9b3b57a465705260bc5a4ed21d869cac44a0e89">RAW</a>, <a class="el" href="classkyotocabinet_1_1ZLIB.html#a0a0cc3f4a13c705f8f6754301a9b3b57a2dacfa98dd5b0382b9764cf56dc02948">DEFLATE</a>, <a class="el" href="classkyotocabinet_1_1ZLIB.html#a0a0cc3f4a13c705f8f6754301a9b3b57aad0efc51650314cbb30150126d1c18e1">GZIP</a> }</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight"><p>Compression modes. </p> <a href="classkyotocabinet_1_1ZLIB.html#a0a0cc3f4a13c705f8f6754301a9b3b57">More...</a><br/></td></tr> <tr><td colspan="2"><h2>Static Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1ZLIB.html#a0f5ea3a5dbda5878659e7f730f41cd78">compress</a> (const void *buf, size_t size, size_t *sp, <a class="el" href="classkyotocabinet_1_1ZLIB.html#a0a0cc3f4a13c705f8f6754301a9b3b57">Mode</a> mode=RAW)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Compress a serial data. <a href="#a0f5ea3a5dbda5878659e7f730f41cd78"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1ZLIB.html#aa2b7b15c7098de775b08924b83832f48">decompress</a> (const void *buf, size_t size, size_t *sp, <a class="el" href="classkyotocabinet_1_1ZLIB.html#a0a0cc3f4a13c705f8f6754301a9b3b57">Mode</a> mode=RAW)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Decompress a serial data. <a href="#aa2b7b15c7098de775b08924b83832f48"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1ZLIB.html#ac6b10f76a3a2ac06a378042604425eca">calculate_crc</a> (const void *buf, size_t size, uint32_t seed=0)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Calculate the CRC32 checksum of a serial data. <a href="#ac6b10f76a3a2ac06a378042604425eca"></a><br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p><a class="el" href="classkyotocabinet_1_1ZLIB.html" title="ZLIB compressor.">ZLIB</a> compressor. </p> <hr/><h2>Member Enumeration Documentation</h2> <a class="anchor" id="a0a0cc3f4a13c705f8f6754301a9b3b57"></a><!-- doxytag: member="kyotocabinet::ZLIB::Mode" ref="a0a0cc3f4a13c705f8f6754301a9b3b57" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">enum <a class="el" href="classkyotocabinet_1_1ZLIB.html#a0a0cc3f4a13c705f8f6754301a9b3b57">kyotocabinet::ZLIB::Mode</a></td> </tr> </table> </div> <div class="memdoc"> <p>Compression modes. </p> <dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"><em><a class="anchor" id="a0a0cc3f4a13c705f8f6754301a9b3b57a465705260bc5a4ed21d869cac44a0e89"></a><!-- doxytag: member="RAW" ref="a0a0cc3f4a13c705f8f6754301a9b3b57a465705260bc5a4ed21d869cac44a0e89" args="" -->RAW</em> </td><td> <p>without any checksum </p> </td></tr> <tr><td valign="top"><em><a class="anchor" id="a0a0cc3f4a13c705f8f6754301a9b3b57a2dacfa98dd5b0382b9764cf56dc02948"></a><!-- doxytag: member="DEFLATE" ref="a0a0cc3f4a13c705f8f6754301a9b3b57a2dacfa98dd5b0382b9764cf56dc02948" args="" -->DEFLATE</em> </td><td> <p>with Adler32 checksum </p> </td></tr> <tr><td valign="top"><em><a class="anchor" id="a0a0cc3f4a13c705f8f6754301a9b3b57aad0efc51650314cbb30150126d1c18e1"></a><!-- doxytag: member="GZIP" ref="a0a0cc3f4a13c705f8f6754301a9b3b57aad0efc51650314cbb30150126d1c18e1" args="" -->GZIP</em> </td><td> <p>with CRC32 checksum and various meta data </p> </td></tr> </table> </dd> </dl> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a0f5ea3a5dbda5878659e7f730f41cd78"></a><!-- doxytag: member="kyotocabinet::ZLIB::compress" ref="a0f5ea3a5dbda5878659e7f730f41cd78" args="(const void *buf, size_t size, size_t *sp, Mode mode=RAW)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static char* kyotocabinet::ZLIB::compress </td> <td>(</td> <td class="paramtype">const void * </td> <td class="paramname"> <em>buf</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"> <em>size</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t * </td> <td class="paramname"> <em>sp</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classkyotocabinet_1_1ZLIB.html#a0a0cc3f4a13c705f8f6754301a9b3b57">Mode</a> </td> <td class="paramname"> <em>mode</em> = <code>RAW</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Compress a serial data. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>buf</em> </td><td>the input buffer. </td></tr> <tr><td valign="top"></td><td valign="top"><em>size</em> </td><td>the size of the input buffer. </td></tr> <tr><td valign="top"></td><td valign="top"><em>sp</em> </td><td>the pointer to the variable into which the size of the region of the return value is assigned. </td></tr> <tr><td valign="top"></td><td valign="top"><em>mode</em> </td><td>the compression mode. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>the pointer to the result data, or NULL on failure. </dd></dl> <dl class="note"><dt><b>Note:</b></dt><dd>Because the region of the return value is allocated with the the new[] operator, it should be released with the delete[] operator when it is no longer in use. </dd></dl> </div> </div> <a class="anchor" id="aa2b7b15c7098de775b08924b83832f48"></a><!-- doxytag: member="kyotocabinet::ZLIB::decompress" ref="aa2b7b15c7098de775b08924b83832f48" args="(const void *buf, size_t size, size_t *sp, Mode mode=RAW)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static char* kyotocabinet::ZLIB::decompress </td> <td>(</td> <td class="paramtype">const void * </td> <td class="paramname"> <em>buf</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"> <em>size</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t * </td> <td class="paramname"> <em>sp</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classkyotocabinet_1_1ZLIB.html#a0a0cc3f4a13c705f8f6754301a9b3b57">Mode</a> </td> <td class="paramname"> <em>mode</em> = <code>RAW</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Decompress a serial data. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>buf</em> </td><td>the input buffer. </td></tr> <tr><td valign="top"></td><td valign="top"><em>size</em> </td><td>the size of the input buffer. </td></tr> <tr><td valign="top"></td><td valign="top"><em>sp</em> </td><td>the pointer to the variable into which the size of the region of the return value is assigned. </td></tr> <tr><td valign="top"></td><td valign="top"><em>mode</em> </td><td>the compression mode. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>the pointer to the result data, or NULL on failure. </dd></dl> <dl class="note"><dt><b>Note:</b></dt><dd>Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a C-style string. Because the region of the return value is allocated with the the new[] operator, it should be released with the delete[] operator when it is no longer in use. </dd></dl> </div> </div> <a class="anchor" id="ac6b10f76a3a2ac06a378042604425eca"></a><!-- doxytag: member="kyotocabinet::ZLIB::calculate_crc" ref="ac6b10f76a3a2ac06a378042604425eca" args="(const void *buf, size_t size, uint32_t seed=0)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static uint32_t kyotocabinet::ZLIB::calculate_crc </td> <td>(</td> <td class="paramtype">const void * </td> <td class="paramname"> <em>buf</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"> <em>size</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint32_t </td> <td class="paramname"> <em>seed</em> = <code>0</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Calculate the CRC32 checksum of a serial data. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>buf</em> </td><td>the input buffer. </td></tr> <tr><td valign="top"></td><td valign="top"><em>size</em> </td><td>the size of the input buffer. </td></tr> <tr><td valign="top"></td><td valign="top"><em>seed</em> </td><td>the cyclic seed value. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>the CRC32 checksum. </dd></dl> </div> </div> </div> <hr class="footer"/><address style="text-align: right;"><small>Generated on Sat Dec 11 01:50:27 2010 for Kyoto Cabinet by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address> </body> </html>