| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2013 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 CHROME_TEST_CHROMEDRIVER_ZIP_INTERNAL_H_ | |
| 6 #define CHROME_TEST_CHROMEDRIVER_ZIP_INTERNAL_H_ | |
| 7 | |
| 8 #if defined(OS_WIN) | |
| 9 #include <windows.h> | |
| 10 #endif | |
| 11 | |
| 12 #include <string> | |
| 13 | |
| 14 #if defined(USE_SYSTEM_MINIZIP) | |
| 15 #include <minizip/unzip.h> | |
| 16 #include <minizip/zip.h> | |
| 17 #else | |
| 18 #include "third_party/zlib/contrib/minizip/unzip.h" | |
| 19 #include "third_party/zlib/contrib/minizip/zip.h" | |
| 20 #endif | |
| 21 | |
| 22 // Utility functions and constants used internally for the zip file | |
| 23 // library in the directory. Don't use them outside of the library. | |
| 24 namespace zip { | |
| 25 namespace internal { | |
| 26 | |
| 27 // Opens the given file name in UTF-8 for unzipping, with some setup for | |
| 28 // Windows. | |
| 29 unzFile OpenForUnzipping(const std::string& file_name_utf8); | |
| 30 | |
| 31 #if defined(OS_POSIX) | |
| 32 // Opens the file referred to by |zip_fd| for unzipping. | |
| 33 unzFile OpenFdForUnzipping(int zip_fd); | |
| 34 #endif | |
| 35 | |
| 36 #if defined(OS_WIN) | |
| 37 // Opens the file referred to by |zip_handle| for unzipping. | |
| 38 unzFile OpenHandleForUnzipping(HANDLE zip_handle); | |
| 39 #endif | |
| 40 | |
| 41 // Creates a custom unzFile object which reads data from the specified string. | |
| 42 // This custom unzFile object overrides the I/O API functions of zlib so it can | |
| 43 // read data from the specified string. | |
| 44 unzFile PreprareMemoryForUnzipping(const std::string& data); | |
| 45 | |
| 46 // Opens the given file name in UTF-8 for zipping, with some setup for | |
| 47 // Windows. |append_flag| will be passed to zipOpen2(). | |
| 48 zipFile OpenForZipping(const std::string& file_name_utf8, int append_flag); | |
| 49 | |
| 50 #if defined(OS_POSIX) | |
| 51 // Opens the file referred to by |zip_fd| for zipping. |append_flag| will be | |
| 52 // passed to zipOpen2(). | |
| 53 zipFile OpenFdForZipping(int zip_fd, int append_flag); | |
| 54 #endif | |
| 55 | |
| 56 const int kZipMaxPath = 256; | |
| 57 const int kZipBufSize = 8192; | |
| 58 | |
| 59 } // namespace internal | |
| 60 } // namespace zip | |
| 61 | |
| 62 #endif // CHROME_TEST_CHROMEDRIVER_ZIP_INTERNAL_H_ | |
| OLD | NEW |