Lines Matching refs:zip

2036 		case 'zip': return write_zip(cfb, _opts);
3533 function safegetzipfile(zip, file/*:string*/) { argument
3534 var k = zip.FullPaths || keys(zip.files);
3538 if(f == n || g == n) return zip.files ? zip.files[k[i]] : zip.FileIndex[i];
3543 function getzipfile(zip, file/*:string*/) { argument
3544 var o = safegetzipfile(zip, file);
3545 if(o == null) throw new Error("Cannot find file " + file + " in zip");
3549 function getzipdata(zip, file/*:string*/, safe/*:?boolean*/)/*:any*/ { argument
3550 if(!safe) return getdata(getzipfile(zip, file));
3552 try { return getzipdata(zip, file); } catch(e) { return null; }
3555 function getzipstr(zip, file/*:string*/, safe/*:?boolean*/)/*:?string*/ { argument
3556 if(!safe) return getdatastr(getzipfile(zip, file));
3558 try { return getzipstr(zip, file); } catch(e) { return null; }
3561 function getzipbin(zip, file/*:string*/, safe/*:?boolean*/)/*:any*/ { argument
3562 if(!safe) return getdatabin(getzipfile(zip, file));
3564 try { return getzipbin(zip, file); } catch(e) { return null; }
3567 function zipentries(zip) { argument
3568 var k = zip.FullPaths || keys(zip.files), o = [];
3573 function zip_add_file(zip, path, content) { argument
3574 if(zip.FullPaths) {
3581 return CFB.utils.cfb_add(zip, path, res);
3583 CFB.utils.cfb_add(zip, path, content);
3585 else zip.file(path, content);
11694 /* [MS-XLS] 2.4.326 TODO: payload is a zip file */
11702 var zip; try { zip = zip_read(data, {type: "array"}); } catch(e) { return; }
11703 var themeXML = getzipstr(zip, "theme/theme/theme1.xml", true);
22614 function parse_ods(zip/*:ZIPFile*/, opts/*:?ParseOpts*/)/*:Workbook*/ { argument
22616 …if(safegetzipfile(zip, 'META-INF/manifest.xml')) parse_manifest(getzipdata(zip, 'META-INF/manifest…
22617 var styles = getzipstr(zip, 'styles.xml');
22619 var content = getzipstr(zip, 'content.xml');
22622 if(safegetzipfile(zip, 'meta.xml')) wb.Props = parse_core_props(getzipdata(zip, 'meta.xml'));
23073 var zip = zip_new();
23081 zip_add_file(zip, f, "application/vnd.oasis.opendocument.spreadsheet");
23085 zip_add_file(zip, f, write_content_ods(wb, opts));
23091 zip_add_file(zip, f, write_styles_ods(wb, opts));
23097 zip_add_file(zip, f, XML_HEADER + write_meta_ods(/*::wb, opts*/));
23103 zip_add_file(zip, f, write_rdf(rdf/*, opts*/));
23108 zip_add_file(zip, f, write_manifest(manifest/*, opts*/));
23110 return zip;
25084 function safe_parse_sheet(zip, path/*:string*/, relsPath/*:string*/, sheet, idx/*:number*/, sheetRe… argument
25086 sheetRels[sheet]=parse_rels(getzipstr(zip, relsPath, true), path);
25087 var data = getzipdata(zip, path);
25095 …var draw = parse_drawing(getzipstr(zip, dfile, true), parse_rels(getzipstr(zip, drelsp, true), dfi…
25098 …_ws = parse_chart(getzipstr(zip, chartp, true), chartp, opts, parse_rels(getzipstr(zip, crelsp, tr…
25112 comments = parse_cmnt(getzipdata(zip, dfile, true), dfile, opts);
25118 tcomments = tcomments.concat(parse_tcmnt_xml(getzipdata(zip, dfile, true), opts));
25127 function parse_zip(zip/*:ZIP*/, opts/*:?ParseOpts*/)/*:Workbook*/ { argument
25133 if(safegetzipfile(zip, 'META-INF/manifest.xml')) return parse_ods(zip, opts);
25135 if(safegetzipfile(zip, 'objectdata.xml')) return parse_ods(zip, opts);
25137 if(safegetzipfile(zip, 'Index/Document.iwa')) {
25140 if(zip.FileIndex) return parse_numbers_iwa(zip, opts);
25142 zipentries(zip).forEach(function(e) { zip_add_file(_zip, e, getzipbin(zip, e)); });
25147 if(!safegetzipfile(zip, '[Content_Types].xml')) {
25148 if(safegetzipfile(zip, 'index.xml.gz')) throw new Error('Unsupported NUMBERS 08 file');
25149 if(safegetzipfile(zip, 'index.xml')) throw new Error('Unsupported NUMBERS 09 file');
25150 var index_zip = CFB.find(zip, 'Index.zip');
25162 var entries = zipentries(zip);
25163 var dir = parse_ct((getzipstr(zip, '[Content_Types].xml')/*:?any*/));
25168 if(getzipdata(zip,binname, true)) dir.workbooks.push(binname);
25172 if(!getzipdata(zip,binname,true)) throw new Error("Could not find workbook");
25182 …if(dir.sst) try { strs=parse_sst(getzipdata(zip, strip_front_slash(dir.sst)), dir.sst, opts); } ca…
25184 …if(opts.cellStyles && dir.themes.length) themes = parse_theme_xml(getzipstr(zip, dir.themes[0].rep…
25186 …if(dir.style) styles = parse_sty(getzipdata(zip, strip_front_slash(dir.style)), dir.style, themes,…
25191 var rels = parse_rels(getzipstr(zip, get_rels_path(strip_front_slash(link))), link);
25192 return parse_xlink(getzipdata(zip, strip_front_slash(link)), rels, link, opts);
25196 var wb = parse_wb(getzipdata(zip, strip_front_slash(dir.workbooks[0])), dir.workbooks[0], opts);
25201 propdata = getzipdata(zip, strip_front_slash(dir.coreprops[0]), true);
25204 propdata = getzipdata(zip, strip_front_slash(dir.extprops[0]), true);
25212 propdata = getzipstr(zip, strip_front_slash(dir.custprops[0]), true);
25228 …if(opts.bookDeps && dir.calcchain) deps=parse_cc(getzipdata(zip, strip_front_slash(dir.calcchain))…
25246 if(!safegetzipfile(zip, wbrelsfile)) wbrelsfile = 'xl/_rels/workbook.' + wbext + '.rels';
25247 var wbrels = parse_rels(getzipstr(zip, wbrelsfile, true), wbrelsfile.replace(/_rels.*/, "s5s"));
25251 …opts.xlmeta = parse_xlmeta(getzipdata(zip, strip_front_slash(dir.metadata[0])),dir.metadata[0],opt…
25255 opts.people = parse_people_xml(getzipdata(zip, strip_front_slash(dir.people[0])),opts);
25261 var nmode = (getzipdata(zip,"xl/worksheets/sheet.xml",true))?1:0;
25266 if(!safegetzipfile(zip, path)) path = wbrels[i][1];
25267 if(!safegetzipfile(zip, path)) path = wbrelsfile.replace(/_rels\/.*$/,"") + wbrels[i][1];
25286 …safe_parse_sheet(zip, path, relsPath, props.SheetNames[i], i, sheetRels, sheets, stype, opts, wb, …
25303 if(zip.files) {
25305 out.files = zip.files;
25309 zip.FullPaths.forEach(function(p, idx) {
25312 out.files[p] = zip.FileIndex[idx];
25317 if(dir.vba.length > 0) out.vbaraw = getzipdata(zip,strip_front_slash(dir.vba[0]),true);
25318 …else if(dir.defaults && dir.defaults.bin === CT_VBA) out.vbaraw = getzipdata(zip, 'xl/vbaProject.b…
25389 var zip = zip_new();
25398 zip_add_file(zip, f, write_core_props(wb.Props, opts));
25413 zip_add_file(zip, f, write_ext_props(wb.Props, opts));
25419 zip_add_file(zip, f, write_cust_props(wb.Custprops, opts));
25433 zip_add_file(zip, f, write_ws_bin(rId-1, opts, wb, wsrels));
25444 zip_add_file(zip, cf, write_comments_bin(comments, opts));
25450 …if(need_vml) zip_add_file(zip, "xl/drawings/vmlDrawing" + (rId) + ".vml", write_vml(rId, ws['!comm…
25456 if(wsrels['!id'].rId1) zip_add_file(zip, get_rels_path(f), write_rels(wsrels));
25461 zip_add_file(zip, f, write_sst_bin(opts.Strings, opts));
25467 zip_add_file(zip, f, write_wb_bin(wb, opts));
25475 zip_add_file(zip, f, ww);
25482 zip_add_file(zip, f, write_sty_bin(wb, opts));
25488 zip_add_file(zip, f, wb.vbaraw);
25494 zip_add_file(zip, f, write_xlmeta_bin());
25498 zip_add_file(zip, "[Content_Types].xml", write_ct(ct, opts));
25499 zip_add_file(zip, '_rels/.rels', write_rels(opts.rels));
25500 zip_add_file(zip, 'xl/_rels/workbook.' + wbext + '.rels', write_rels(opts.wbrels));
25503 return zip;
25524 var zip = zip_new();
25533 zip_add_file(zip, f, write_core_props(wb.Props, opts));
25548 zip_add_file(zip, f, write_ext_props(wb.Props, opts));
25554 zip_add_file(zip, f, write_cust_props(wb.Custprops, opts));
25571 zip_add_file(zip, f, write_ws_xml(rId-1, opts, wb, wsrels));
25587 zip_add_file(zip, cf, write_tcmnt_xml(comments, people, opts));
25593 zip_add_file(zip, cf, write_comments_xml(comments, opts));
25599 …if(need_vml) zip_add_file(zip, "xl/drawings/vmlDrawing" + (rId) + ".vml", write_vml(rId, ws['!comm…
25605 if(wsrels['!id'].rId1) zip_add_file(zip, get_rels_path(f), write_rels(wsrels));
25610 zip_add_file(zip, f, write_sst_xml(opts.Strings, opts));
25616 zip_add_file(zip, f, write_wb_xml(wb, opts));
25623 zip_add_file(zip, f, write_theme(wb.Themes, opts));
25630 zip_add_file(zip, f, write_sty_xml(wb, opts));
25636 zip_add_file(zip, f, wb.vbaraw);
25642 zip_add_file(zip, f, write_xlmeta_xml());
25648 zip_add_file(zip, f, write_people_xml(people, opts));
25653 zip_add_file(zip, "[Content_Types].xml", write_ct(ct, opts));
25654 zip_add_file(zip, '_rels/.rels', write_rels(opts.rels));
25655 zip_add_file(zip, 'xl/_rels/workbook.' + wbext + '.rels', write_rels(opts.wbrels));
25658 return zip;
25679 var zip, d = data;
25682 zip = zip_read(d, o);
25683 return parse_zip(zip, o);
25829 …var out = z.FullPaths ? CFB.write(z, {fileType:"zip", type: /*::(*/{"nodebuffer": "buffer", "strin…