-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathuDFExplorer_BaseBundleManager.pas
72 lines (63 loc) · 2.64 KB
/
uDFExplorer_BaseBundleManager.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{
******************************************************
DoubleFine Explorer
By Bennyboy
Http://quickandeasysoftware.net
******************************************************
}
{
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
}
unit uDFExplorer_BaseBundleManager;
interface
uses
classes, Contnrs,
uFileReader, uDFExplorer_Types;
type
TBundleManager = class
protected
fBigEndian: boolean;
fBundle: TExplorerFileStream;
fBundleFileName: string;
fonDoneLoading: TOnDoneLoading;
fonProgress: TProgressEvent;
fonDebug: TDebugEvent;
function DetectBundle: boolean; Virtual; Abstract;
function GetFilesCount: integer; Virtual; Abstract;
function GetFileName(Index: integer): string; Virtual; Abstract;
function GetFileSize(Index: integer): integer; Virtual; Abstract;
function GetFileOffset(Index: integer): int64; Virtual; Abstract;
function GetFileExtension(Index: integer): string; Virtual; Abstract;
function GetFileType(Index: integer): TFiletype; Virtual; Abstract;
procedure Log(Text: string); Virtual; Abstract;
public
BundleFiles: TObjectList;
constructor Create(ResourceFile: string); Virtual; Abstract;
destructor Destroy; override;
procedure ParseFiles; Virtual; Abstract;
procedure SaveFile(FileNo: integer; DestDir, FileName: string); Virtual; Abstract;
procedure SaveFileToStream(FileNo: integer; DestStream: TStream); Virtual; Abstract;
procedure SaveFiles(DestDir: string); Virtual; Abstract;
property Count: integer read GetFilesCount;
property OnDoneLoading: TOnDoneLoading read FOnDoneLoading write FOnDoneLoading;
property OnProgress: TProgressEvent read FOnProgress write FOnProgress;
property OnDebug: TDebugEvent read FOnDebug write FOnDebug;
property FileName[Index: integer]: string read GetFileName;
property FileSize[Index: integer]: integer read GetFileSize;
property FileOffset[Index: integer]: int64 read GetFileOffset;
property FileExtension[Index: integer]: string read GetFileExtension;
property FileType[Index: integer]: TFileType read GetFileType;
property BigEndian: boolean read fBigEndian;
end;
const
strErrFileSize: string = 'File size <=0 Save cancelled for this file.';
strErrFileNo: string = 'Invalid file number! Save cancelled for this file.';
strSavingFile: string = 'Saving file ';
implementation
destructor TBundleManager.Destroy;
begin
inherited;
end;
end.