Changeset 241 for oup/current/DataAccess
- Timestamp:
- Jul 18, 2007, 12:27:16 AM (17 years ago)
- Location:
- oup/current/DataAccess
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/current/DataAccess/Access_OUP_ADB.pas
r229 r241 35 35 function GetRawList(FileID: Integer): TRawDataList; override; 36 36 function GetRawInfo(FileID, DatOffset: Integer): TRawDataInfo; override; 37 function GetRawsForType(RawType: String): TRawDataList; override; 37 38 38 39 procedure LoadRawFile(FileID, DatOffset: Integer; var Target: TStream); overload; override; … … 268 269 else 269 270 list.Sorted := True; 271 if ext = '*' then 272 ext := ''; 270 273 for i := 0 to GetFileCount - 1 do 271 274 begin … … 490 493 begin 491 494 SetLength(Result, 0); 492 FQuery.SQL.Text := 'SELECT [src_link_offset],[ size],[sep] FROM rawmap WHERE [src_id]=' +495 FQuery.SQL.Text := 'SELECT [src_link_offset],[name],[size],[sep],[type] FROM rawmap WHERE [src_id]=' + 493 496 IntToStr(fileid) + ' ORDER BY src_link_offset ASC;'; 494 497 FQuery.Open; … … 499 502 i := 0; 500 503 repeat 504 Result[i].Name := FQuery.FieldByName('name').AsString; 501 505 Result[i].SrcID := fileid; 502 506 Result[i].SrcOffset := FQuery.FieldByName('src_link_offset').AsInteger; … … 504 508 Result[i].RawSize := FQuery.FieldByName('size').AsInteger; 505 509 Result[i].LocSep := FQuery.FieldByName('sep').AsBoolean; 510 Result[i].RawType := FQuery.FieldByName('type').AsString; 506 511 Inc(i); 507 512 FQuery.Next; … … 526 531 Result := rawlist[i] 527 532 else begin 533 Result.Name := ''; 528 534 Result.SrcID := -1; 529 535 Result.SrcOffset := -1; 530 536 Result.RawAddr := -1; 531 537 Result.RawSize := -1; 532 end; 533 end; 534 end; 538 Result.RawType := ''; 539 end; 540 end; 541 end; 542 543 544 function TAccess_OUP_ADB.GetRawsForType(RawType: String): TRawDataList; 545 var 546 i: Integer; 547 rawlist: TRawDataList; 548 begin 549 SetLength(Result, 0); 550 FQuery.SQL.Text := 'SELECT [src_id],[src_link_offset],[name],[size],[sep] FROM rawmap ' + 551 'WHERE [type]="' + RawType + '" ORDER BY src_id ASC, src_link_offset ASC;'; 552 FQuery.Open; 553 if FQuery.RecordCount > 0 then 554 begin 555 FQuery.First; 556 SetLength(Result, FQuery.RecordCount); 557 i := 0; 558 repeat 559 Result[i].Name := FQuery.FieldByName('name').AsString; 560 Result[i].SrcID := FQuery.FieldByName('src_id').AsInteger; 561 Result[i].SrcOffset := FQuery.FieldByName('src_link_offset').AsInteger; 562 Result[i].RawAddr := 0; 563 Result[i].RawSize := FQuery.FieldByName('size').AsInteger; 564 Result[i].LocSep := FQuery.FieldByName('sep').AsBoolean; 565 Result[i].RawType := RawType; 566 Inc(i); 567 FQuery.Next; 568 until FQuery.EOF; 569 end; 570 FQuery.Close; 571 end; 572 535 573 536 574 -
oup/current/DataAccess/Access_OniArchive.pas
r231 r241 39 39 function GetRawList(FileID: Integer): TRawDataList; override; 40 40 function GetRawInfo(FileID, DatOffset: Integer): TRawDataInfo; override; 41 function GetRawsForType(RawType: String): TRawDataList; override; 41 42 42 43 procedure LoadRawOffset(LocSep: Boolean; RawAddr, Size: Integer; var target: TStream); overload; … … 285 286 list := TStringList.Create; 286 287 list.Sorted := True; 288 if ext = '*' then 289 ext := ''; 287 290 for i := 0 to GetFileCount - 1 do 288 291 begin … … 489 492 begin 490 493 Result := RawLists.GetRawList(FConnectionID, FileID); 494 end; 495 496 497 function TAccess_OniArchive.GetRawsForType(RawType: String): TRawDataList; 498 var 499 i, j: Integer; 500 dats: TStrings; 501 list: TRawDataList; 502 begin 503 dats := nil; 504 dats := GetFilesList(MidStr(RawType, 1, 4), '', True, ST_IDAsc); 505 for i := 0 to dats.Count - 1 do 506 begin 507 list := GetRawList(StrToInt(MidStr(dats.Strings[i], 1, 5))); 508 for j := 0 to Length(list) - 1 do 509 begin 510 if list[j].RawType = RawType then 511 begin 512 SetLength(Result, Length(Result)+1); 513 Result[High(Result)] := list[j]; 514 end; 515 end; 516 end; 491 517 end; 492 518 -
oup/current/DataAccess/DataAccess.pas
r229 r241 50 50 function GetRawList(FileID: Integer): TRawDataList; virtual; abstract; 51 51 function GetRawInfo(FileID, DatOffset: Integer): TRawDataInfo; virtual; abstract; 52 function GetRawsForType(RawType: String): TRawDataList; virtual; abstract; 52 53 53 54 procedure LoadRawFile(FileID, DatOffset: Integer; var Target: TStream); overload; virtual; abstract;
Note:
See TracChangeset
for help on using the changeset viewer.