Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » plugin/zip
plugin/zip [message #13797] Sun, 27 January 2008 23:32 Go to previous message
mirek is currently offline  mirek
Messages: 13975
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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Improved heap diagnostics
Next Topic: TheIDE now has "Lock link mode" flag in Build methods....
Goto Forum:
  


Current Time: Thu Apr 25 05:55:14 CEST 2024

Total time taken to generate the page: 0.02963 seconds