| CODENOTIFIER | HelpYou are not signed inSign in |
Project: ScummVM
Revision: 34691
Author: tanoku
Date: 29 Sep 2008 18:29:07
Changes:Ported ZipArchive::getAllNames() implementation from GUI branch.
Files:| ... | ...@@ -1393,7 +1393,21 @@ | |
| 1393 | 1393 | } |
| 1394 | 1394 | |
| 1395 | 1395 | int ZipArchive::getAllNames(Common::StringList &list) { |
| 1396 | return 0; | |
| 1396 | if (!_zipFile) | |
| 1397 | return 0; | |
| 1398 | ||
| 1399 | if (unzGoToFirstFile(_zipFile) != UNZ_OK) | |
| 1400 | return 0; | |
| 1401 | ||
| 1402 | char fileNameBuffer[UNZ_MAXFILENAMEINZIP + 1]; | |
| 1403 | list.clear(); | |
| 1404 | ||
| 1405 | do { | |
| 1406 | unzGetCurrentFileInfo(_zipFile, 0, fileNameBuffer, UNZ_MAXFILENAMEINZIP + 1, 0, 0, 0, 0); | |
| 1407 | list.push_back(Common::String(fileNameBuffer)); | |
| 1408 | } while (unzGoToNextFile(_zipFile) == UNZ_OK); | |
| 1409 | ||
| 1410 | return list.size(); | |
| 1397 | 1411 | } |
| 1398 | 1412 | |
| 1399 | 1413 | /* |
| ... | ...@@ -44,7 +44,7 @@ | |
| 44 | 44 | bool isOpen() const; |
| 45 | 45 | |
| 46 | 46 | virtual bool hasFile(const String &name); |
| 47 | virtual int getAllNames(StringList &list); // FIXME: This one is not (yet?) implemented | |
| 47 | virtual int getAllNames(StringList &list); | |
| 48 | 48 | virtual Common::SeekableReadStream *openFile(const Common::String &name); |
| 49 | 49 | }; |
| 50 | 50 |