Changeset 113 for oup/current/DataAccess


Ignore:
Timestamp:
Feb 25, 2007, 6:20:22 PM (18 years ago)
Author:
alloc
Message:
 
Location:
oup/current/DataAccess
Files:
3 edited

Legend:

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

    r112 r113  
    3232    procedure UpdateDatFilePart(FileID, Offset, Size: Integer; Src: TStream); overload; override;
    3333
     34    function GetDatLinks(FileID: Integer): TDatLinkList; override;
    3435    function GetRawList(FileID: Integer): TRawDataList; override;
    3536    function GetRawInfo(FileID, DatOffset: Integer): TRawDataInfo; override;
     
    5657
    5758constructor TAccess_OUP_ADB.Create(DBFilename: String; ConnectionID: Integer; var Msg: TStatusMessages);
    58 var
    59   i: Integer;
    6059begin
    6160  Msg := SM_UnknownError;
     
    142141      Fdat_files[i].Extension := FQuery.FieldByName('extension').AsString;
    143142      Fdat_files[i].Size := FQuery.FieldByName('size').AsInteger;
    144       Fdat_files[i].FileType := HexToLong(FQuery.FieldByName('contenttype').AsString);
     143      Fdat_files[i].FileType := StrToInt('$'+FQuery.FieldByName('contenttype').AsString);
    145144      Fdat_files[i].DatAddr := 0;
    146145      Inc(i);
     
    294293    end;
    295294  end;
    296   Result := TStringList.Create;
     295  if not Assigned(Result) then
     296    Result := TStringList.Create;
    297297  if list.Count > 0 then
    298298  begin
     
    328328  i: Integer;
    329329begin
    330   Result := TStringList.Create;
     330  if not Assigned(Result) then
     331    Result := TStringList.Create;
     332  if Result is TStringList then
     333    TStringList(Result).Sorted := True;
    331334  for i := 0 to Length(Fdat_extensionsmap) - 1 do
    332335  begin
  • oup/current/DataAccess/Access_OniArchive.pas

    r112 r113  
    3434    procedure UpdateDatFilePart(FileID, Offset, Size: Integer; Src: TStream); overload; override;
    3535
     36    function GetDatLinks(FileID: Integer): TDatLinkList; override;
    3637    function GetRawList(FileID: Integer): TRawDataList; override;
    3738    function GetRawInfo(FileID, DatOffset: Integer): TRawDataInfo; override;
     
    6061
    6162constructor TAccess_OniArchive.Create(DatFilename: String; ConnectionID: Integer; var Msg: TStatusMessages);
    62 const
    63   header_ident1_pc: array[0..$13] of Byte =
    64     ($1F, $27, $DC, $33, $DF, $BC, $03, $00, $31, $33, $52, $56, $40, $00,
    65     $14, $00, $10, $00, $08, $00);
    66   header_ident1_mac: array[0..$13] of Byte =
    67     ($61, $30, $C1, $23, $DF, $BC, $03, $00, $31, $33, $52, $56, $40, $00,
    68     $14, $00, $10, $00, $08, $00);
    69   header_ident1_macbeta: array[0..$13] of Byte =
    70     ($81, $11, $8D, $23, $DF, $BC, $03, $00, $31, $33, $52, $56, $40, $00,
    71     $14, $00, $10, $00, $08, $00);
    72   header_ident2: array[0..$F] of Byte =
    73     ($99, $CF, $40, $00, $90, $4F, $63, $00, $F4, $55, $5F, $00, $90, $4F, $63, $00);
    7463var
    7564  i: Integer;
     
    9483  header_mac := True;
    9584  header_macbeta := True;
    96   for i := 0 to High(Fdat_header.Ident) do
    97   begin
    98 //    FLevelInfo.Ident[i] := Fdat_header.Ident[i];
    99     if Fdat_header.Ident[i] <> header_ident1_pc[i] then
     85  for i := 0 to High(Fdat_header.GlobalIdent) do
     86    if Fdat_header.GlobalIdent[i] <> HeaderGlobalIdent[i] then
     87    begin
     88      Msg := SM_IncompatibleFile;
     89      Exit;
     90    end;
     91
     92  for i := 0 to High(Fdat_header.OSIdent) do
     93  begin
     94    if Fdat_header.OSIdent[i] <> HeaderOSIdentWin[i] then
    10095      header_pc := False;
    101     if Fdat_header.Ident[i] <> header_ident1_mac[i] then
     96    if Fdat_header.OSIdent[i] <> HeaderOSIdentMac[i] then
    10297      header_mac := False;
    103     if Fdat_header.Ident[i] <> header_ident1_macbeta[i] then
     98    if Fdat_header.OSIdent[i] <> HeaderOSIdentMacBeta[i] then
    10499      header_macbeta := False;
    105100  end;
     
    259254    end;
    260255  end;
    261   Result := TStringList.Create;
     256  if not Assigned(Result) then
     257    Result := TStringList.Create;
    262258  if list.Count > 0 then
    263259  begin
     
    295291  i: Integer;
    296292begin
    297   Result := TStringList.Create;
     293  if not Assigned(Result) then
     294    Result := TStringList.Create;
     295  if Result is TStringList then
     296    TStringList(Result).Sorted := True;
    298297  for i := 0 to Length(Fdat_extensionsmap) - 1 do
    299298  begin
  • oup/current/DataAccess/DataAccess.pas

    r105 r113  
    4444    procedure UpdateDatFilePart(FileID, Offset, Size: Integer; Src: Pointer); overload;
    4545
     46    function GetDatLinks(FileID: Integer): TDatLinkList; virtual; abstract;
    4647    function GetRawList(FileID: Integer): TRawDataList; virtual; abstract;
    4748    function GetRawInfo(FileID, DatOffset: Integer): TRawDataInfo; virtual; abstract;
     
    272273  data.Write(Src[0], Length(Src));
    273274  data.Seek(0, soFromBeginning);
    274   AppendRawFile(LocSep, data);
     275  Result := AppendRawFile(LocSep, data);
    275276  data.Free;
    276277end;
     
    283284  data.Write(Src^, Size);
    284285  data.Seek(0, soFromBeginning);
    285   AppendRawFile(LocSep, data);
     286  Result := AppendRawFile(LocSep, data);
    286287  data.Free;
    287288end;
Note: See TracChangeset for help on using the changeset viewer.