diff options
Diffstat (limited to 'common/unzip.cpp')
-rw-r--r-- | common/unzip.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/common/unzip.cpp b/common/unzip.cpp index 054200e7a2..27001519a1 100644 --- a/common/unzip.cpp +++ b/common/unzip.cpp @@ -1393,7 +1393,26 @@ 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 { + unzOpenCurrentFile(_zipFile); + unzGetCurrentFileInfo(_zipFile, 0, fileNameBuffer, UNZ_MAXFILENAMEINZIP+1, 0, 0, 0, 0); + + list.push_back(Common::String(fileNameBuffer)); + + unzCloseCurrentFile(_zipFile); + + } while (unzGoToNextFile(_zipFile) == UNZ_OK); + + return list.size(); } /* |