Ignore:
Timestamp:
Nov 26, 2007, 12:02:28 PM (17 years ago)
Author:
alloc
Message:
 
Location:
oup/current/FileClasses
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • oup/current/FileClasses/AKEV.pas

    r246 r248  
    77
    88type
    9   TFile_AKEV = class(TFile)
     9  TFile_AKEV = class(TResource)
    1010    public
    1111      procedure InitDataFields; override;
     
    2323  with FDataFields do
    2424  begin
    25     AddField(TFileID, 'FileID', '', []);
     25    AddField(TResourceID, 'FileID', '', []);
    2626    AddField(TLevelID, 'LevelID', '', []);
    2727
  • oup/current/FileClasses/AKVA.pas

    r241 r248  
    77
    88type
    9   TFile_AKVA = class(TFile)
     9  TFile_AKVA = class(TResource)
    1010    public
    1111      procedure InitDataFields; override;
     
    2323  with FDataFields do
    2424  begin
    25     AddField(TFileID, 'FileID', '', []);
     25    AddField(TResourceID, 'FileID', '', []);
    2626    AddField(TLevelID, 'LevelID', '', []);
    2727
  • oup/current/FileClasses/BINA.pas

    r245 r248  
    77
    88type
    9   TFile_BINA = class(TFile)
     9  TFile_BINA = class(TResource)
    1010      procedure SetOpened(Opened: Boolean); override;
    1111    private
     
    3333  with FDataFields do
    3434  begin
    35     AddField(TFileID, 'FileID', '', []);
     35    AddField(TResourceID, 'FileID', '', []);
    3636    AddField(TLevelID, 'LevelID', '', []);
    3737
  • oup/current/FileClasses/SUBT.pas

    r245 r248  
    77
    88type
    9   TFile_SUBT = class(TFile)
     9  TFile_SUBT = class(TResource)
    1010      procedure SetOpened(Opened: Boolean); override;
    1111    private
     
    3131  with FDataFields do
    3232  begin
    33     AddField(TFileID, 'FileID', '', []);
     33    AddField(TResourceID, 'FileID', '', []);
    3434    AddField(TLevelID, 'LevelID', '', []);
    3535    AddField(TUnused, 'Unused data', '', [16]);
  • oup/current/FileClasses/TXAN.pas

    r241 r248  
    77
    88type
    9   TFile_TXAN = class(TFile)
     9  TFile_TXAN = class(TResource)
    1010    public
    1111      procedure InitDataFields; override;
     
    2323  with FDataFields do
    2424  begin
    25     AddField(TFileID, 'FileID', '', []);
     25    AddField(TResourceID, 'FileID', '', []);
    2626
    2727    AddField(TLevelID, 'LevelID', '', []);
  • oup/current/FileClasses/TXMP.pas

    r241 r248  
    77
    88type
    9   TFile_TXMP = class(TFile)
     9  TFile_TXMP = class(TResource)
    1010    public
    1111      procedure InitDataFields; override;
     
    2727  with FDataFields do
    2828  begin
    29     AddField(TFileID, 'FileID', '', []);
     29    AddField(TResourceID, 'FileID', '', []);
    3030    AddField(TLevelID, 'LevelID', '', []);
    3131
  • oup/current/FileClasses/_DataTypes.pas

    r243 r248  
    121121
    122122
    123   TFileID = class(TDataField)
     123  TResourceID = class(TDataField)
    124124    protected
    125125      FFileID: Integer;
     
    257257    for i := 0 to High(ExtraArgs) do
    258258      FExtraArgs[i] := ExtraArgs[i];
    259   FConnectionID := TFile(ParentFile).ConnectionID;
     259  FConnectionID := TResource(ParentFile).ConnectionID;
    260260end;
    261261
     
    305305  i: Integer;
    306306begin
    307   fstream := TFile(FParentFile).FileStream;
     307  fstream := TResource(FParentFile).FileStream;
    308308  fstream.Seek(FOffset, soFromBeginning);
    309309  SetLength(FString, FDataLength);
     
    351351  fstream: TMemoryStream;
    352352begin
    353   fstream := TFile(FParentFile).FileStream;
     353  fstream := TResource(FParentFile).FileStream;
    354354  fstream.Seek(FOffset, soFromBeginning);
    355355  fstream.Read(FInt, FDataLength);
     
    428428  if FCounterSize > 0 then
    429429  begin
    430     fstream := TFile(FParentFile).FileStream;
     430    fstream := TResource(FParentFile).FileStream;
    431431    fstream.Seek(Offset, soFromBeginning);
    432432    FBlockCount := 0;
     
    463463  if FCounterSize > 0 then
    464464  begin
    465     fstream := TFile(FParentFile).FileStream;
     465    fstream := TResource(FParentFile).FileStream;
    466466    fstream.Seek(Offset, soFromBeginning);
    467467    fstream.Write(FBlockCount, FCounterSize);
     
    622622  fstream: TMemoryStream;
    623623begin
    624   fstream := TFile(FParentFile).FileStream;
     624  fstream := TResource(FParentFile).FileStream;
    625625  fstream.Seek(FOffset, soFromBeginning);
    626626  fstream.Read(FLevelID, 4);
     
    640640{ TFileID }
    641641
    642 constructor TFileID.Create(ParentFile: TObject; ParentBlock: TContainer;
     642constructor TResourceID.Create(ParentFile: TObject; ParentBlock: TContainer;
    643643    Name, Description: String; ExtraArgs: array of const);
    644644begin
     
    649649end;
    650650
    651 function TFileID.GetValueAsString: String;
     651function TResourceID.GetValueAsString: String;
    652652begin
    653653  Result := IntToStr(FFileID);
    654654end;
    655655
    656 procedure TFileID.Update(Offset, Length: Integer);
     656procedure TResourceID.Update(Offset, Length: Integer);
    657657var
    658658  fstream: TMemoryStream;
    659659begin
    660   fstream := TFile(FParentFile).FileStream;
     660  fstream := TResource(FParentFile).FileStream;
    661661  fstream.Seek(FOffset, soFromBeginning);
    662662  fstream.Read(FFileID, 4);
     
    667667end;
    668668
    669 procedure TFileID.WriteData(stream: TStream);
     669procedure TResourceID.WriteData(stream: TStream);
    670670var
    671671  tempi: Integer;
     
    731731  fstream: TMemoryStream;
    732732begin
    733   fstream := TFile(FParentFile).FileStream;
     733  fstream := TResource(FParentFile).FileStream;
    734734  fstream.Seek(FOffset, soFromBeginning);
    735735  fstream.Read(FFileID, 4);
     
    781781  fstream: TMemoryStream;
    782782begin
    783   fstream := TFile(FParentFile).FileStream;
     783  fstream := TResource(FParentFile).FileStream;
    784784  fstream.Seek(FOffset, soFromBeginning);
    785785  fstream.Read(FRawAddress, 4);
     
    868868  fstream: TMemoryStream;
    869869begin
    870   fstream := TFile(FParentFile).FileStream;
     870  fstream := TResource(FParentFile).FileStream;
    871871  fstream.Seek(FOffset, soFromBeginning);
    872872  fstream.Read(FBits, FDataLength);
     
    900900  fstream: TMemoryStream;
    901901begin
    902   fstream := TFile(FParentFile).FileStream;
     902  fstream := TResource(FParentFile).FileStream;
    903903  fstream.Seek(FOffset, soFromBeginning);
    904904  fstream.Read(FFloat, FDataLength);
  • oup/current/FileClasses/_EmptyFile.pas

    r238 r248  
    77
    88type
    9   TFile_Empty = class(TFile)
     9  TFile_Empty = class(TResource)
    1010  end;
    1111
  • oup/current/FileClasses/_FileTypes.pas

    r245 r248  
    1313  end;
    1414
    15   TFile = class(TTreeElement)
     15  TResource = class(TTreeElement)
    1616    protected
    1717      FFileInfo: TFileInfo;
     
    2121      FCached: Boolean;
    2222      FChanged: Boolean;
     23      FReplaced: Boolean;
    2324
    2425      FDataFields: TBlock;
     
    6768  end;
    6869
    69 
    70   TFileType = class of TFile;
     70type
     71  TFileType = class of TResource;
    7172
    7273
     
    8081{ TFileType }
    8182
    82 procedure TFile.CacheFile;
     83procedure TResource.CacheFile;
    8384begin
    8485  if not Assigned(FFileStream) then
     
    9091
    9192
    92 procedure TFile.CacheRawFile(Offset: Integer);
     93procedure TResource.CacheRawFile(Offset: Integer);
    9394var
    9495  i: Integer;
     
    107108end;
    108109
    109 procedure TFile.CacheAllRawFiles;
     110procedure TResource.CacheAllRawFiles;
    110111var
    111112  i: Integer;
     
    117118
    118119
    119 procedure TFile.DiscardFileCache;
     120procedure TResource.DiscardFileCache;
    120121begin
    121122  if Assigned(FFileStream) then
     
    124125end;
    125126
    126 procedure TFile.DiscardRawCache(Offset: Integer);
     127procedure TResource.DiscardRawCache(Offset: Integer);
    127128var
    128129  i: Integer;
     
    139140end;
    140141
    141 procedure TFile.DiscardAllRawCaches;
     142procedure TResource.DiscardAllRawCaches;
    142143var
    143144  i: Integer;
     
    147148end;
    148149
    149 procedure TFile.StoreFileCache;
     150procedure TResource.StoreFileCache;
    150151begin
    151152  Exit;
    152153end;
    153154
    154 procedure TFile.StoreRawCache(Offset: Integer);
     155procedure TResource.StoreRawCache(Offset: Integer);
    155156begin
    156157  Exit;
    157158end;
    158159
    159 procedure TFile.StoreAllRawCaches;
     160procedure TResource.StoreAllRawCaches;
    160161var
    161162  i: Integer;
     
    169170
    170171
    171 procedure TFile.SetOpened(Opened: Boolean);
     172procedure TResource.SetOpened(Opened: Boolean);
    172173begin
    173174  FOpened := Opened;
     
    175176
    176177
    177 constructor TFile.Create(ConnectionID, FileID: Integer);
     178constructor TResource.Create(ConnectionID, FileID: Integer);
    178179var
    179180  rawlist: TRawDataList;
     
    199200
    200201
    201 procedure TFile.Free;
     202procedure TResource.Free;
    202203begin
    203204  FDataFields.Free;
     
    205206
    206207
    207 function TFile.GetFieldByOffset(Offset: Integer): TDataField;
     208function TResource.GetFieldByOffset(Offset: Integer): TDataField;
    208209begin
    209210  Result := FDataFields.FieldByOffset[Offset];
     
    211212
    212213
    213 function TFile.GetRawCacheID(Offset: Integer): Integer;
     214function TResource.GetRawCacheID(Offset: Integer): Integer;
    214215var
    215216  i: Integer;
     
    221222end;
    222223
    223 function TFile.GetType: String;
     224function TResource.GetType: String;
    224225begin
    225226  Result := FFileInfo.Extension;
    226227end;
    227228
    228 function TFile.GetCaption: String;
     229function TResource.GetCaption: String;
    229230begin
    230231  Result := FFileInfo.Name;
     
    234235end;
    235236
    236 function TFile.GetChild(ID: Integer): TTreeElement;
     237function TResource.GetChild(ID: Integer): TTreeElement;
    237238begin
    238239  Result := FDataFields.Child[ID];
    239240end;
    240241
    241 function TFile.GetChildCount: Integer;
     242function TResource.GetChildCount: Integer;
    242243begin
    243244  if FDataFields <> nil then
     
    248249
    249250
    250 function TFile.GetEditor: TFrame;
     251function TResource.GetEditor: TFrame;
    251252begin
    252253  if not Assigned(FEditor) then
     
    256257
    257258
    258 procedure TFile.InitDataFields;
     259procedure TResource.InitDataFields;
    259260begin
    260261  if Assigned(FDataFields) then
     
    265266
    266267
    267 procedure TFile.InitEditor;
     268procedure TResource.InitEditor;
    268269begin
    269270  Exit;
     
    274275//*********************************************************
    275276//*********************************************************
    276 procedure TFile.ReCreateFile(fs: TStream);
     277procedure TResource.ReCreateFile(fs: TStream);
    277278const
    278279  temp0: array[0..31] of Byte =
  • oup/current/FileClasses/_MetaManager.pas

    r233 r248  
    77  TMetaManager = class
    88    protected
    9       FFiles: array of TFile;
     9      FFiles: array of TResource;
    1010      FRoot: TExtensions;
    1111      FConnectionID: Integer;
    1212      FDataAccess: TObject;
    1313      function GetFileCount: Integer;
    14       function GetFileById(Id: Integer): TFile;
     14      function GetFileById(Id: Integer): TResource;
    1515    private
    1616    public
     
    2121      property Root: TExtensions read FRoot;
    2222      property FileCount: Integer read GetFileCount;
    23       property FileById[Id: Integer]: TFile read GetFileById;
     23      property FileById[Id: Integer]: TResource read GetFileById;
    2424  end;
    2525
     
    4141
    4242
    43 function TMetaManager.GetFileById(Id: Integer): TFile;
     43function TMetaManager.GetFileById(Id: Integer): TResource;
    4444begin
    4545  InitFile(Id);
     
    6464      if finfo.Size > 0 then
    6565      begin
    66         for typei := 0 to High(FileDescs) do
     66        for typei := 0 to High(ResourceDescs) do
    6767        begin
    68           if FileDescs[typei].ext = finfo.Extension then
     68          if ResourceDescs[typei].ext = finfo.Extension then
    6969          begin
    70             FFiles[id] := TFileClass(FileDescs[typei].ftype).Create(FConnectionID, id);
     70            FFiles[id] := TResourceClass(ResourceDescs[typei].ftype).Create(FConnectionID, id);
    7171            Break;
    7272          end;
    7373        end;
    74         if typei > High(FileDescs) then
     74        if typei > High(ResourceDescs) then
    7575          FFiles[id] := TFile_Empty.Create(FConnectionID, id);
    7676      end else
  • oup/current/FileClasses/_MetaTypes.pas

    r245 r248  
    1818type
    1919  TTreeElement = _TreeElement.TTreeElement;
    20   TFile = _FileTypes.TFile;
     20  TResource = _FileTypes.TResource;
    2121  TFile_Empty = _EmptyFile.TFile_Empty;
    2222  TExtension = _Extensions.TExtension;
     
    2828  TArray = _DataTypes.TArray;
    2929
    30   TFileID = _DataTypes.TFileID;
     30  TResourceID = _DataTypes.TResourceID;
    3131  TLevelID = _DataTypes.TLevelID;
    3232  TInt = _DataTypes.TInt;
     
    3939  TUnused = _DataTypes.TUnused;
    4040
    41   TFileClass = class of TFile;
    42   TFileDesc = record
     41  TResourceClass = class of TResource;
     42  TResourceDesc = record
    4343    ext: String;
    44     ftype: TFileClass;
     44    ftype: TResourceClass;
    4545  end;
    4646
    4747const
    48   FileDescs: array[0..5] of TFileDesc = (
     48  ResourceDescs: array[0..5] of TResourceDesc = (
    4949    (ext: 'AKEV'; ftype: TFile_AKEV),
    5050    (ext: 'AKVA'; ftype: TFile_AKVA),
Note: See TracChangeset for help on using the changeset viewer.