This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
built_in:zip [2014/12/18 21:38] bcarroll [Methods] |
built_in:zip [2016/01/22 17:38] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== ZipUtil control ====== | ====== ZipUtil control ====== | ||
===== Create ===== | ===== Create ===== | ||
- | Create a ZipUtil control using the CreateZipUtil function of the app object: | + | Create a ZipUtil control using the CreateZipUtil function of the [[built_in:app|app]] |
< | < | ||
Also you can use it in a function like this: | Also you can use it in a function like this: | ||
- | < | + | < |
+ | function unzip(zipfile, | ||
+ | { | ||
var zip = app.CreateZipUtil(); | var zip = app.CreateZipUtil(); | ||
zip.Open(zipfile); | zip.Open(zipfile); | ||
var files = zip.List().split("," | var files = zip.List().split("," | ||
- | files.forEach(function (item) { | + | files.forEach(function (item) |
+ | | ||
zip.Extract(item, | zip.Extract(item, | ||
}); | }); | ||
Line 15: | Line 18: | ||
</ | </ | ||
===== Methods ===== | ===== Methods ===== | ||
- | ^Method ^Description ^ | + | ^ Method |
- | |ZipUtil.Open( file ) | | | + | | ZipUtil.AddFile( name,file ) | | |
- | |ZipUtil.Create( file ) | | | + | | ZipUtil.AddText( name, |
- | |ZipUtil.Close() | | | + | | ZipUtil.Close() |
- | |ZipUtil.List( path ) | | | + | | ZipUtil.Create( file ) | | |
- | |ZipUtil.Extract( name,file ) | | | + | | ZipUtil.Extract( name,file ) | | |
- | |ZipUtil.AddFile( name, | + | | ZipUtil.List( path ) | | |
- | |ZipUtil.AddText( name,text ) | | | + | | ZipUtil.Open( file ) | | |
- | |ZipUtil.CreateKey( file, | + | |
- | |ZipUtil.CreateDebugKey( file ) | | | + | |
- | |ZipUtil.Sign( fileIn, | + | |
- | |ZipUtil.UpdateManifest( fileIn, fileOut, packageName, | + |