Changeset 148


Ignore:
Timestamp:
Apr 1, 2007, 6:37:25 PM (14 years ago)
Author:
alloc
Message:
 
Location:
oup/current
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • oup/current/DataAccess/Access_OniArchive.pas

    r116 r148  
    3939    function GetRawInfo(FileID, DatOffset: Integer): TRawDataInfo; override;
    4040
    41     procedure LoadRawOffset(LocSep: Boolean; RawAddr, Size: Integer; target: Pointer);
     41    procedure LoadRawOffset(LocSep: Boolean; RawAddr, Size: Integer; var target: TStream); overload;
     42    procedure LoadRawOffset(LocSep: Boolean; RawAddr, Size: Integer; target: Pointer); overload;
    4243    procedure LoadRawFile(FileID, DatOffset: Integer; var Target: TStream); overload; override;
    4344    procedure UpdateRawFile(FileID, DatOffset: Integer; Src: TStream); overload; override;
     
    445446
    446447
    447 
    448 procedure TAccess_OniArchive.LoadRawOffset(LocSep: Boolean; RawAddr, Size: Integer; target: Pointer);
    449 begin
     448procedure TAccess_OniArchive.LoadRawOffset(LocSep: Boolean; RawAddr, Size: Integer; var target: TStream);
     449begin
     450  if not Assigned(Target) then
     451    Target := TMemoryStream.Create;
    450452  if not LocSep then
    451453  begin
     
    456458    begin
    457459      Fraw_file.Seek(RawAddr, soFromBeginning);
    458       Fraw_file.Read(target^, size);
     460      Target.CopyFrom(Fraw_file, size);
     461      Target.Seek(0, soFromBeginning);
    459462    end;
    460463    if UnloadWhenUnused then
     
    474477    begin
    475478      Fsep_file.Seek(RawAddr, soFromBeginning);
    476       Fsep_file.Read(target^, size);
     479      Target.CopyFrom(Fsep_file, size);
     480      Target.Seek(0, soFromBeginning);
    477481    end;
    478482    if UnloadWhenUnused then
     
    484488      FSepOpened := True;
    485489  end;
     490end;
     491
     492procedure TAccess_OniArchive.LoadRawOffset(LocSep: Boolean; RawAddr, Size: Integer; target: Pointer);
     493var
     494  data: TStream;
     495begin
     496  data := nil;
     497  LoadRawOffset(LocSep, RawAddr, Size, data);
     498  data.Read(Target^, Size);
     499  data.Free;
    486500end;
    487501
     
    591605end;
    592606
     607
    593608procedure TAccess_OniArchive.UpdateRawFilePart(FileID, DatOffset, Offset, Size: Integer; Src: TStream);
    594609var
Note: See TracChangeset for help on using the changeset viewer.