mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 22:41:49 +00:00
fix ZipFileDevice::list
This commit is contained in:
parent
3f3972a952
commit
6286096b57
1 changed files with 17 additions and 0 deletions
|
|
@ -173,6 +173,20 @@ ZipFileDevice::ZipFileDevice(
|
||||||
entries[entry.fileName] = std::move(entry);
|
entries[entry.fileName] = std::move(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto& [name, _] : entries) {
|
||||||
|
io::path path = name;
|
||||||
|
|
||||||
|
while (!(path = path.parent()).pathPart().empty()) {
|
||||||
|
if (entries.find(path.pathPart()) != entries.end()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
Entry entry {};
|
||||||
|
entry.isDirectory = true;
|
||||||
|
entries[path.pathPart()] = entry;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
for (auto& [_, entry] : entries) {
|
for (auto& [_, entry] : entries) {
|
||||||
findBlob(entry);
|
findBlob(entry);
|
||||||
}
|
}
|
||||||
|
|
@ -243,6 +257,9 @@ bool ZipFileDevice::exists(std::string_view path) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ZipFileDevice::isdir(std::string_view path) {
|
bool ZipFileDevice::isdir(std::string_view path) {
|
||||||
|
if (path.empty()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
const auto& found = entries.find(std::string(path));
|
const auto& found = entries.find(std::string(path));
|
||||||
if (found == entries.end()) {
|
if (found == entries.end()) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue