[Scummvm-cvs-logs] SF.net SVN: scummvm:[34691] scummvm/trunk/common

tanoku at users.sourceforge.net tanoku at users.sourceforge.net
Tue Sep 30 00:29:12 CEST 2008


Revision: 34691
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34691&view=rev
Author:   tanoku
Date:     2008-09-29 22:29:07 +0000 (Mon, 29 Sep 2008)

Log Message:
-----------
Ported ZipArchive::getAllNames() implementation from GUI branch.

Modified Paths:
--------------
    scummvm/trunk/common/unzip.cpp
    scummvm/trunk/common/unzip.h

Modified: scummvm/trunk/common/unzip.cpp
===================================================================
--- scummvm/trunk/common/unzip.cpp	2008-09-29 21:44:07 UTC (rev 34690)
+++ scummvm/trunk/common/unzip.cpp	2008-09-29 22:29:07 UTC (rev 34691)
@@ -1393,7 +1393,21 @@
 }
 
 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();
 }
 
 /*

Modified: scummvm/trunk/common/unzip.h
===================================================================
--- scummvm/trunk/common/unzip.h	2008-09-29 21:44:07 UTC (rev 34690)
+++ scummvm/trunk/common/unzip.h	2008-09-29 22:29:07 UTC (rev 34691)
@@ -44,7 +44,7 @@
 	bool isOpen() const;
 
 	virtual bool hasFile(const String &name);
-	virtual int getAllNames(StringList &list);	// FIXME: This one is not (yet?) implemented
+	virtual int getAllNames(StringList &list);
 	virtual Common::SeekableReadStream *openFile(const Common::String &name);
 };
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list