Moscrif API Docs for: 2012q3
Show:

Unzip Class

Library: zip

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());

Item Index

Methods

Properties

Methods

this

(
  • file
)
Unzip

Object constructor - creates new instance of Unzip class.

Parameters:

  • file String

    Location 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 String

    Directory to place unzipped files.

Properties

count

Integer

Count of a files in the archive.

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.