16using namespace llvm::support;
20 std::string &file_path,
25 static constexpr llvm::StringLiteral k_zip_separator(
"!/");
26 std::string path(file_spec.
GetPath());
27 size_t pos = path.find(k_zip_separator);
32 static constexpr llvm::StringLiteral k_zip_separator_win(
"!\\");
33 if (pos == std::string::npos)
34 pos = path.find(k_zip_separator_win);
37 if (pos == std::string::npos) {
49 std::string zip_path(path.substr(0, pos));
50 std::string so_path(path.substr(pos + k_zip_separator.size()));
55 std::replace(so_path.begin(), so_path.end(),
'\\',
'/');
63 if (
ZipFile::Find(zip_data, so_path, so_file_offset, so_file_size)) {
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
uint64_t GetByteSize(const FileSpec &file_spec) const
Returns the on-disk size of the given file in bytes.
static FileSystem & Instance()
std::shared_ptr< DataBuffer > CreateDataBuffer(const llvm::Twine &path, uint64_t size=0, uint64_t offset=0)
Create memory buffer from path.
static bool ResolveSharedLibraryPath(const FileSpec &file_spec, FileKind &file_kind, std::string &file_path, lldb::offset_t &so_file_offset, lldb::offset_t &so_file_size)
static bool Find(lldb::DataBufferSP zip_data, const llvm::StringRef file_path, lldb::offset_t &file_offset, lldb::offset_t &file_size)
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP