OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef THIRD_PARTY_ZLIB_GOOGLE_ZIP_H_ | 5 #ifndef THIRD_PARTY_ZLIB_GOOGLE_ZIP_H_ |
6 #define THIRD_PARTY_ZLIB_GOOGLE_ZIP_H_ | 6 #define THIRD_PARTY_ZLIB_GOOGLE_ZIP_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 // file names in the created zip file. All source paths must be under |src_dir| | 36 // file names in the created zip file. All source paths must be under |src_dir| |
37 // in the file system hierarchy. | 37 // in the file system hierarchy. |
38 bool ZipFiles(const base::FilePath& src_dir, | 38 bool ZipFiles(const base::FilePath& src_dir, |
39 const std::vector<base::FilePath>& src_relative_paths, | 39 const std::vector<base::FilePath>& src_relative_paths, |
40 int dest_fd); | 40 int dest_fd); |
41 #endif // defined(OS_POSIX) | 41 #endif // defined(OS_POSIX) |
42 | 42 |
43 // Unzip the contents of zip_file into dest_dir. | 43 // Unzip the contents of zip_file into dest_dir. |
44 // For each file in zip_file, include it only if the callback |filter_cb| | 44 // For each file in zip_file, include it only if the callback |filter_cb| |
45 // returns true. Otherwise omit it. | 45 // returns true. Otherwise omit it. |
| 46 // If |log_skipped_files| is true, files skipped during extraction are printed |
| 47 // to debug log. |
46 typedef base::Callback<bool(const base::FilePath&)> FilterCallback; | 48 typedef base::Callback<bool(const base::FilePath&)> FilterCallback; |
47 bool UnzipWithFilterCallback(const base::FilePath& zip_file, | 49 bool UnzipWithFilterCallback(const base::FilePath& zip_file, |
48 const base::FilePath& dest_dir, | 50 const base::FilePath& dest_dir, |
49 const FilterCallback& filter_cb); | 51 const FilterCallback& filter_cb, |
| 52 bool log_skipped_files); |
50 | 53 |
51 // Unzip the contents of zip_file into dest_dir. | 54 // Unzip the contents of zip_file into dest_dir. |
52 bool Unzip(const base::FilePath& zip_file, const base::FilePath& dest_dir); | 55 bool Unzip(const base::FilePath& zip_file, const base::FilePath& dest_dir); |
53 | 56 |
54 } // namespace zip | 57 } // namespace zip |
55 | 58 |
56 #endif // THIRD_PARTY_ZLIB_GOOGLE_ZIP_H_ | 59 #endif // THIRD_PARTY_ZLIB_GOOGLE_ZIP_H_ |
OLD | NEW |