| 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 #ifndef THIRD_PARTY_ZLIB_GOOGLE_ZIP_READER_H_ | 4 #ifndef THIRD_PARTY_ZLIB_GOOGLE_ZIP_READER_H_ |
| 5 #define THIRD_PARTY_ZLIB_GOOGLE_ZIP_READER_H_ | 5 #define THIRD_PARTY_ZLIB_GOOGLE_ZIP_READER_H_ |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 public: | 57 public: |
| 58 EntryInfo(const std::string& filename_in_zip, | 58 EntryInfo(const std::string& filename_in_zip, |
| 59 const unz_file_info& raw_file_info); | 59 const unz_file_info& raw_file_info); |
| 60 | 60 |
| 61 // Returns the file path. The path is usually relative like | 61 // Returns the file path. The path is usually relative like |
| 62 // "foo/bar.txt", but if it's absolute, is_unsafe() returns true. | 62 // "foo/bar.txt", but if it's absolute, is_unsafe() returns true. |
| 63 const base::FilePath& file_path() const { return file_path_; } | 63 const base::FilePath& file_path() const { return file_path_; } |
| 64 | 64 |
| 65 // Returns the size of the original file (i.e. after uncompressed). | 65 // Returns the size of the original file (i.e. after uncompressed). |
| 66 // Returns 0 if the entry is a directory. | 66 // Returns 0 if the entry is a directory. |
| 67 // Note: this value should not be trusted, because it is stored as metadata |
| 68 // in the zip archive and can be different from the real uncompressed size. |
| 67 int64 original_size() const { return original_size_; } | 69 int64 original_size() const { return original_size_; } |
| 68 | 70 |
| 69 // Returns the last modified time. If the time stored in the zip file was | 71 // Returns the last modified time. If the time stored in the zip file was |
| 70 // not valid, the unix epoch will be returned. | 72 // not valid, the unix epoch will be returned. |
| 71 // | 73 // |
| 72 // The time stored in the zip archive uses the MS-DOS date and time format. | 74 // The time stored in the zip archive uses the MS-DOS date and time format. |
| 73 // http://msdn.microsoft.com/en-us/library/ms724247(v=vs.85).aspx | 75 // http://msdn.microsoft.com/en-us/library/ms724247(v=vs.85).aspx |
| 74 // As such the following limitations apply: | 76 // As such the following limitations apply: |
| 75 // * only years from 1980 to 2107 can be represented. | 77 // * only years from 1980 to 2107 can be represented. |
| 76 // * the time stamp has a 2 second resolution. | 78 // * the time stamp has a 2 second resolution. |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 scoped_ptr<EntryInfo> current_entry_info_; | 213 scoped_ptr<EntryInfo> current_entry_info_; |
| 212 | 214 |
| 213 base::WeakPtrFactory<ZipReader> weak_ptr_factory_; | 215 base::WeakPtrFactory<ZipReader> weak_ptr_factory_; |
| 214 | 216 |
| 215 DISALLOW_COPY_AND_ASSIGN(ZipReader); | 217 DISALLOW_COPY_AND_ASSIGN(ZipReader); |
| 216 }; | 218 }; |
| 217 | 219 |
| 218 } // namespace zip | 220 } // namespace zip |
| 219 | 221 |
| 220 #endif // THIRD_PARTY_ZLIB_GOOGLE_ZIP_READER_H_ | 222 #endif // THIRD_PARTY_ZLIB_GOOGLE_ZIP_READER_H_ |
| OLD | NEW |