1
0
Fork 0
mirror of https://github.com/codedread/bitjs synced 2025-10-03 09:39:16 +02:00

Moar strata

This commit is contained in:
codedread 2011-09-06 09:08:04 -07:00
parent a147bc1d24
commit 0320919769

View file

@ -13,22 +13,61 @@ bitjs.archive = bitjs.archive || {};
(function() { (function() {
bitjs.archive.UnarchiveEvent = funciton() { /**
this.type * @param {string} type The event type.
* @constructor
*/
bitjs.archive.UnarchiveEvent = function(type) {
this.type = type;
}; };
bitjs.archive.Unarchiver = function() { bitjs.archive.UnarchiveEvent.Type = {
this.listeners_ = []; START: 'bitjs.archive.UnarchiveEvent.START',
PROGRESS: 'bitjs.archive.UnarchiveEvent.PROGRESS',
EXTRACTION: 'bitjs.archive.UnarchiveEvent.EXTRACTION',
FINISH: 'bitjs.archive.UnarchiveEvent.FINISH',
ERROR: 'bitjs.archive.UnarchiveEvent.ERROR'
}; };
/**
* Base abstract class for all Unarchivers.
*
* @param {ArrayBuffer} arrayBuffer The Array Buffer.
*/
bitjs.archive.Unarchiver = function(arrayBuffer) {
/**
* @type {ArrayBuffer}
*/
this.ab_ = arrayBuffer;
/**
* A map from event type to an array of listeners.
* @type {Map.<string, Array>}
*/
this.listeners_ = {
bitjs.archive.UnarchiveEvent.Type.START: [],
bitjs.archive.UnarchiveEvent.Type.PROGRESS: [],
bitjs.archive.UnarchiveEvent.Type.EXTRACTION: [],
bitjs.archive.UnarchiveEvent.Type.FINISH: [],
bitjs.archive.UnarchiveEvent.Type.ERROR: []
};
};
/**
*
*/
bitjs.archive.Unarchiver.prototype.addEventListener = function() { bitjs.archive.Unarchiver.prototype.addEventListener = function() {
}; };
/**
*
*/
bitjs.archive.Unarchiver.prototype.removeEventListener = function() { bitjs.archive.Unarchiver.prototype.removeEventListener = function() {
}; };
/**
* Abstract method - do not call directly.
*/
bitjs.archive.Unarchiver.prototype.unarchive = function() { bitjs.archive.Unarchiver.prototype.unarchive = function() {
throw "Error! Abstract method unarchive() in bitjs.archive.Unarchiver called"; throw "Error! Abstract method unarchive() in bitjs.archive.Unarchiver called";
}; };