⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 codeproject.html

📁 用BKZIP方式解压缩文件
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<h3>Testing the integrity of the archive</h3>
<p>The new functions has been provided to allow the testing of the integrity of
the archive. The first one is <em>CZipArchive::TestFile </em>which is a
comprehensive testing function, but if you need a different functionality, you
can make your own by taking advantage of the second function provided: <em>CZipArchive::CloseFileAfterTestFailed.
</em>The detailed description and the example of use are provided in the sources
and in the example project.</p>
<h3>Exceptions</h3>
<p>The library throws the following exceptions: CMemoryException, CFileExeption
and CZipException. The first two don't need an explanation. The last is thrown
when some internal error occurs. Handling them may be done in the following way:</p>
<pre>
try
{
	// ...
	// some operations on Zip library
}
catch (CException* e)
{
	if (e-&gt;IsKindOf( RUNTIME_CLASS( CZipException )))
	{
		CZipException* p = (CZipException*) e;
		//... and so on 
	}
	else if (e-&gt;IsKindOf( RUNTIME_CLASS( CFileException )))
	{
		CFileException* p = (CFileException*) e;
		//... and so on 
	} 
	else
	{
		// the only possibility is a memory exception I suppose
		//... and so on 
	}
	e-&gt;Delete();
}
</pre>
<h3>Handling the extra field</h3>
<p>The extra field of the file can be different in the local and central
headers. To set the extra filed in the local header set it in <em>header</em>
parameter of <font size="3"><em>CZipArchive::OpenNewFile </em>function<em>. </em>After
that the extra field is written to the local header and cleared. You should call
<em>CZipArchive::SetExtraField </em>function anytime after opening the new file
(but before closing it) to set the file extra field in the central directory.</font></p>
<h3>Sample application</h3>
<p>To run the example, integrate first Zip library into it (Zip library is not
included in the example, you must download it separately); you should be asked
at the beginning about the location of the Zip project, if not, use one of the
integration methods described above. If you don't put Zip library project at the
same directory level what the sample application is, you also have to change the path pointing
to ZipArchive.h in the file testzipdlgdlg.h.</p>
  <h3>Linking errors</h3>
  <p>When you experience linking errors (mostly <em>LNK2005)</em> you need to
  make sure that the library and your program are both using
  single-threaded or both multithreaded library. The option <em>&quot;Project-&gt;Settings-&gt;
  c/c++ -&gt;Code Generation-&gt;Use run-time library&quot; </em>should be set
  to the same value in the ZipArchive library and the program project options.
  <p>If it doesn't help, try recompiling the zlib library ( <em>zlib.lib</em>
  provided with the project is compiled from a release configuration and using <font SIZE="2">Multithreaded</font> 
  DLL run-time library ). You can download the zlib library
  sources from <a href="http://www.artpol-software.com/index_zip.html">http://www.artpol-software.com/index_zip.html</a>
  Use <em>zlibstat</em> project. Set <em>&quot;Use run-time library&quot;</em>
  option to the same value as you set it in ZipArchve library and your program
  configurations. Compile the Release configuration of the zlib library and
  replace with it the file <em>zlib.lib</em> in the ZipArchive folder. You may
  however experience linking warnings or errors while compiling the Debug
  configuration. To eliminate them do as follows:
  <ul>
    <li>compile Debug and Release configuraions of the zlib library
    <li>copy <em>zlib_d.lib</em> from Debug and <em>zlib.lib</em> from Release
      directories to the ZipArchive directory
    <li>add these files to the ZipArchive project <em>(Project -&gt; Add To
      Project -&gt; Files...)</em>
    <li>go to the project setting dialog <em>(Project -&gt; Settings)</em>
    <li>select debug configurations <em>(Setting For -&gt; Multiple
      Configurations)</em> such as Debug and Unicode Debug
    <li>select <em>zlib.lib</em> file, then the General tab, and check the box <em>&quot;Exclude
      file from build&quot;</em>
    <li>select release configurations
    <li>select <em>zlib_.lib</em> and exclude it from these builds</li>
  </ul>
<p>&nbsp;</p>
<h2>To Do and updates</h2>
<p>I currently work on the non-MFC version of the library and a multi-platform
support. Make sure to check out the site <a href="http://www.artpol-software.com">http://www.artpol-software.com</a>
which is more likely to have an updated version.&nbsp;</p>
<h2>Downloads</h2>
<!-- demo and source files -->
<a HREF="file:///c:/ZipArchive/zip_src.zip">
<p>Download source - 110 KB</a><br>
<a href="file:///c:/ZipArchive/zip_demo.zip">Download example - 40 KB</a></p>
<h2>History</h2>
<p><b>03.2001</b></p>
<ul>
  <li>when the central directory was not located, the library throws
    CZipException::cdirNotFound,<br>
    which allows distinguish from other exceptions (useful when we want to keep
    prompting<br>
    the user to insert the last disk in a multi-disk spanning archive).</li>
</ul>
</ul>
<p>&nbsp;</p>

<ul>
<b>02.2001</b>
<dl compact>
  <dt><b>Features added:</b>
  <dd>
    <ul>
      <li>ability to reuse the archive after an exception thrown during
        extraction
      <li>added progress control possibilities to CZipArchive::AddNewFile,
        CZipArchive::ExtractFile, CZipArchive::TestFile</li>
    </ul>
  </dd>
</dl>
<dl compact>
  <dt><b>Changes:</b>
  <dd>
    <ul>
      <li>CZipArchive::FindFile operation boosted ( thanks to Darin Warling for
        the idea)
      <li>library name changed to ZipArchive</li>
    </ul>
  </dd>
</dl>
<dl compact>
  <dt><b>Bugs fixed:</b>
  <dd>
    <ul>
      <li>removed bug during extracting an encrypted file with 0 size
      <li>fixed bug when extracting a file with an extra field in a local file
        header (CZipFileHeader::ReadLocal)</li>
    </ul>
  </dd>
</dl>
<b>01.2001</b>
<ul>
  <li>Disk numbering in a disk spanning archive begins now from PKBACK# 001 not
    PKBACK# 000
  <li>Adding and extracting without a full path possible in
    CZipArchive::AddNewFile and CZipArchive::ExtractFile.
  <li>Several minor changes and enhancements
  <li>Changed names for several classes.</li>
</ul>
<b>11.2000</b>
<ul>
  <li>Added support for password encryption and decryption. The encryption used
    in PKZIP was generously supplied by Roger Schlafly.
  <li>Testing the archive made easier
  <li>Unicode support added</li>
</ul>
<b>08.2000</b>
<ul>
  <li>Bugs fixed</li>
</ul>
<b>06.2000</b>
<p>the code has been completely rewritten since the very beginning; the main
improvements are:
<ul>
  <li>multi-disk archive support
  <li>creation of the disk spanning archives with the user-defined volume size
  <li>ability to modify existing archives (add, delete files)
  <li>modification self-extracting archives
  <li>write buffer used for faster disk write operations
  <li>one class for zip and unzip functions
  <li>fast adding, deleting and extracting files with a single function call</li>
</ul>
<b>03.2000</b>
<ul>
  <li>international characters in filenames inside archive are now converted in
    a compatible way with other archiving programs (they are stored converted to
    OEM inside archive).</li>
</ul>
<b>01.2000</b>
<p>first version; it is just modified code from zip.c and unzip.c files written
by Gilles Vollant and distributed with zlib library; the modifications are as
follows:
<ul>
  <li>added class' wrappers
  <li>several bugs fixed
  <li>several enhancements added
  <li>MFC support added
  <li>memory leaks eliminated when write error occurred
  <li>automatically free used memory on destruction or exception
  <li>modern error notification using exceptions</li>
</ul>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -