Changeset 105 for oup/rewrite/DataAccess
- Timestamp:
- Feb 21, 2007, 1:29:27 AM (18 years ago)
- Location:
- oup/rewrite/DataAccess
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/rewrite/DataAccess/Access_OUP_ADB.pas
r101 r105 103 103 FBackend := DB_ADB; 104 104 105 FConnectionID := ConnectionID; 105 106 FChangeRights := [CR_EditDat, CR_EditRaw, CR_ResizeDat, CR_ResizeRaw]; 106 107 -
oup/rewrite/DataAccess/Access_OniArchive.pas
r101 r105 43 43 procedure UpdateRawFilePart(FileID, DatOffset, Offset, Size: Integer; Src: TStream); overload; override; 44 44 45 function AppendRawFile(LocSep: Boolean; S ize: Integer; Src: TStream): Integer; overload; override;45 function AppendRawFile(LocSep: Boolean; Src: TStream): Integer; overload; override; 46 46 published 47 47 end; … … 184 184 Msg := SM_OK; 185 185 FBackend := DB_ONI; 186 FConnectionID := ConnectionID; 186 187 FChangeRights := [CR_EditDat, CR_EditRaw, CR_AppendRaw]; 187 188 end; … … 616 617 end; 617 618 618 function TAccess_OniArchive.AppendRawFile(LocSep: Boolean; S ize: Integer; Src: TStream): Integer;619 function TAccess_OniArchive.AppendRawFile(LocSep: Boolean; Src: TStream): Integer; 619 620 begin 620 621 if not LocSep then … … 625 626 Result := Fraw_file.Size; 626 627 Fraw_file.Seek(0, soFromEnd); 627 Fraw_file.CopyFrom(Src, S ize);628 Fraw_file.CopyFrom(Src, Src.Size); 628 629 if UnloadWhenUnused then 629 630 begin … … 641 642 Result := Fsep_file.Size; 642 643 Fsep_file.Seek(0, soFromEnd); 643 Fsep_file.CopyFrom(Src, S ize);644 Fsep_file.CopyFrom(Src, Src.Size); 644 645 if UnloadWhenUnused then 645 646 begin -
oup/rewrite/DataAccess/DataAccess.pas
r101 r105 42 42 procedure LoadDatFilePart(FileID, Offset, Size: Integer; Target: Pointer); overload; 43 43 procedure UpdateDatFilePart(FileID, Offset, Size: Integer; Src: TStream); overload; virtual; abstract; 44 procedure UpdateDatFilePart(FileID, Offset, Size: Integer; Src: TByteData); overload;45 44 procedure UpdateDatFilePart(FileID, Offset, Size: Integer; Src: Pointer); overload; 46 45 … … 56 55 procedure LoadRawFilePart(FileID, DatOffset, Offset, Size: Integer; Target: Pointer); overload; 57 56 procedure UpdateRawFilePart(FileID, DatOffset, Offset, Size: Integer; Src: TStream); overload; virtual; abstract; 58 procedure UpdateRawFilePart(FileID, DatOffset, Offset, Size: Integer; Src: TByteData); overload;59 57 procedure UpdateRawFilePart(FileID, DatOffset, Offset, Size: Integer; Src: Pointer); overload; 60 58 61 function AppendRawFile(LocSep: Boolean; S ize: Integer; Src: TStream): Integer; overload; virtual;62 function AppendRawFile(LocSep: Boolean; S ize: Integer; Src: TByteData): Integer; overload;59 function AppendRawFile(LocSep: Boolean; Src: TStream): Integer; overload; virtual; 60 function AppendRawFile(LocSep: Boolean; Src: TByteData): Integer; overload; 63 61 function AppendRawFile(LocSep: Boolean; Size: Integer; Src: Pointer): Integer; overload; 64 62 published … … 173 171 end; 174 172 175 procedure TDataAccess.UpdateDatFilePart(FileID, Offset, Size: Integer; Src: TByteData);176 var177 data: TStream;178 begin179 if fileid < GetFileCount then180 begin181 data := TMemoryStream.Create;182 data.Write(Src[0], Size);183 data.Seek(0, soFromBeginning);184 UpdateDatFilePart(FileID, offset, size, data);185 data.Free;186 end;187 end;188 189 173 procedure TDataAccess.UpdateDatFilePart(FileID, Offset, Size: Integer; Src: Pointer); 190 174 var … … 260 244 end; 261 245 262 procedure TDataAccess.UpdateRawFilePart(FileID, DatOffset, Offset, Size: Integer; Src: TByteData);263 var 264 data: TStream; 265 begin 266 if fileid < GetFileCount then 267 begin 268 data := TMemoryStream.Create; 269 data.Write(Src [0], Size);246 procedure TDataAccess.UpdateRawFilePart(FileID, DatOffset, Offset, Size: Integer; Src: Pointer); 247 var 248 data: TStream; 249 begin 250 if fileid < GetFileCount then 251 begin 252 data := TMemoryStream.Create; 253 data.Write(Src^, Size); 270 254 data.Seek(0, soFromBeginning); 271 255 UpdateRawFilePart(FileID, DatOffset, Offset, Size, data); … … 274 258 end; 275 259 276 procedure TDataAccess.UpdateRawFilePart(FileID, DatOffset, Offset, Size: Integer; Src: Pointer); 277 var 278 data: TStream; 279 begin 280 if fileid < GetFileCount then 281 begin 282 data := TMemoryStream.Create; 283 data.Write(Src^, Size); 284 data.Seek(0, soFromBeginning); 285 UpdateRawFilePart(FileID, DatOffset, Offset, Size, data); 286 data.Free; 287 end; 288 end; 289 290 291 function TDataAccess.AppendRawFile(LocSep: Boolean; Size: Integer; Src: TStream): Integer; 260 261 function TDataAccess.AppendRawFile(LocSep: Boolean; Src: TStream): Integer; 292 262 begin 293 263 raise ENotImplemented.Create('ERROR: AppendRawFile not implemented here!!!'); … … 295 265 296 266 297 function TDataAccess.AppendRawFile(LocSep: Boolean; S ize: Integer; Src: TByteData): Integer;267 function TDataAccess.AppendRawFile(LocSep: Boolean; Src: TByteData): Integer; 298 268 var 299 269 data: TStream; 300 270 begin 301 271 data := TMemoryStream.Create; 302 data.Write(Src[0], Size); 303 AppendRawFile(LocSep, Size, data); 272 data.Write(Src[0], Length(Src)); 273 data.Seek(0, soFromBeginning); 274 AppendRawFile(LocSep, data); 304 275 data.Free; 305 276 end; … … 311 282 data := TMemoryStream.Create; 312 283 data.Write(Src^, Size); 313 AppendRawFile(LocSep, Size, data); 284 data.Seek(0, soFromBeginning); 285 AppendRawFile(LocSep, data); 314 286 data.Free; 315 287 end;
Note:
See TracChangeset
for help on using the changeset viewer.