Changeset 113 for oup/current/DataAccess
- Timestamp:
- Feb 25, 2007, 6:20:22 PM (18 years ago)
- Location:
- oup/current/DataAccess
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/current/DataAccess/Access_OUP_ADB.pas
r112 r113 32 32 procedure UpdateDatFilePart(FileID, Offset, Size: Integer; Src: TStream); overload; override; 33 33 34 function GetDatLinks(FileID: Integer): TDatLinkList; override; 34 35 function GetRawList(FileID: Integer): TRawDataList; override; 35 36 function GetRawInfo(FileID, DatOffset: Integer): TRawDataInfo; override; … … 56 57 57 58 constructor TAccess_OUP_ADB.Create(DBFilename: String; ConnectionID: Integer; var Msg: TStatusMessages); 58 var59 i: Integer;60 59 begin 61 60 Msg := SM_UnknownError; … … 142 141 Fdat_files[i].Extension := FQuery.FieldByName('extension').AsString; 143 142 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); 145 144 Fdat_files[i].DatAddr := 0; 146 145 Inc(i); … … 294 293 end; 295 294 end; 296 Result := TStringList.Create; 295 if not Assigned(Result) then 296 Result := TStringList.Create; 297 297 if list.Count > 0 then 298 298 begin … … 328 328 i: Integer; 329 329 begin 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; 331 334 for i := 0 to Length(Fdat_extensionsmap) - 1 do 332 335 begin -
oup/current/DataAccess/Access_OniArchive.pas
r112 r113 34 34 procedure UpdateDatFilePart(FileID, Offset, Size: Integer; Src: TStream); overload; override; 35 35 36 function GetDatLinks(FileID: Integer): TDatLinkList; override; 36 37 function GetRawList(FileID: Integer): TRawDataList; override; 37 38 function GetRawInfo(FileID, DatOffset: Integer): TRawDataInfo; override; … … 60 61 61 62 constructor TAccess_OniArchive.Create(DatFilename: String; ConnectionID: Integer; var Msg: TStatusMessages); 62 const63 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);74 63 var 75 64 i: Integer; … … 94 83 header_mac := True; 95 84 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 100 95 header_pc := False; 101 if Fdat_header. Ident[i] <> header_ident1_mac[i] then96 if Fdat_header.OSIdent[i] <> HeaderOSIdentMac[i] then 102 97 header_mac := False; 103 if Fdat_header. Ident[i] <> header_ident1_macbeta[i] then98 if Fdat_header.OSIdent[i] <> HeaderOSIdentMacBeta[i] then 104 99 header_macbeta := False; 105 100 end; … … 259 254 end; 260 255 end; 261 Result := TStringList.Create; 256 if not Assigned(Result) then 257 Result := TStringList.Create; 262 258 if list.Count > 0 then 263 259 begin … … 295 291 i: Integer; 296 292 begin 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; 298 297 for i := 0 to Length(Fdat_extensionsmap) - 1 do 299 298 begin -
oup/current/DataAccess/DataAccess.pas
r105 r113 44 44 procedure UpdateDatFilePart(FileID, Offset, Size: Integer; Src: Pointer); overload; 45 45 46 function GetDatLinks(FileID: Integer): TDatLinkList; virtual; abstract; 46 47 function GetRawList(FileID: Integer): TRawDataList; virtual; abstract; 47 48 function GetRawInfo(FileID, DatOffset: Integer): TRawDataInfo; virtual; abstract; … … 272 273 data.Write(Src[0], Length(Src)); 273 274 data.Seek(0, soFromBeginning); 274 AppendRawFile(LocSep, data);275 Result := AppendRawFile(LocSep, data); 275 276 data.Free; 276 277 end; … … 283 284 data.Write(Src^, Size); 284 285 data.Seek(0, soFromBeginning); 285 AppendRawFile(LocSep, data);286 Result := AppendRawFile(LocSep, data); 286 287 data.Free; 287 288 end;
Note:
See TracChangeset
for help on using the changeset viewer.