Changeset 116 for oup/current
- Timestamp:
- Feb 26, 2007, 11:57:02 PM (18 years ago)
- Location:
- oup/current/DataAccess
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/current/DataAccess/Access_OUP_ADB.pas
r113 r116 33 33 34 34 function GetDatLinks(FileID: Integer): TDatLinkList; override; 35 function GetDatLink(FileID, DatOffset: Integer): TDatLink; override; 35 36 function GetRawList(FileID: Integer): TRawDataList; override; 36 37 function GetRawInfo(FileID, DatOffset: Integer): TRawDataInfo; override; … … 47 48 48 49 uses 49 SysUtils, Data, Functions, ABSDecUtil, DB ;50 SysUtils, Data, Functions, ABSDecUtil, DB, DatLinks; 50 51 51 52 … … 445 446 446 447 448 449 function TAccess_OUP_ADB.GetDatLink(FileID, DatOffset: Integer): TDatLink; 450 begin 451 Result := DatLinksManager.GetDatLink(FConnectionID, FileID, DatOffset); 452 FQuery.SQL.Text := 'SELECT target_id FROM linkmap WHERE src_id = ' + IntToStr(FileID) + ' and src_link_offset = ' + IntToStr(DatOffset) + ';'; 453 FQuery.Open; 454 if FQuery.RecordCount > 0 then 455 Result.DestID := FQuery.FieldByName('target_id').AsInteger; 456 FQuery.Close; 457 end; 458 459 460 function TAccess_OUP_ADB.GetDatLinks(FileID: Integer): TDatLinkList; 461 var 462 i: Integer; 463 SrcOffset, DestID: Integer; 464 begin 465 Result := DatLinksManager.GetDatLinks(FConnectionID, FileID); 466 if Length(Result) > 0 then 467 begin 468 FQuery.SQL.Text := 'SELECT src_link_offset, target_id FROM linkmap WHERE src_id = ' + IntToStr(FileID) + ' ORDER BY src_link_offset ASC;'; 469 FQuery.Open; 470 if FQuery.RecordCount > 0 then 471 begin 472 repeat 473 SrcOffset := FQuery.FieldByName('src_link_offset').AsInteger; 474 DestID := FQuery.FieldByName('target_id').AsInteger; 475 for i := 0 to High(Result) do 476 if Result[i].SrcOffset = SrcOffset then 477 Break; 478 if i < Length(Result) then 479 Result[i].DestID := DestID 480 else 481 Result[i].DestID := -1; 482 FQuery.Next; 483 until FQuery.EOF; 484 end; 485 FQuery.Close; 486 end; 487 end; 488 489 447 490 function TAccess_OUP_ADB.GetRawList(FileID: Integer): TRawDataList; 448 491 var -
oup/current/DataAccess/Access_OniArchive.pas
r113 r116 35 35 36 36 function GetDatLinks(FileID: Integer): TDatLinkList; override; 37 function GetDatLink(FileID, DatOffset: Integer): TDatLink; override; 37 38 function GetRawList(FileID: Integer): TRawDataList; override; 38 39 function GetRawInfo(FileID, DatOffset: Integer): TRawDataInfo; override; … … 51 52 52 53 uses 53 SysUtils, StrUtils, Data, Functions, RawList ;54 SysUtils, StrUtils, Data, Functions, RawList, DatLinks; 54 55 55 56 … … 398 399 399 400 401 function TAccess_OniArchive.GetDatLink(FileID, DatOffset: Integer): TDatLink; 402 var 403 link: Integer; 404 begin 405 Result := DatLinksManager.GetDatLink(FConnectionID, FileID, DatOffset); 406 LoadDatFilePart(fileid, Result.SrcOffset, 4, @link); 407 if link > 0 then 408 Result.DestID := link div 256 409 else 410 Result.DestID := -1; 411 end; 412 413 414 function TAccess_OniArchive.GetDatLinks(FileID: Integer): TDatLinkList; 415 var 416 i: Integer; 417 link: Integer; 418 begin 419 Result := DatLinksManager.GetDatLinks(FConnectionID, FileID); 420 if Length(Result) > 0 then 421 begin 422 for i := 0 to High(Result) do 423 begin 424 LoadDatFilePart(fileid, Result[i].SrcOffset, 4, @link); 425 if link > 0 then 426 Result[i].DestID := link div 256 427 else 428 Result[i].DestID := -1; 429 end; 430 end; 431 end; 432 433 400 434 function TAccess_OniArchive.GetRawList(FileID: Integer): TRawDataList; 401 435 begin -
oup/current/DataAccess/DataAccess.pas
r113 r116 45 45 46 46 function GetDatLinks(FileID: Integer): TDatLinkList; virtual; abstract; 47 function GetDatLink(FileID, DatOffset: Integer): TDatLink; virtual; abstract; 47 48 function GetRawList(FileID: Integer): TRawDataList; virtual; abstract; 48 49 function GetRawInfo(FileID, DatOffset: Integer): TRawDataInfo; virtual; abstract;
Note:
See TracChangeset
for help on using the changeset viewer.