From 09e1a9d6cc2efdeec04a00454539e1bf68e187c2 Mon Sep 17 00:00:00 2001 From: ishmal Date: Thu, 13 Apr 2006 10:51:38 +0000 Subject: [PATCH] add zipentry methods --- src/dom/util/ziptool.cpp | 19 +++++++++++++++---- src/dom/util/ziptool.h | 10 ++++++++-- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/dom/util/ziptool.cpp b/src/dom/util/ziptool.cpp index 657d26765..72b7e63b7 100644 --- a/src/dom/util/ziptool.cpp +++ b/src/dom/util/ziptool.cpp @@ -1997,7 +1997,6 @@ void ZipEntry::finish() compressionMethod); } } - printf("### done\n"); } @@ -2140,16 +2139,28 @@ void ZipFile::trace(char *fmt, ...) /** * */ -bool ZipFile::addFile(const std::string &fileName, +ZipEntry *ZipFile::addFile(const std::string &fileName, const std::string &comment) { ZipEntry *ze = new ZipEntry(); if (!ze->readFile(fileName, comment)) { - return false; + return NULL; } entries.push_back(ze); - return true; + return ze; +} + + +/** + * + */ +ZipEntry *ZipFile::newEntry(const std::string &fileName, + const std::string &comment) +{ + ZipEntry *ze = new ZipEntry(fileName, comment); + entries.push_back(ze); + return ze; } diff --git a/src/dom/util/ziptool.h b/src/dom/util/ziptool.h index 723d95aa5..217b13171 100644 --- a/src/dom/util/ziptool.h +++ b/src/dom/util/ziptool.h @@ -409,8 +409,14 @@ public: /** * */ - virtual bool addFile(const std::string &fileNameArg, - const std::string &commentArg); + virtual ZipEntry *addFile(const std::string &fileNameArg, + const std::string &commentArg); + + /** + * + */ + virtual ZipEntry *newEntry(const std::string &fileNameArg, + const std::string &commentArg); //###################### //# W R I T E -- 2.39.5