Changeset 87 for oup/current/Code/OniDataClass.pas
- Timestamp:
- Jan 14, 2007, 11:59:34 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/current/Code/OniDataClass.pas
r86 r87 1 1 unit OniDataClass; 2 2 interface 3 uses Data, DataStructures,Classes, SysUtils, StrUtils,3 uses Data, Classes, SysUtils, StrUtils, 4 4 Dialogs, ABSDecUtil, ABSMain, DB, Windows; 5 5 … … 21 21 procedure Close; virtual; abstract; 22 22 23 function GetFileInfo(fileid: LongWord): TFileInfo; virtual; abstract;23 function GetFileInfo(fileid: Integer): TFileInfo; virtual; 24 24 function GetFilesList(ext: String; pattern: String; 25 25 NoEmptyFiles: Boolean; sort: TSortType): TStringArray; virtual; abstract; … … 73 73 procedure Close; override; 74 74 75 function GetFileInfo(fileid: LongWord): TFileInfo; override;75 function GetFileInfo(fileid: Integer): TFileInfo; override; 76 76 function GetFilesList(ext: String; pattern: String; 77 77 NoEmptyFiles: Boolean; sort: TSortType): TStringArray; override; … … 112 112 procedure UpdateListCache; 113 113 // function GetDatLinks(srcid:LongWord):TDatLinks; 114 function GetFileInfo(fileid: LongWord): TFileInfo; override;114 function GetFileInfo(fileid: Integer): TFileInfo; override; 115 115 function GetFilesList(ext: String; pattern: String; 116 116 NoEmptyFiles: Boolean; sort: TSortType): TStringArray; override; … … 142 142 constructor Create(OLDBFilename: String; var Result: Boolean); override; 143 143 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 169 145 end; 170 146 … … 181 157 function CreateDataConnection(filename: String; backend: Integer): TOniData; 182 158 procedure CloseDataConnection(connection: TOniData); 159 function GetEmptyFileInfo: TFileInfo; 183 160 184 161 … … 187 164 188 165 implementation 189 uses Functions;166 uses DataStructures, Functions; 190 167 191 168 … … 252 229 253 230 231 function TOniData.GetFileInfo(fileid: Integer): TFileInfo; 232 begin 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; 242 end; 254 243 255 244 … … 378 367 379 368 380 function TOniDataDat.GetFileInfo(fileid: LongWord): TFileInfo; 381 begin 369 function TOniDataDat.GetFileInfo(fileid: Integer): TFileInfo; 370 begin 371 if fileid = -1 then 372 begin 373 Result := inherited GetFileInfo(fileid); 374 Exit; 375 end; 382 376 if fileid < Self.GetFilesCount then 383 377 Result := Fdat_files[fileid] … … 592 586 if RawListHandlers[i].needed then 593 587 begin 594 Result := RawListHandlers[i].Handler( fileid);588 Result := RawListHandlers[i].Handler(Self, fileid); 595 589 Break; 596 590 end … … 961 955 962 956 963 function TOniDataADB.GetFileInfo(fileid: LongWord): TFileInfo;957 function TOniDataADB.GetFileInfo(fileid: Integer): TFileInfo; 964 958 var 965 959 i: Integer; 966 960 begin 961 if fileid = -1 then 962 begin 963 Result := inherited GetFileInfo(fileid); 964 Exit; 965 end; 967 966 if fileid < Self.GetFilesCount then 968 967 begin … … 1484 1483 begin 1485 1484 DataConnections[i].Close; 1486 DataConnections[i].Free;1485 // DataConnections[i].Free; 1487 1486 DataConnections[i] := nil; 1488 1487 found := True; … … 1500 1499 1501 1500 1501 function GetEmptyFileInfo: TFileInfo; 1502 begin 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; 1512 end; 1513 1514 1502 1515 1503 1516
Note:
See TracChangeset
for help on using the changeset viewer.