From: ishmal Date: Thu, 13 Apr 2006 10:51:38 +0000 (+0000) Subject: add zipentry methods X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=09e1a9d6cc2efdeec04a00454539e1bf68e187c2;p=inkscape.git add zipentry methods --- 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