You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
2.1 KiB
JavaScript
36 lines
2.1 KiB
JavaScript
'use strict';
|
|
|
|
const createBufferReader = require("../../buffer-reader");
|
|
const parseDirectoryRecord = require("../directory-record");
|
|
|
|
module.exports = function parsePrimaryVolumeDescriptor(data) {
|
|
let bufferReader = createBufferReader(data);
|
|
|
|
return {
|
|
systemIdentifier: bufferReader.strA(1, 32),
|
|
volumeIdentifier: bufferReader.strD(33, 32),
|
|
sectorCount: bufferReader.int32_LSB_MSB(73),
|
|
setSize: bufferReader.int16_LSB_MSB(113),
|
|
sequenceNumber: bufferReader.int16_LSB_MSB(117),
|
|
sectorSize: bufferReader.int16_LSB_MSB(121),
|
|
pathTableSize: bufferReader.int32_LSB_MSB(125),
|
|
pathTableLocationL: bufferReader.int32_LSB(133), // FIXME: Pointer? (location is expressed in 'sectors')
|
|
optionalPathTableLocationL: bufferReader.int32_LSB(137), // FIXME: Pointer? (location is expressed in 'sectors')
|
|
pathTableLocationM: bufferReader.int32_MSB(141), // FIXME: Pointer? (location is expressed in 'sectors')
|
|
optionalPathTableLocationM: bufferReader.int32_MSB(145), // FIXME: Pointer? (location is expressed in 'sectors')
|
|
rootDirectory: parseDirectoryRecord(data.slice(149, 149 + 34)),
|
|
publisherIdentifier: bufferReader.strA(311, 128), // FIXME: null for unspecified & extended publisher information
|
|
dataPreparerIdentifier: bufferReader.strA(439, 128), // FIXME: null for unspecified & extended publisher information
|
|
applicationIdentifier: bufferReader.strA(567, 128), // FIXME: null for unspecified & extended publisher information
|
|
copyrightFile: bufferReader.strD(695, 38), // FIXME: seek for file, optionally?
|
|
abstractFile: bufferReader.strD(733, 36), // FIXME: seek for file, optionally?
|
|
bibliographicFile: bufferReader.strD(769, 37), // FIXME: seek for file, optionally?
|
|
creationDate: bufferReader.decDatetime(806),
|
|
modificationDate: bufferReader.decDatetime(823),
|
|
expirationDate: bufferReader.decDatetime(840),
|
|
effectiveDate: bufferReader.decDatetime(857),
|
|
fileStructureVersion: bufferReader.int8(874),
|
|
applicationData: data.slice(876, 876 + 512)
|
|
}
|
|
};
|