aux-dbf
Version:
DBF for price PSM
33 lines • 1.43 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var DBFReader = /** @class */ (function () {
function DBFReader(file) {
this.file = file;
}
DBFReader.prototype.getColumns = function () {
return this.columns;
};
DBFReader.prototype.getDate = function () {
return (this.DateHeaderY +
"-" +
this.DateHeaderM.toString().padStart(2, "0") +
"-" +
this.DateHeaderD.toString().padStart(2, "0"));
};
DBFReader.prototype.printHeader = function () {
console.log("\nType: " + this.TypeTable + "\nDate: " + this.getDate() + "\nNumber of records: " + this.RecordsCount + "\nHeader size: " + this.HeaderSize + "\nRecord size: " + this.RecordSize + "\nEncode: " + this.Encode + "\nNumber of columns: " + this.ColumnCount + "\n");
};
DBFReader.prototype.printColumns = function () {
this.columns.forEach(function (element, index) {
console.log("[" + index
.toString()
.padStart(2, "0") + "] " + element.getType() + " " + element.getTitle() + " " + element.getSize() + "," + element.getDecimalPlaces());
});
};
DBFReader.prototype.readChar = function (offset) {
return String.fromCharCode(this.file.readInt8(offset));
};
return DBFReader;
}());
exports.DBFReader = DBFReader;
//# sourceMappingURL=DBFReader.js.map