]> git.tokkee.org Git - inkscape.git/commitdiff

Code

add zipentry methods
authorishmal <ishmal@users.sourceforge.net>
Thu, 13 Apr 2006 10:51:38 +0000 (10:51 +0000)
committerishmal <ishmal@users.sourceforge.net>
Thu, 13 Apr 2006 10:51:38 +0000 (10:51 +0000)
src/dom/util/ziptool.cpp
src/dom/util/ziptool.h

index 657d267656b766cfdcfff1c2bf1b1048d2639480..72b7e63b7e1c57783e01c5f4127c6102c38a23a7 100644 (file)
@@ -1997,7 +1997,6 @@ void ZipEntry::finish()
                     compressionMethod);\r
             }\r
         }\r
-    printf("### done\n");\r
 }\r
 \r
 \r
@@ -2140,16 +2139,28 @@ void ZipFile::trace(char *fmt, ...)
 /**\r
  *\r
  */\r
-bool ZipFile::addFile(const std::string &fileName,\r
+ZipEntry *ZipFile::addFile(const std::string &fileName,\r
                       const std::string &comment)\r
 {\r
     ZipEntry *ze = new ZipEntry();\r
     if (!ze->readFile(fileName, comment))\r
         {\r
-        return false;\r
+        return NULL;\r
         }\r
     entries.push_back(ze);\r
-    return true;\r
+    return ze;\r
+}\r
+\r
+\r
+/**\r
+ *\r
+ */\r
+ZipEntry *ZipFile::newEntry(const std::string &fileName,\r
+                            const std::string &comment)\r
+{\r
+    ZipEntry *ze = new ZipEntry(fileName, comment);\r
+    entries.push_back(ze);\r
+    return ze;\r
 }\r
 \r
 \r
index 723d95aa5963f270d713003169f58d4128113bfb..217b13171623b3b923dd364b3d15c84c632a0907 100644 (file)
@@ -409,8 +409,14 @@ public:
     /**\r
      *\r
      */\r
-    virtual bool addFile(const std::string &fileNameArg,\r
-                         const std::string &commentArg);\r
+    virtual ZipEntry *addFile(const std::string &fileNameArg,\r
+                              const std::string &commentArg);\r
+\r
+    /**\r
+     *\r
+     */\r
+    virtual ZipEntry *newEntry(const std::string &fileNameArg,\r
+                               const std::string &commentArg);\r
 \r
     //######################\r
     //# W R I T E\r