Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10182)

Unified Diff: chrome/common/zip.h

Issue 118028: Implements a Zip() utility function. Refactor existing (Closed)
Patch Set: Attempt to get rietveld to recognize copies Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/zip.h
diff --git a/chrome/common/zip.h b/chrome/common/zip.h
new file mode 100644
index 0000000000000000000000000000000000000000..0d007c43ed0182d8cd47cae42b8c12a578ad6181
--- /dev/null
+++ b/chrome/common/zip.h
@@ -0,0 +1,23 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_COMMON_ZIP_H_
+#define CHROME_COMMON_ZIP_H_
+
+#include <vector>
+
+#include "base/file_path.h"
+
+// Zip the contents of src_path into dest_file. src_path can be a file or
+// directory. If it is a directory, it will be zipped recursively.
Erik does not do reviews 2009/05/29 23:33:27 note that on failure a partial zip file may still
+bool Zip(const FilePath& src_path, const FilePath& dest_file);
+
+// Unzip the contents of zip_file into dest_dir. The complete paths of all
+// created files and directories are added to files if it is non-NULL.
+// Returns true on success. Does not clean up dest_dir on failure.
+// Does not support encrypted or password protected zip files.
+bool Unzip(const FilePath& zip_file, const FilePath& dest_dir,
+ std::vector<FilePath>* files);
+
+#endif // CHROME_COMMON_ZIP_H_

Powered by Google App Engine
This is Rietveld 408576698