sheetjs/bits/38_recordhopper.js
SheetJS 5c4bf62b83 version bump 0.4.3: shared strings and formatting
- XLSB basic support for number formats
- removed extraneous Strings table element
- formatting xml tags (rich_stress_test)
- updating test_files to 20130130
2014-01-31 06:52:18 -05:00

15 lines
539 B
JavaScript

/* [MS-XLSB] 2.1.4 Record */
var recordhopper = function(data, cb) {
var tmpbyte, cntbyte, length;
prep_blob(data, data.l || 0);
while(data.l < data.length) {
var RT = data.read_shift(1);
if(RT & 0x80) RT = (RT & 0x7F) + ((data.read_shift(1) & 0x7F)<<7);
var R = RecordEnum[RT] || RecordEnum[0xFFFF];
length = tmpbyte = data.read_shift(1);
for(cntbyte = 1; cntbyte <4 && (tmpbyte & 0x80); ++cntbyte) length += ((tmpbyte = data.read_shift(1)) & 0x7F)<<(7*cntbyte);
var d = R.f(data, length);
if(cb(d, R, RT)) return;
}
};