Home » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » plugin/zip
plugin/zip [message #13797] |
Sun, 27 January 2008 23:32  |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
...a new package to handle .zip files:
#include <plugin/zip/zip.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
String outdir = "e:\\zipout";
FileUnZip unzip("d:/uppsrc.zip");
while(unzip) {
String fn = AppendFileName(outdir, unzip.GetPath());
if(unzip.IsFolder()) {
RealizeDirectory(fn);
unzip.SkipFile();
}
else {
RealizePath(fn);
FileOut out(fn);
unzip.ReadFile(out);
}
}
if(unzip.IsError())
LOG("Error!");
{
FindFile ff("e:/zipout/uppsrc/CtrlLib/*.*");
FileZip zip("e:/test.zip");
while(ff) {
if(ff.IsFile())
zip.WriteFile(LoadFile(AppendFileName("e:/zipout/uppsrc/CtrlLib", ff.GetName())),
ff.GetName());
ff.Next();
}
}
}
In the process, I have also refactored the code in Core/z.h and z.cpp.
Mirek
[Updated on: Sun, 27 January 2008 23:33] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Mon Apr 28 20:55:20 CEST 2025
Total time taken to generate the page: 0.00841 seconds
|