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 CHROME_COMMON_ZIP_READER_H_ | 5 #ifndef CHROME_COMMON_ZIP_READER_H_ |
6 #define CHROME_COMMON_ZIP_READER_H_ | 6 #define CHROME_COMMON_ZIP_READER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/time.h" | 14 #include "base/time.h" |
| 15 |
| 16 #if defined(USE_SYSTEM_MINIZIP) |
| 17 #include <minizip/unzip.h> |
| 18 #else |
15 #include "third_party/zlib/contrib/minizip/unzip.h" | 19 #include "third_party/zlib/contrib/minizip/unzip.h" |
| 20 #endif |
16 | 21 |
17 namespace zip { | 22 namespace zip { |
18 | 23 |
19 // This class is used for reading zip files. A typical use case of this | 24 // This class is used for reading zip files. A typical use case of this |
20 // class is to scan entries in a zip file and extract them. The code will | 25 // class is to scan entries in a zip file and extract them. The code will |
21 // look like: | 26 // look like: |
22 // | 27 // |
23 // ZipReader reader; | 28 // ZipReader reader; |
24 // reader.Open(zip_file_path); | 29 // reader.Open(zip_file_path); |
25 // while (reader.HasMore()) { | 30 // while (reader.HasMore()) { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 int num_entries_; | 168 int num_entries_; |
164 bool reached_end_; | 169 bool reached_end_; |
165 scoped_ptr<EntryInfo> current_entry_info_; | 170 scoped_ptr<EntryInfo> current_entry_info_; |
166 | 171 |
167 DISALLOW_COPY_AND_ASSIGN(ZipReader); | 172 DISALLOW_COPY_AND_ASSIGN(ZipReader); |
168 }; | 173 }; |
169 | 174 |
170 } // namespace zip | 175 } // namespace zip |
171 | 176 |
172 #endif // CHROME_COMMON_ZIP_READER_H_ | 177 #endif // CHROME_COMMON_ZIP_READER_H_ |
OLD | NEW |