aboutsummaryrefslogtreecommitdiff
path: root/common/unzip.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/unzip.cpp')
-rw-r--r--common/unzip.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/common/unzip.cpp b/common/unzip.cpp
index 054200e7a2..775a6e2dab 100644
--- a/common/unzip.cpp
+++ b/common/unzip.cpp
@@ -1393,7 +1393,21 @@ bool ZipArchive::hasFile(const Common::String &name) {
}
int ZipArchive::getAllNames(Common::StringList &list) {
- return 0;
+ if (!_zipFile)
+ return 0;
+
+ if (unzGoToFirstFile(_zipFile) != UNZ_OK)
+ return 0;
+
+ char fileNameBuffer[UNZ_MAXFILENAMEINZIP + 1];
+ list.clear();
+
+ do {
+ unzGetCurrentFileInfo(_zipFile, 0, fileNameBuffer, UNZ_MAXFILENAMEINZIP + 1, 0, 0, 0, 0);
+ list.push_back(Common::String(fileNameBuffer));
+ } while (unzGoToNextFile(_zipFile) == UNZ_OK);
+
+ return list.size();
}
/*