Chromium Code Reviews| Index: third_party/zlib/google/zip_reader.h |
| diff --git a/third_party/zlib/google/zip_reader.h b/third_party/zlib/google/zip_reader.h |
| index c1b6fb3364abeba3c34231e9dd1fea500540029e..1ba76a7fcfc37e910ef03332f28664a43fa93817 100644 |
| --- a/third_party/zlib/google/zip_reader.h |
| +++ b/third_party/zlib/google/zip_reader.h |
| @@ -162,6 +162,11 @@ class ZipReader { |
| // Extracts the current entry in chunks to |delegate|. |
| bool ExtractCurrentEntry(WriterDelegate* delegate) const; |
| + // Extracts part of the current entry to |delegate|, starting from the |
| + // beginning of the entry. |
| + bool ExtractPartOfCurrentEntry(WriterDelegate* delegate, |
| + size_t num_bytes) const; |
|
satorux1
2017/07/14 01:00:53
Could you add a unit test for this function to zip
mortonm
2017/07/14 17:08:45
Done.
|
| + |
| // Extracts the current entry to the given output file path. If the |
| // current file is a directory, just creates a directory |
| // instead. Returns true on success. OpenCurrentEntryInZip() must be |
| @@ -217,6 +222,13 @@ class ZipReader { |
| size_t max_read_bytes, |
| std::string* output) const; |
| + // Same as ExtractCurrentEntryToString(), except specifies the number of bytes |
| + // to read into the string so that it is possible to only read a partial |
| + // amount of the entry into a string. This is used to infer the type of |
| + // MachO files on Mac by sniffing their magic number in the header. |
| + bool ExtractPartOfCurrentEntryToString(size_t max_read_bytes, |
|
satorux1
2017/07/14 01:00:53
Ditto.
mortonm
2017/07/14 17:08:45
Done.
|
| + std::string* output) const; |
| + |
| // Returns the current entry info. Returns NULL if the current entry is |
| // not yet opened. OpenCurrentEntryInZip() must be called beforehand. |
| EntryInfo* current_entry_info() const { |