From 3675a4e4a378d125d52c6e6e1f2f15b8da9b6dab Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Wed, 21 May 2025 23:00:51 +0200 Subject: [PATCH] Update path handling --- openVulkanoCpp/IO/Archive/ArchiveReader.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/openVulkanoCpp/IO/Archive/ArchiveReader.cpp b/openVulkanoCpp/IO/Archive/ArchiveReader.cpp index 5c3a547..d9fb1ff 100644 --- a/openVulkanoCpp/IO/Archive/ArchiveReader.cpp +++ b/openVulkanoCpp/IO/Archive/ArchiveReader.cpp @@ -284,16 +284,19 @@ namespace OpenVulkano if (SkipTill(std::filesystem::file_type::regular)) { FileDescription fileDescription = GetNextDescription(); - std::string outputFilePath; + std::filesystem::path outputFilePath; if (m_filePathRewrite) - outputFilePath = (targetDir / m_filePathRewrite(fileDescription.path)).string(); + outputFilePath = targetDir / m_filePathRewrite(fileDescription.path); else - outputFilePath = (targetDir / fileDescription.path).string(); + outputFilePath = targetDir / static_cast(fileDescription.path); const std::unique_ptr a(archive_write_disk_new(), archive_write_free); const std::unique_ptr entry(archive_entry_clone(m_archiveEntry), archive_entry_free); - archive_entry_set_pathname(entry.get(), outputFilePath.c_str()); + if constexpr (std::is_same_v) + archive_entry_set_pathname(entry.get(), (const char*)outputFilePath.c_str()); + else + archive_entry_copy_pathname_w(entry.get(), (const wchar_t*)outputFilePath.c_str()); ChkErr(archive_write_disk_set_options(a.get(), ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_ACL | ARCHIVE_EXTRACT_FFLAGS));