mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
.reference: Zip stream mode
git-svn-id: svn://ultimatepp.org/upp/trunk@7420 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
4882294293
commit
5c9e92b773
1 changed files with 11 additions and 1 deletions
|
|
@ -5,7 +5,7 @@ using namespace Upp;
|
|||
CONSOLE_APP_MAIN {
|
||||
StdLogSetup(LOG_COUT|LOG_FILE);
|
||||
|
||||
String zipfile = ConfigFile("test.zip");
|
||||
String zipfile = GetHomeDirFile("test.zip");
|
||||
|
||||
// Compression
|
||||
FileZip zip(zipfile);
|
||||
|
|
@ -16,6 +16,16 @@ CONSOLE_APP_MAIN {
|
|||
zip.WriteFile(somedata, strlen(somedata), "somedata.txt");
|
||||
|
||||
zip.WriteFile(String("other data"), "test/otherdata.txt");
|
||||
|
||||
zip.BeginFile("file1.txt");
|
||||
zip.Put(somedata, strlen(somedata));
|
||||
zip.EndFile();
|
||||
|
||||
{
|
||||
OutFilterStream oz;
|
||||
zip.BeginFile(oz, "file2.txt");
|
||||
oz << "some content";
|
||||
} //OutFilterStream destructor calls EndFile
|
||||
|
||||
if(zip.Finish())
|
||||
LOG(zipfile << " created succesfully");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue