Unzip Class
This class allows to extract zip archive.
Example:
var archive = new Unzip("dat://archive.zip");
if (!archive || !archive.first())
return;
// extract all files to the application folder
do {
archive.unzip("dat://");
} while (archive.next());
Methods
this
(
Unzip
file
Object constructor - creates new instance of Unzip class.
Parameters:
-
file
StringLocation of the archive.
Returns:
close
()
Close the archive and release all resources in the memory.
first
() Boolean
Sets first file as a "active file". Property currentFileInfo has values of this file.
Returns:
Boolean: True, if operation was succesfull.
next
() Boolean
Sets next file as a "active file". Property currentFileInfo has values of this file.
Returns:
Boolean: True, if operation was succesfull.
Example:
// extract all files to the application folder
do {
archive.unzip("data://");
} while (archive.next());
unzip
(
directory
This function unzips file, which was set by first() and next() functions, to the directory.
Parameters:
-
directory
StringDirectory to place unzipped files.
Properties
currentFileInfo
Object
Information about a file from the archive. The file, about which information are required, can be set by first() and next() functions. This property is an object consisted from three members: fileName, compressedSize and uncompressedSize.