1 //===-- ZipFile.h -----------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_UTILITY_ZIPFILE_H
10 #define LLDB_UTILITY_ZIPFILE_H
11 
12 #include "lldb/lldb-private.h"
13 
14 namespace lldb_private {
15 
16 /// In Android API level 23 and above, bionic dynamic linker is able to load
17 /// .so file directly from APK or .zip file. This is a utility class to find
18 /// .so file offset and size from zip file.
19 /// https://android.googlesource.com/platform/bionic/+/master/
20 /// android-changes-for-ndk-developers.md#
21 /// opening-shared-libraries-directly-from-an-apk
22 class ZipFile {
23 public:
24   static bool Find(lldb::DataBufferSP zip_data, const llvm::StringRef file_path,
25                    lldb::offset_t &file_offset, lldb::offset_t &file_size);
26 };
27 
28 } // end of namespace lldb_private
29 
30 #endif // LLDB_UTILITY_ZIPFILE_H
31