mirror of
https://github.com/codedread/bitjs
synced 2025-10-03 09:39:16 +02:00
Moar strata
This commit is contained in:
parent
a147bc1d24
commit
0320919769
1 changed files with 45 additions and 6 deletions
51
archive.js
51
archive.js
|
@ -13,22 +13,61 @@ bitjs.archive = bitjs.archive || {};
|
|||
|
||||
(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() {
|
||||
this.listeners_ = [];
|
||||
bitjs.archive.UnarchiveEvent.Type = {
|
||||
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.removeEventListener = function() {
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Abstract method - do not call directly.
|
||||
*/
|
||||
bitjs.archive.Unarchiver.prototype.unarchive = function() {
|
||||
throw "Error! Abstract method unarchive() in bitjs.archive.Unarchiver called";
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue