ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/oup/current/FileClasses/_MetaManager.pas
(Generate patch)

Comparing oup/current/FileClasses/_MetaManager.pas (file contents):
Revision 215 by alloc, Tue Jun 12 20:31:54 2007 UTC vs.
Revision 228 by alloc, Wed Jun 20 09:51:38 2007 UTC

# Line 1 | Line 1
1   unit _MetaManager;
2   interface
3  
4 < uses _FileTypes,
5 <  ABNA, AGDB, AGQC, AGQG, AGQM, AGQR, AISA, AITR, AIWA, AKAA, AKBA, AKBP, AKDA,
6 <  AKEV, AKOT, AKVA, BINA, CBPI, CBPM, CONS, CRSA, DOOR, DPge, EDIA, ENVP, FILM,
7 <  FXLR, GMAN, HPge, IDXA, IGHH, IGPA, IGPG, IGSA, IGSt, Impt, IPge, KeyI, M3GA,
8 <  M3GM, M3TA, Mtrl, NMSA, OBAN, OBDC, OBLS, OBOA, OFGA, ONCC, ONCP, ONCV, ONFA,
9 <  ONGS, ONIA, ONLD, ONLV, ONMA, ONOA, ONSA, ONSK, ONTA, ONVL, ONWC, OPge, OSBD,
10 <  OTIT, OTLF, PLEA, PNTA, PSpc, PSpL, PSUI, QTNA, QUDA, SNDD, StNA, SUBT, TMFA,
11 <  TMRA, TRAC, TRAM, TRAS, TRBS, TRCM, TRFT, TRGA, TRGE, TRIA, TRIG, TRMA, TRSC,
12 <  TRTA, TSFF, TSFL, TSFT, TSGA, TStr, TURR, TXAN, TXCA, TXMA, TXMB, TXMP, TXPC,
13 <  TxtC, UUEA, UVDL, VCRA, WMCL, WMDD, WMM_, WMMB, WPge,
14 <  _EmptyFile;
15 <
16 < type
17 <  TFileType = class of TFile;
18 <  TFileDesc = record
19 <    ext: String;
20 <    ftype: TFileType;
21 <  end;
22 <
23 < const
24 <  FileDescs: array[0..112] of TFileDesc = (
25 <    (ext: 'ABNA'; ftype: TFile_ABNA),
26 <    (ext: 'AGDB'; ftype: TFile_AGDB),
27 <    (ext: 'AGQC'; ftype: TFile_AGQC),
28 <    (ext: 'AGQG'; ftype: TFile_AGQG),
29 <    (ext: 'AGQM'; ftype: TFile_AGQM),
30 <    (ext: 'AGQR'; ftype: TFile_AGQR),
31 <    (ext: 'AISA'; ftype: TFile_AISA),
32 <    (ext: 'AITR'; ftype: TFile_AITR),
33 <    (ext: 'AIWA'; ftype: TFile_AIWA),
34 <    (ext: 'AKAA'; ftype: TFile_AKAA),
35 <    (ext: 'AKBA'; ftype: TFile_AKBA),
36 <    (ext: 'AKBP'; ftype: TFile_AKBP),
37 <    (ext: 'AKDA'; ftype: TFile_AKDA),
38 <    (ext: 'AKEV'; ftype: TFile_AKEV),
39 <    (ext: 'AKOT'; ftype: TFile_AKOT),
40 <    (ext: 'AKVA'; ftype: TFile_AKVA),
41 <    (ext: 'BINA'; ftype: TFile_BINA),
42 <    (ext: 'CBPI'; ftype: TFile_CBPI),
43 <    (ext: 'CBPM'; ftype: TFile_CBPM),
44 <    (ext: 'CONS'; ftype: TFile_CONS),
45 <    (ext: 'CRSA'; ftype: TFile_CRSA),
46 <    (ext: 'DOOR'; ftype: TFile_DOOR),
47 <    (ext: 'DPge'; ftype: TFile_DPge),
48 <    (ext: 'EDIA'; ftype: TFile_EDIA),
49 <    (ext: 'ENVP'; ftype: TFile_ENVP),
50 <    (ext: 'FILM'; ftype: TFile_FILM),
51 <    (ext: 'FXLR'; ftype: TFile_FXLR),
52 <    (ext: 'GMAN'; ftype: TFile_GMAN),
53 <    (ext: 'HPge'; ftype: TFile_HPge),
54 <    (ext: 'IDXA'; ftype: TFile_IDXA),
55 <    (ext: 'IGHH'; ftype: TFile_IGHH),
56 <    (ext: 'IGPA'; ftype: TFile_IGPA),
57 <    (ext: 'IGPG'; ftype: TFile_IGPG),
58 <    (ext: 'IGSA'; ftype: TFile_IGSA),
59 <    (ext: 'IGSt'; ftype: TFile_IGSt),
60 <    (ext: 'Impt'; ftype: TFile_Impt),
61 <    (ext: 'IPge'; ftype: TFile_IPge),
62 <    (ext: 'KeyI'; ftype: TFile_KeyI),
63 <    (ext: 'M3GA'; ftype: TFile_M3GA),
64 <    (ext: 'M3GM'; ftype: TFile_M3GM),
65 <    (ext: 'M3TA'; ftype: TFile_M3TA),
66 <    (ext: 'Mtrl'; ftype: TFile_Mtrl),
67 <    (ext: 'NMSA'; ftype: TFile_NMSA),
68 <    (ext: 'OBAN'; ftype: TFile_OBAN),
69 <    (ext: 'OBDC'; ftype: TFile_OBDC),
70 <    (ext: 'OBLS'; ftype: TFile_OBLS),
71 <    (ext: 'OBOA'; ftype: TFile_OBOA),
72 <    (ext: 'OFGA'; ftype: TFile_OFGA),
73 <    (ext: 'ONCC'; ftype: TFile_ONCC),
74 <    (ext: 'ONCP'; ftype: TFile_ONCP),
75 <    (ext: 'ONCV'; ftype: TFile_ONCV),
76 <    (ext: 'ONFA'; ftype: TFile_ONFA),
77 <    (ext: 'ONGS'; ftype: TFile_ONGS),
78 <    (ext: 'ONIA'; ftype: TFile_ONIA),
79 <    (ext: 'ONLD'; ftype: TFile_ONLD),
80 <    (ext: 'ONLV'; ftype: TFile_ONLV),
81 <    (ext: 'ONMA'; ftype: TFile_ONMA),
82 <    (ext: 'ONOA'; ftype: TFile_ONOA),
83 <    (ext: 'ONSA'; ftype: TFile_ONSA),
84 <    (ext: 'ONSK'; ftype: TFile_ONSK),
85 <    (ext: 'ONTA'; ftype: TFile_ONTA),
86 <    (ext: 'ONVL'; ftype: TFile_ONVL),
87 <    (ext: 'ONWC'; ftype: TFile_ONWC),
88 <    (ext: 'OPge'; ftype: TFile_OPge),
89 <    (ext: 'OSBD'; ftype: TFile_OSBD),
90 <    (ext: 'OTIT'; ftype: TFile_OTIT),
91 <    (ext: 'OTLF'; ftype: TFile_OTLF),
92 <    (ext: 'PLEA'; ftype: TFile_PLEA),
93 <    (ext: 'PNTA'; ftype: TFile_PNTA),
94 <    (ext: 'PSpc'; ftype: TFile_PSpc),
95 <    (ext: 'PSpL'; ftype: TFile_PSpL),
96 <    (ext: 'PSUI'; ftype: TFile_PSUI),
97 <    (ext: 'QTNA'; ftype: TFile_QTNA),
98 <    (ext: 'QUDA'; ftype: TFile_QUDA),
99 <    (ext: 'SNDD'; ftype: TFile_SNDD),
100 <    (ext: 'StNA'; ftype: TFile_StNA),
101 <    (ext: 'SUBT'; ftype: TFile_SUBT),
102 <    (ext: 'TMFA'; ftype: TFile_TMFA),
103 <    (ext: 'TMRA'; ftype: TFile_TMRA),
104 <    (ext: 'TRAC'; ftype: TFile_TRAC),
105 <    (ext: 'TRAM'; ftype: TFile_TRAM),
106 <    (ext: 'TRAS'; ftype: TFile_TRAS),
107 <    (ext: 'TRBS'; ftype: TFile_TRBS),
108 <    (ext: 'TRCM'; ftype: TFile_TRCM),
109 <    (ext: 'TRFT'; ftype: TFile_TRFT),
110 <    (ext: 'TRGA'; ftype: TFile_TRGA),
111 <    (ext: 'TRGE'; ftype: TFile_TRGE),
112 <    (ext: 'TRIA'; ftype: TFile_TRIA),
113 <    (ext: 'TRIG'; ftype: TFile_TRIG),
114 <    (ext: 'TRMA'; ftype: TFile_TRMA),
115 <    (ext: 'TRSC'; ftype: TFile_TRSC),
116 <    (ext: 'TRTA'; ftype: TFile_TRTA),
117 <    (ext: 'TSFF'; ftype: TFile_TSFF),
118 <    (ext: 'TSFL'; ftype: TFile_TSFL),
119 <    (ext: 'TSFT'; ftype: TFile_TSFT),
120 <    (ext: 'TSGA'; ftype: TFile_TSGA),
121 <    (ext: 'TStr'; ftype: TFile_TStr),
122 <    (ext: 'TURR'; ftype: TFile_TURR),
123 <    (ext: 'TXAN'; ftype: TFile_TXAN),
124 <    (ext: 'TXCA'; ftype: TFile_TXCA),
125 <    (ext: 'TXMA'; ftype: TFile_TXMA),
126 <    (ext: 'TXMB'; ftype: TFile_TXMB),
127 <    (ext: 'TXMP'; ftype: TFile_TXMP),
128 <    (ext: 'TXPC'; ftype: TFile_TXPC),
129 <    (ext: 'TxtC'; ftype: TFile_TxtC),
130 <    (ext: 'UUEA'; ftype: TFile_UUEA),
131 <    (ext: 'UVDL'; ftype: TFile_UVDL),
132 <    (ext: 'VCRA'; ftype: TFile_VCRA),
133 <    (ext: 'WMCL'; ftype: TFile_WMCL),
134 <    (ext: 'WMDD'; ftype: TFile_WMDD),
135 <    (ext: 'WMM_'; ftype: TFile_WMM_),
136 <    (ext: 'WMMB'; ftype: TFile_WMMB),
137 <    (ext: 'WPge'; ftype: TFile_WPge)
138 <  );
4 > uses _MetaTypes;
5  
6   type
7    TMetaManager = class
8      protected
9        FFiles: array of TFile;
10 +      FRoot: array of TExtension;
11        FConnectionID: Integer;
12        function GetFileCount: Integer;
13        function GetFileById(Id: Integer): TFile;
# Line 161 | Line 28 | var
28   implementation
29  
30   uses
31 <  Classes, ConnectionManager, Access_OniArchive, TypeDefs, Dialogs, SysUtils, StrUtils;
31 >  Classes, ConnectionManager, Access_OniArchive, TypeDefs,
32 >  Dialogs, SysUtils, StrUtils;
33  
34   { TFileManager }
35  
# Line 197 | Line 65 | begin
65          begin
66            if FileDescs[typei].ext = finfo.Extension then
67            begin
68 <            FFiles[id] := TFileType(FileDescs[typei].ftype).Create(FConnectionID, id);
68 >            FFiles[id] := TFileClass(FileDescs[typei].ftype).Create(FConnectionID, id);
69              Break;
70            end;
71          end;
# Line 252 | Line 120 | begin
120            begin
121              if FileDescs[typei].ext = finfo.Extension then
122              begin
123 <              FFiles[fid] := TFileType(FileDescs[typei].ftype).Create(FConnectionID, fid);
123 >              FFiles[fid] := TFileClass(FileDescs[typei].ftype).Create(FConnectionID, fid);
124                Break;
125              end;
126            end;

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)