| 1 |
|
unit _MetaManager; |
| 2 |
|
interface |
| 3 |
|
|
| 4 |
< |
uses _FileTypes, TXAN, TXMP, _EmptyFile; |
| 4 |
> |
uses _FileTypes, SUBT, TXAN, TXMP, _EmptyFile; |
| 5 |
|
|
| 6 |
|
type |
| 7 |
|
TFileType = class of TFile; |
| 11 |
|
end; |
| 12 |
|
|
| 13 |
|
const |
| 14 |
< |
FileDescs: array[0..1] of TFileDesc = ( |
| 14 |
> |
FileDescs: array[0..2] of TFileDesc = ( |
| 15 |
> |
(ext: 'SUBT'; ftype: TFile_SUBT), |
| 16 |
|
(ext: 'TXAN'; ftype: TFile_TXAN), |
| 17 |
|
(ext: 'TXMP'; ftype: TFile_TXMP) |
| 18 |
|
); |
| 29 |
|
public |
| 30 |
|
constructor Create(ConnectionID: Integer); |
| 31 |
|
procedure InitFile(id: Integer); |
| 32 |
+ |
procedure InitFileFields(id: Integer); |
| 33 |
|
|
| 34 |
|
property FileCount: Integer read GetFileCount; |
| 35 |
|
property FileById[Id: Integer]: TFile read GetFileById; |
| 36 |
|
end; |
| 37 |
|
|
| 38 |
+ |
var |
| 39 |
+ |
Meta: TMetaManager; |
| 40 |
+ |
|
| 41 |
|
implementation |
| 42 |
|
|
| 43 |
|
uses |
| 63 |
|
|
| 64 |
|
procedure TMetaManager.InitFile(id: Integer); |
| 65 |
|
var |
| 61 |
– |
// i: Integer; |
| 66 |
|
typei: Integer; |
| 67 |
|
finfo: TFileInfo; |
| 68 |
|
begin |
| 89 |
|
end; |
| 90 |
|
end; |
| 91 |
|
end; |
| 92 |
+ |
|
| 93 |
+ |
procedure TMetaManager.InitFileFields(id: Integer); |
| 94 |
+ |
begin |
| 95 |
+ |
if id < ConManager.Connection[FConnectionID].GetFileCount then |
| 96 |
+ |
begin |
| 97 |
+ |
if not Assigned(FFiles[id]) then |
| 98 |
+ |
begin |
| 99 |
+ |
InitFile(id); |
| 100 |
+ |
if not (FFiles[id] is TFile_Empty) then |
| 101 |
+ |
FFiles[id].InitDataFields; |
| 102 |
+ |
end; |
| 103 |
+ |
end; |
| 104 |
+ |
end; |
| 105 |
|
|
| 106 |
|
procedure TMetaManager.InitRootFiles; |
| 107 |
|
var |