ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/oup/current/DataAccess/Access_OUP_ADB.pas
(Generate patch)

Comparing oup/current/DataAccess/Access_OUP_ADB.pas (file contents):
Revision 113 by alloc, Sun Feb 25 17:20:22 2007 UTC vs.
Revision 116 by alloc, Mon Feb 26 22:57:02 2007 UTC

# Line 32 | Line 32 | type
32      procedure UpdateDatFilePart(FileID, Offset, Size: Integer; Src: TStream); overload; override;
33  
34      function GetDatLinks(FileID: Integer): TDatLinkList; override;
35 +    function GetDatLink(FileID, DatOffset: Integer): TDatLink; override;
36      function GetRawList(FileID: Integer): TRawDataList; override;
37      function GetRawInfo(FileID, DatOffset: Integer): TRawDataInfo; override;
38  
# Line 46 | Line 47 | type
47   implementation
48  
49   uses
50 <  SysUtils, Data, Functions, ABSDecUtil, DB;
50 >  SysUtils, Data, Functions, ABSDecUtil, DB, DatLinks;
51  
52  
53   (*
# Line 443 | Line 444 | begin
444    end;
445   end;
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  
490   function TAccess_OUP_ADB.GetRawList(FileID: Integer): TRawDataList;
491   var

Diff Legend

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