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

Side by Side Diff: components/zip/zip.h

Issue 14021015: Move components/zip to third_party/zip (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update unit_tests.isolate for new test data location Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « components/zip/OWNERS ('k') | components/zip/zip.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_ZIP_ZIP_H_
6 #define COMPONENTS_ZIP_ZIP_H_
7
8 #include "base/callback.h"
9 #include "base/files/file_path.h"
10
11 namespace zip {
12
13 // Zip the contents of src_dir into dest_file. src_path must be a directory.
14 // An entry will *not* be created in the zip for the root folder -- children
15 // of src_dir will be at the root level of the created zip. For each file in
16 // src_dir, include it only if the callback |filter_cb| returns true. Otherwise
17 // omit it.
18 typedef base::Callback<bool(const base::FilePath&)> FilterCallback;
19 bool ZipWithFilterCallback(const base::FilePath& src_dir,
20 const base::FilePath& dest_file,
21 const FilterCallback& filter_cb);
22
23 // Convenience method for callers who don't need to set up the filter callback.
24 // If |include_hidden_files| is true, files starting with "." are included.
25 // Otherwise they are omitted.
26 bool Zip(const base::FilePath& src_dir, const base::FilePath& dest_file,
27 bool include_hidden_files);
28
29 #if defined(OS_POSIX)
30 // Zips files listed in |src_relative_paths| to destination specified by file
31 // descriptor |dest_fd|. The paths listed in |src_relative_paths| are relative
32 // to the |src_dir| and will be used as the file names in the created zip file.
33 // All source paths must be under |src_dir| in the file system hierarchy.
34 bool ZipFiles(const base::FilePath& src_dir,
35 const std::vector<base::FilePath>& src_relative_paths,
36 int dest_fd);
37 #endif // defined(OS_POSIX)
38
39 // Unzip the contents of zip_file into dest_dir.
40 bool Unzip(const base::FilePath& zip_file, const base::FilePath& dest_dir);
41
42 } // namespace zip
43
44 #endif // COMPONENTS_ZIP_ZIP_H_
OLDNEW
« no previous file with comments | « components/zip/OWNERS ('k') | components/zip/zip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698