mirror of
https://github.com/ducbao414/win32.run.git
synced 2025-12-17 09:42:50 +09:00
35 lines
605 B
JavaScript
35 lines
605 B
JavaScript
|
|
/**
|
|
* Represents compressed file before extraction
|
|
*/
|
|
export class CompressedFile{
|
|
|
|
constructor(name,size,path,archiveRef){
|
|
this._name = name;
|
|
this._size = size;
|
|
this._path = path;
|
|
this._archiveRef = archiveRef;
|
|
}
|
|
|
|
/**
|
|
* file name
|
|
*/
|
|
get name(){
|
|
return this._name;
|
|
}
|
|
/**
|
|
* file size
|
|
*/
|
|
get size(){
|
|
return this._size;
|
|
}
|
|
|
|
/**
|
|
* Extract file from archive
|
|
* @returns {Promise<File>} extracted file
|
|
*/
|
|
extract(){
|
|
return this._archiveRef.extractSingleFile(this._path);
|
|
}
|
|
|
|
} |