aboutsummaryrefslogtreecommitdiff
path: root/common/unzip.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/unzip.cpp')
-rw-r--r--common/unzip.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/common/unzip.cpp b/common/unzip.cpp
index 054200e7a2..894631b262 100644
--- a/common/unzip.cpp
+++ b/common/unzip.cpp
@@ -1363,7 +1363,7 @@ class ZipArchiveMember : public ArchiveMember {
unzFile _zipFile;
public:
- ZipArchiveMember(FilesystemNode &node) : _node(node) {
+ ZipArchiveMember(FSNode &node) : _node(node) {
}
String getName() const {
@@ -1393,7 +1393,22 @@ 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];
+ int fileCount = 0;
+
+ do {
+ unzGetCurrentFileInfo(_zipFile, 0, fileNameBuffer, UNZ_MAXFILENAMEINZIP + 1, 0, 0, 0, 0);
+ list.push_back(Common::String(fileNameBuffer));
+ fileCount++;
+ } while (unzGoToNextFile(_zipFile) == UNZ_OK);
+
+ return fileCount;
}
/*