Ignore:
Timestamp:
Jan 14, 2007, 11:59:34 PM (18 years ago)
Author:
alloc
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • oup/current/Code/OniDataClass.pas

    r86 r87  
    11unit OniDataClass;
    22interface
    3 uses Data, DataStructures, Classes, SysUtils, StrUtils,
     3uses Data, Classes, SysUtils, StrUtils,
    44  Dialogs, ABSDecUtil, ABSMain, DB, Windows;
    55
     
    2121    procedure Close; virtual; abstract;
    2222
    23     function GetFileInfo(fileid: LongWord): TFileInfo; virtual; abstract;
     23    function GetFileInfo(fileid: Integer): TFileInfo; virtual;
    2424    function GetFilesList(ext: String; pattern: String;
    2525      NoEmptyFiles: Boolean; sort: TSortType): TStringArray; virtual; abstract;
     
    7373    procedure Close; override;
    7474
    75     function GetFileInfo(fileid: LongWord): TFileInfo; override;
     75    function GetFileInfo(fileid: Integer): TFileInfo; override;
    7676    function GetFilesList(ext: String; pattern: String;
    7777      NoEmptyFiles: Boolean; sort: TSortType): TStringArray; override;
     
    112112    procedure UpdateListCache;
    113113    //      function GetDatLinks(srcid:LongWord):TDatLinks;
    114     function GetFileInfo(fileid: LongWord): TFileInfo; override;
     114    function GetFileInfo(fileid: Integer): TFileInfo; override;
    115115    function GetFilesList(ext: String; pattern: String;
    116116      NoEmptyFiles: Boolean; sort: TSortType): TStringArray; override;
     
    142142    constructor Create(OLDBFilename: String; var Result: Boolean); override;
    143143    procedure Close; override;
    144 {
    145     procedure UpdateListCache;
    146     //      function GetDatLinks(srcid:LongWord):TDatLinks;
    147     function GetFileInfo(fileid: LongWord): TFileInfo; override;
    148     function GetFilesList(ext: String; pattern: String;
    149       NoEmptyFiles: Boolean; sort: TSortType): TStringArray; override;
    150     function GetFilesCount: LongWord; override;
    151     function GetExtensionsList: TStringArray; override;
    152     function GetExtendedExtensionsList: TExtensionsMap; override;
    153     function GetNamedFilesMap: TNamedFilesMap;
    154 
    155     function LoadDatFile(fileid: LongWord): Tdata; override;
    156     procedure UpdateDatFile(fileid: LongWord; Data: Tdata); override;
    157     procedure LoadDatFilePart(fileid, offset, size: LongWord; target: Pointer); override;
    158     procedure UpdateDatFilePart(fileid, offset, size: LongWord; target: Pointer); override;
    159 
    160     function GetRawList(fileid: LongWord): TRawList; override;
    161     procedure LoadRawFile(fileid, dat_offset: LongWord; target: Pointer); override;
    162     procedure UpdateRawFile(fileid, dat_offset: LongWord; size: LongWord;
    163       target: Pointer); override;
    164     procedure LoadRawFilePart(fileid, dat_offset: LongWord;
    165       offset, size: LongWord; target: Pointer); override;
    166     procedure UpdateRawFilePart(fileid, dat_offset: LongWord;
    167       offset, size: LongWord; target: Pointer); override;
    168 }  published
     144  published
    169145  end;
    170146
     
    181157function CreateDataConnection(filename: String; backend: Integer): TOniData;
    182158procedure CloseDataConnection(connection: TOniData);
     159function GetEmptyFileInfo: TFileInfo;
    183160
    184161
     
    187164
    188165implementation
    189 uses Functions;
     166uses DataStructures, Functions;
    190167
    191168
     
    252229
    253230
     231function TOniData.GetFileInfo(fileid: Integer): TFileInfo;
     232begin
     233  Result.ID := -1;
     234  Result.FileName := '';
     235  Result.FileNameHex := '';
     236  Result.Extension := '';
     237  Result.Name := '';
     238  Result.Size := 0;
     239  Result.FileType := 0;
     240  Result.DatAddr := 0;
     241  Result.opened := False;
     242end;
    254243
    255244
     
    378367
    379368
    380 function TOniDataDat.GetFileInfo(fileid: LongWord): TFileInfo;
    381 begin
     369function TOniDataDat.GetFileInfo(fileid: Integer): TFileInfo;
     370begin
     371  if fileid = -1 then
     372  begin
     373    Result := inherited GetFileInfo(fileid);
     374    Exit;
     375  end;
    382376  if fileid < Self.GetFilesCount then
    383377    Result    := Fdat_files[fileid]
     
    592586      if RawListHandlers[i].needed then
    593587      begin
    594         Result := RawListHandlers[i].Handler(fileid);
     588        Result := RawListHandlers[i].Handler(Self, fileid);
    595589        Break;
    596590      end
     
    961955
    962956
    963 function TOniDataADB.GetFileInfo(fileid: LongWord): TFileInfo;
     957function TOniDataADB.GetFileInfo(fileid: Integer): TFileInfo;
    964958var
    965959  i: Integer;
    966960begin
     961  if fileid = -1 then
     962  begin
     963    Result := inherited GetFileInfo(fileid);
     964    Exit;
     965  end;
    967966  if fileid < Self.GetFilesCount then
    968967  begin
     
    14841483        begin
    14851484          DataConnections[i].Close;
    1486           DataConnections[i].Free;
     1485//          DataConnections[i].Free;
    14871486          DataConnections[i] := nil;
    14881487          found := True;
     
    15001499
    15011500
     1501function GetEmptyFileInfo: TFileInfo;
     1502begin
     1503  Result.ID := -1;
     1504  Result.FileName := '';
     1505  Result.FileNameHex := '';
     1506  Result.Extension := '';
     1507  Result.Name := '';
     1508  Result.Size := 0;
     1509  Result.FileType := 0;
     1510  Result.DatAddr := 0;
     1511  Result.opened := False;
     1512end;
     1513
     1514
    15021515
    15031516
Note: See TracChangeset for help on using the changeset viewer.