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 247 by alloc, Fri Jun 29 12:38:24 2007 UTC vs.
Revision 248 by alloc, Mon Nov 26 11:02:28 2007 UTC

# Line 6 | Line 6 | uses _MetaTypes;
6   type
7    TMetaManager = class
8      protected
9 <      FFiles: array of TFile;
9 >      FFiles: array of TResource;
10        FRoot: TExtensions;
11        FConnectionID: Integer;
12        FDataAccess: TObject;
13        function GetFileCount: Integer;
14 <      function GetFileById(Id: Integer): TFile;
14 >      function GetFileById(Id: Integer): TResource;
15      private
16      public
17        constructor Create(ConnectionID: Integer; DataAccess: TObject);
# Line 20 | Line 20 | type
20  
21        property Root: TExtensions read FRoot;
22        property FileCount: Integer read GetFileCount;
23 <      property FileById[Id: Integer]: TFile read GetFileById;
23 >      property FileById[Id: Integer]: TResource read GetFileById;
24    end;
25  
26   implementation
# Line 40 | Line 40 | begin
40   end;
41  
42  
43 < function TMetaManager.GetFileById(Id: Integer): TFile;
43 > function TMetaManager.GetFileById(Id: Integer): TResource;
44   begin
45    InitFile(Id);
46    Result := FFiles[Id];
# Line 63 | Line 63 | begin
63        finfo := ConManager.Connection[FConnectionID].GetFileInfo(id);
64        if finfo.Size > 0 then
65        begin
66 <        for typei := 0 to High(FileDescs) do
66 >        for typei := 0 to High(ResourceDescs) do
67          begin
68 <          if FileDescs[typei].ext = finfo.Extension then
68 >          if ResourceDescs[typei].ext = finfo.Extension then
69            begin
70 <            FFiles[id] := TFileClass(FileDescs[typei].ftype).Create(FConnectionID, id);
70 >            FFiles[id] := TResourceClass(ResourceDescs[typei].ftype).Create(FConnectionID, id);
71              Break;
72            end;
73          end;
74 <        if typei > High(FileDescs) then
74 >        if typei > High(ResourceDescs) then
75            FFiles[id] := TFile_Empty.Create(FConnectionID, id);
76        end else
77          FFiles[id] := TFile_Empty.Create(FConnectionID, id);

Diff Legend

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