Lines Matching refs:opts

112 SSF.opts = opts_fmt;
190 function general_fmt_int(v, opts) { return ""+v; } argument
214 return function general_fmt_num(v, opts) { argument
223 function general_fmt(v, opts) { argument
227 case 'number': return (v|0) === v ? general_fmt_int(v, opts) : general_fmt_num(v, opts);
233 function parse_date_code(v,opts,b2) { argument
239 fixopts(opts != null ? opts : (opts=[]));
240 if(opts.date1904) date += 1462;
610 function eval_fmt(fmt, v, opts, flen) { argument
629 if(dt==null) { dt=parse_date_code(v, opts, fmt[i+1] === "2"); if(dt==null) return ""; }
638 if(dt==null) { dt=parse_date_code(v, opts); if(dt==null) return ""; }
645 if(dt==null) dt=parse_date_code(v, opts);
656 if(dt==null) { dt=parse_date_code(v, opts); if(dt==null) return ""; }
736 case 'G': out[i].t = 't'; out[i].v = general_fmt(v,opts); break;
1682 function recordhopper(data, cb, opts) { argument
1692 var d = R.f(data, length, opts);
2403 function parse_ct(data, opts) { argument
2417 else if(opts.WTF) console.error(y);
2444 function write_ct(ct, opts) { argument
2454 'ContentType': CT_LIST[w][opts.bookType || 'xlsx']
2462 'ContentType': CT_LIST[w][opts.bookType || 'xlsx']
2603 function write_core_props(cp, opts) { argument
2608 ….CreatedDate === "string" ? cp.CreatedDate : write_w3cdtf(cp.CreatedDate, opts.WTF), {"xsi:type":"…
2609 …difiedDate === "string" ? cp.ModifiedDate : write_w3cdtf(cp.ModifiedDate, opts.WTF), {"xsi:type":"…
2668 function write_ext_props(cp, opts) { argument
2696 function parse_cust_props(data, opts) { argument
2736 } else if(opts.WTF) throw new Error(x);
2747 function write_cust_props(cp, opts) { argument
2880 var t = blob.read_shift(2), ret, opts = _opts||{};
2885 case 0x02 /*VT_I2*/: ret = blob.read_shift(2, 'i'); if(!opts.raw) blob.l += 2; return ret;
2894 case 0x50 /*VT_STRING*/: return parse_VtString(blob, t, !opts.raw && 4).replace(chr0,'');
3073 function parse_ShortXLUnicodeString(blob, length, opts) { argument
3077 if(opts && opts.biff >= 8) current_codepage = 1200;
3078 if(opts === undefined || opts.biff !== 5) {
3109 function parse_XLUnicodeStringNoCch(blob, cch, opts) { argument
3118 function parse_XLUnicodeString(blob, length, opts) { argument
3119 var cch = blob.read_shift(opts !== undefined && opts.biff > 0 && opts.biff < 8 ? 1 : 2);
3121 return parse_XLUnicodeStringNoCch(blob, cch, opts);
3124 function parse_XLUnicodeString2(blob, length, opts) { argument
3125 if(opts.biff !== 5 && opts.biff !== 2) return parse_XLUnicodeString(blob, length, opts);
7295 if(opts.cellStyles && data.indexOf("</cols>")!==-1) {
7305 if(mtch) parse_ws_xml_data(mtch[1], s, opts, refguess);
7311 if(opts.sheetRows > 0 && s["!ref"]) {
7313 if(opts.sheetRows < +tmpref.e.r) {
7314 tmpref.e.r = opts.sheetRows - 1;
7390 function write_ws_xml_cell(cell, ref, ws, opts, idx, wb) { argument
7399 if(opts.cellDates) vv = new Date(cell.v).toISOString();
7410 var os = get_cell_style(opts.cellXfs, cell, opts);
7418 if(opts.bookSST) {
7419 v = writetag('v', ''+get_sst_id(opts.Strings, cell.v));
7433 return function parse_ws_xml_data(sdata, s, opts, guess) { argument
7448 if(opts.sheetRows && opts.sheetRows < tagr) continue;
7475 if(opts.cellFormula && (cref=d.match(match_f))!== null) p.f=unescapexml(cref[1]);
7479 if(!opts.sheetStubs) continue;
7492 if(opts.cellHTML) p.h = sstr.h;
7497 if(opts.cellHTML) p.h = p.v;
7506 if(!opts.cellDates) { p.v = datenum(p.v); p.t = 'n'; }
7517 if(opts.cellStyles && cf.fillId != null) fillid = cf.fillId;
7520 safe_format(p, fmtid, fillid, opts);
7526 function write_ws_xml_data(ws, opts, idx, wb) { argument
7535 if((cell = write_ws_xml_cell(ws[ref], ref, ws, opts, idx, wb)) != null) r.push(cell);
7547 function write_ws_xml(idx, opts, wb) { argument
7558 rdata = write_ws_xml_data(ws, opts, idx, wb);
7644 function parse_BrtFmlaBool(data, length, opts) { argument
7648 if(opts.cellFormula) {
7657 function parse_BrtFmlaError(data, length, opts) { argument
7661 if(opts.cellFormula) {
7670 function parse_BrtFmlaNum(data, length, opts) { argument
7674 if(opts.cellFormula) {
7683 function parse_BrtFmlaString(data, length, opts) { argument
7688 if(opts.cellFormula) {
7699 function parse_BrtHLink(data, length, opts) { argument
7711 function parse_ws_bin(data, opts, rels) { argument
7728 if(opts.sheetRows && opts.sheetRows <= row.r) end=true;
7750 if(opts.cellFormula && val.length > 3) p.f = val[3];
7751 if((cf = styles.CellXf[val[0].iStyleRef])) safe_format(p,cf.ifmt,null,opts);
7759 case 'BrtCellBlank': if(!opts.sheetStubs) break;
7896 default: if(!pass || opts.WTF) throw new Error("Unexpected record " + R.n);
7898 }, opts);
7900 if(opts.sheetRows && s["!ref"]) {
7902 if(opts.sheetRows < +tmpref.e.r) {
7903 tmpref.e.r = opts.sheetRows - 1;
7917 function write_ws_bin_cell(ba, cell, R, C, opts) { argument
7927 o.s = get_cell_style(opts.cellXfs, cell, opts);
7930 if(opts.bookSST) {
7931 vv = get_sst_id(opts.Strings, cell.v);
7942 function write_CELLTABLE(ba, ws, idx, opts, wb) { argument
7955 write_ws_bin_cell(ba, ws[ref], R, C, opts);
7961 function write_ws_bin(idx, opts, wb) { argument
7971 write_CELLTABLE(ba, ws, idx, opts, wb);
8109 function parse_wb_xml(data, opts) { argument
8213 default: if(!pass && opts.WTF) throw 'unrecognized ' + y[0] + ' in workbook';
8235 function write_wb_xml(wb, opts) { argument
8287 function parse_wb_bin(data, opts) { argument
8341 default: if(!pass || opts.WTF) throw new Error("Unexpected record " + R.n);
8351 function write_BUNDLESHS(ba, wb, opts) { argument
8373 function write_BOOKVIEWS(ba, wb, opts) { argument
8399 function write_wb_bin(wb, opts) { argument
8407 write_BOOKVIEWS(ba, wb, opts);
8408 write_BUNDLESHS(ba, wb, opts);
8427 function parse_wb(data, name, opts) { argument
8428 return (name.substr(-4)===".bin" ? parse_wb_bin : parse_wb_xml)(data, opts);
8431 function parse_ws(data, name, opts, rels) { argument
8432 return (name.substr(-4)===".bin" ? parse_ws_bin : parse_ws_xml)(data, opts, rels);
8435 function parse_sty(data, name, opts) { argument
8436 return (name.substr(-4)===".bin" ? parse_sty_bin : parse_sty_xml)(data, opts);
8439 function parse_theme(data, name, opts) { argument
8440 return parse_theme_xml(data, opts);
8443 function parse_sst(data, name, opts) { argument
8444 return (name.substr(-4)===".bin" ? parse_sst_bin : parse_sst_xml)(data, opts);
8447 function parse_cmnt(data, name, opts) { argument
8448 return (name.substr(-4)===".bin" ? parse_comments_bin : parse_comments_xml)(data, opts);
8451 function parse_cc(data, name, opts) { argument
8452 return (name.substr(-4)===".bin" ? parse_cc_bin : parse_cc_xml)(data, opts);
8455 function write_wb(wb, name, opts) { argument
8456 return (name.substr(-4)===".bin" ? write_wb_bin : write_wb_xml)(wb, opts);
8459 function write_ws(data, name, opts, wb) { argument
8460 return (name.substr(-4)===".bin" ? write_ws_bin : write_ws_xml)(data, opts, wb);
8463 function write_sty(data, name, opts) { argument
8464 return (name.substr(-4)===".bin" ? write_sty_bin : write_sty_xml)(data, opts);
8467 function write_sst(data, name, opts) { argument
8468 return (name.substr(-4)===".bin" ? write_sst_bin : write_sst_xml)(data, opts);
8550 function process_style_xlml(styles, stag, opts) { argument
8551 if(opts.cellStyles) {
8621 function parse_xlml_xml(d, opts) { argument
8639 …s, dtag, state[state.length-1][0]=="Comment"?comment:cell, {c:c,r:r}, styles, cstys[c], row, opts);
8645 …if((!opts.sheetRows || opts.sheetRows > r) && cell.v !== undefined) cursheet[encode_col(c) + encod…
8708 if(Rn[1]==='/') process_style_xlml(styles, stag, opts);
8741 if(!opts.cellStyles) break;
9156 if(opts.WTF) throw 'Unrecognized tag: ' + Rn[3] + "|" + state.join("|");
9159 if(!opts.bookSheets && !opts.bookProps) out.Sheets = sheets;
9167 function parse_xlml(data, opts) { argument
9168 fix_read_opts(opts=opts||{});
9169 switch(opts.type||"base64") {
9170 case "base64": return parse_xlml_xml(Base64.decode(data), opts);
9171 case "binary": case "buffer": case "file": return parse_xlml_xml(data, opts);
9172 case "array": return parse_xlml_xml(data.map(_chr).join(""), opts);
9176 function write_xlml(wb, opts) { } argument
9206 function slurp(R, blob, length, opts) { argument
9210 if(opts && opts.enc && opts.enc.insitu_decrypt) switch(R.n) {
9214 opts.enc.insitu_decrypt(d);
9229 return R.f(b, b.length, opts);
9232 function safe_format_xf(p, opts, date1904) { argument
9245 if(opts.cellNF) p.z = SSF._table[fmtid];
9246 } catch(e) { if(opts.WTF) throw e; }
9255 var wb = {opts:{}}; property in parse_workbook.wb
9303 var opts = { class in parse_workbook
9316 if(options.password) opts.password = options.password;
9321 supbooks.SheetNames = opts.snames;
9322 supbooks.sharedf = opts.sharedf;
9323 supbooks.arrayf = opts.arrayf;
9328 opts.codepage = 1200;
9344 if(!opts.enc && rt !== RecordType) throw "rt mismatch";
9349 if(R.n === 'EOF') val = R.f(blob, length, opts);
9350 else val = slurp(R, blob, length, opts);
9353 if(opts.biff === 5 || opts.biff === 2) switch(Rn) {
9359 case 'Date1904': wb.opts.Date1904 = val; break;
9360 case 'WriteProtect': wb.opts.WriteProtect = true; break;
9362 if(!opts.enc) blob.l = 0;
9363 opts.enc = val;
9364 if(opts.WTF) console.error(val);
9369 case 'WriteAccess': opts.lastuser = val; break;
9375 opts.codepage = val;
9378 case 'RRTabId': opts.rrtabid = val; break;
9379 case 'WinProtect': opts.winlocked = val; break;
9381 case 'RefreshAll': wb.opts.RefreshAll = val; break;
9387 case 'CalcCount': wb.opts.CalcCount = val; break;
9388 case 'CalcDelta': wb.opts.CalcDelta = val; break;
9389 case 'CalcIter': wb.opts.CalcIter = val; break;
9390 case 'CalcMode': wb.opts.CalcMode = val; break;
9391 case 'CalcPrecision': wb.opts.CalcPrecision = val; break;
9392 case 'CalcSaveRecalc': wb.opts.CalcSaveRecalc = val; break;
9393 case 'CalcRefMode': opts.CalcRefMode = val; break; // TODO: implement R1C1
9395 case 'ForceFullCalculation': wb.opts.FullCalc = val; break;
9410 … case 'Password': if(val !== 0 && opts.WTF) console.error("Password verifier: " + val); break;
9415 opts.snames.push(val.name);
9433 if(opts.biff !== 8);
9434 else if(val.BIFFVer === 0x0500) opts.biff = 5;
9435 else if(val.BIFFVer === 0x0002) opts.biff = 2;
9436 else if(val.BIFFVer === 0x0007) opts.biff = 2;
9440 if(opts.biff === 2) {
9450 if(temp_val.XF) safe_format_xf(temp_val, options, wb.opts.Date1904);
9455 if(temp_val.XF) safe_format_xf(temp_val, options, wb.opts.Date1904);
9460 if(temp_val.XF) safe_format_xf(temp_val, options, wb.opts.Date1904);
9467 if(temp_val.XF) safe_format_xf(temp_val, options, wb.opts.Date1904);
9478 …options.cellFormula) temp_val.f = "="+stringify_formula(val.formula,range,val.cell,supbooks, opts);
9479 if(temp_val.XF) safe_format_xf(temp_val, options, wb.opts.Date1904);
9489 …temp_val.f = "="+stringify_formula(last_formula.formula, range, last_formula.cell, supbooks, opts);
9490 if(temp_val.XF) safe_format_xf(temp_val, options, wb.opts.Date1904);
9508 if(temp_val.XF) safe_format_xf(temp_val, options, wb.opts.Date1904);
9515 if(temp_val.XF) safe_format_xf(temp_val, options, wb.opts.Date1904);
9530 case 'Obj': objects[val.cmo[0]] = opts.lastobj = val; break;
9531 case 'TxO': opts.lastobj.TxO = val; break;
9548 if(opts.biff <= 5 && opts.biff >= 2) break; /* TODO: BIFF5 */
9793 …var sheetnamesraw = opts.biff === 2 ? ['Sheet1'] : Object.keys(Directory).sort(function(a,b) { ret…
9801 if(opts.enc) wb.Encryption = opts.enc;
11084 function parse_ods(zip, opts) { argument
11087 return ODS.parse_ods(zip, opts);
11090 return function fix_opts(opts) { argument
11093 if(opts[d[0]] === undefined) opts[d[0]] = d[1];
11094 if(d[2] === 'n') opts[d[0]] = Number(opts[d[0]]);
11137 function safe_parse_ws(zip, path, relsPath, sheet, sheetRels, sheets, opts) { argument
11140 sheets[sheet]=parse_ws(getzipdata(zip, path),path,opts,sheetRels[sheet]);
11141 } catch(e) { if(opts.WTF) throw e; }
11145 function parse_zip(zip, opts) { argument
11147 opts = opts || {};
11148 fix_read_opts(opts);
11152 if(safegetzipfile(zip, 'META-INF/manifest.xml')) return parse_ods(zip, opts);
11155 var dir = parse_ct(getzipdata(zip, '[Content_Types].xml'), opts);
11171 if(!opts.bookSheets && !opts.bookProps) {
11173 if(dir.sst) strs=parse_sst(getzipdata(zip, dir.sst.replace(/^\//,'')), dir.sst, opts);
11176 … if(dir.style) styles = parse_sty(getzipdata(zip, dir.style.replace(/^\//,'')),dir.style, opts);
11179 …if(opts.cellStyles && dir.themes.length) themes = parse_theme(getzipdata(zip, dir.themes[0].replac…
11182 var wb = parse_wb(getzipdata(zip, dir.workbooks[0].replace(/^\//,'')), dir.workbooks[0], opts);
11196 if(!opts.bookSheets || opts.bookProps) {
11199 if(propdata) custprops = parse_cust_props(propdata, opts);
11204 if(opts.bookSheets || opts.bookProps) {
11207 if(opts.bookProps) { out.Props = props; out.Custprops = custprops; }
11209 if(opts.bookSheets ? out.SheetNames : opts.bookProps) return out;
11214 …if(opts.bookDeps && dir.calcchain) deps=parse_cc(getzipdata(zip, dir.calcchain.replace(/^\//,'')),…
11241 safe_parse_ws(zip, path, relsPath, props.SheetNames[i], sheetRels, sheets, opts);
11244 if(dir.comments) parse_comments(zip, dir.comments, sheets, sheetRels, opts);
11259 if(opts.bookFiles) {
11263 if(opts.bookVBA) {
11280 function write_zip(wb, opts) { argument
11286 opts.revssf = evert_num(wb.SSF); opts.revssf[wb.SSF[65535]] = 0;
11288 opts.rels = {}; opts.wbrels = {};
11289 opts.Strings = []; opts.Strings.Count = 0; opts.Strings.Unique = 0;
11290 var wbext = opts.bookType == "xlsb" ? "bin" : "xml";
11294 fix_write_opts(opts = opts || {});
11298 opts.cellXfs = [];
11299 get_cell_style(opts.cellXfs, {}, {revssf:{"General":0}});
11302 zip.file(f, write_core_props(wb.Props, opts));
11304 add_rels(opts.rels, 2, f, RELS.CORE_PROPS);
11310 zip.file(f, write_ext_props(wb.Props, opts));
11312 add_rels(opts.rels, 3, f, RELS.EXT_PROPS);
11316 zip.file(f, write_cust_props(wb.Custprops, opts));
11318 add_rels(opts.rels, 4, f, RELS.CUST_PROPS);
11322 zip.file(f, write_wb(wb, f, opts));
11324 add_rels(opts.rels, 1, f, RELS.WB);
11328 zip.file(f, write_ws(rId-1, f, opts, wb));
11330 add_rels(opts.wbrels, rId, "worksheets/sheet" + rId + "." + wbext, RELS.WS);
11333 if(opts.Strings != null && opts.Strings.length > 0) {
11335 zip.file(f, write_sst(opts.Strings, f, opts));
11337 add_rels(opts.wbrels, ++rId, "sharedStrings." + wbext, RELS.SST);
11345 add_rels(opts.wbrels, ++rId, "theme/theme1.xml", RELS.THEME);
11350 zip.file(f, write_sty(wb, f, opts));
11352 add_rels(opts.wbrels, ++rId, "styles." + wbext, RELS.STY);
11354 zip.file("[Content_Types].xml", write_ct(ct, opts));
11355 zip.file('_rels/.rels', write_rels(opts.rels));
11356 zip.file('xl/_rels/workbook.' + wbext + '.rels', write_rels(opts.wbrels));
11369 function read_zip(data, opts) { argument
11371 var o = opts||{};
11383 function readSync(data, opts) { argument
11385 var o = opts||{};
11396 return read_zip(data, opts);
11401 function readFileSync(data, opts) { argument
11402 var o = opts||{}; o.type = 'file';
11405 function write_zip_type(wb, opts) { argument
11406 var o = opts||{};
11417 function writeSync(wb, opts) { argument
11418 var o = opts||{};
11425 function writeFileSync(wb, filename, opts) { argument
11426 var o = opts||{}; o.type = 'file';
11506 function sheet_to_json(sheet, opts){ argument
11508 var o = opts != null ? opts : {};
11568 function sheet_to_row_object_array(sheet, opts) { return sheet_to_json(sheet, opts != null ? opts :… argument
11570 function sheet_to_csv(sheet, opts) { argument
11572 var o = opts == null ? {} : opts;