| 42 |
|
procedure LoadRawFilePart(FileID, DatOffset, Offset, Size: Integer; var Target: TStream); overload; override; |
| 43 |
|
procedure UpdateRawFilePart(FileID, DatOffset, Offset, Size: Integer; Src: TStream); overload; override; |
| 44 |
|
|
| 45 |
< |
function AppendRawFile(LocSep: Boolean; Size: Integer; Src: TStream): Integer; overload; override; |
| 45 |
> |
function AppendRawFile(LocSep: Boolean; Src: TStream): Integer; overload; override; |
| 46 |
|
published |
| 47 |
|
end; |
| 48 |
|
|
| 59 |
|
|
| 60 |
|
|
| 61 |
|
constructor TAccess_OniArchive.Create(DatFilename: String; ConnectionID: Integer; var Msg: TStatusMessages); |
| 62 |
– |
type |
| 63 |
– |
THeader = packed record |
| 64 |
– |
Ident: array[0..$13] of Byte; |
| 65 |
– |
Files: Integer; |
| 66 |
– |
NamedFiles: Integer; |
| 67 |
– |
Extensions: Integer; |
| 68 |
– |
DataAddr: Integer; |
| 69 |
– |
DataSize: Integer; |
| 70 |
– |
NamesAddr: Integer; |
| 71 |
– |
NamesSize: Integer; |
| 72 |
– |
Ident2: array[0..$F] of Byte; |
| 73 |
– |
end; |
| 74 |
– |
TFilesMap = array of packed record |
| 75 |
– |
Extension: array[0..$3] of Char; |
| 76 |
– |
DataAddr: Integer; |
| 77 |
– |
NameAddr: Integer; |
| 78 |
– |
FileSize: Integer; |
| 79 |
– |
FileType: LongWord; |
| 80 |
– |
end; |
| 81 |
– |
TNamedFilesMap = array of packed record |
| 82 |
– |
FileNumber: Integer; |
| 83 |
– |
blubb: Integer; |
| 84 |
– |
end; |
| 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, |
| 160 |
|
|
| 161 |
|
Msg := SM_OK; |
| 162 |
|
FBackend := DB_ONI; |
| 163 |
+ |
FConnectionID := ConnectionID; |
| 164 |
|
FChangeRights := [CR_EditDat, CR_EditRaw, CR_AppendRaw]; |
| 165 |
|
end; |
| 166 |
|
|
| 226 |
|
name := fields.Strings[2]; |
| 227 |
|
extension := fields.Strings[0]; |
| 228 |
|
end; |
| 229 |
+ |
if SortType in [ST_ExtNameAsc, ST_ExtNameDesc] then |
| 230 |
+ |
begin |
| 231 |
+ |
id := fields.Strings[2]; |
| 232 |
+ |
name := fields.Strings[1]; |
| 233 |
+ |
extension := fields.Strings[0]; |
| 234 |
+ |
end; |
| 235 |
|
end; |
| 236 |
|
|
| 237 |
|
begin |
| 245 |
|
begin |
| 246 |
|
if (NoEmptyFiles = False) or ((Fdat_files[i].FileType and $02) = 0) then |
| 247 |
|
begin |
| 248 |
< |
if AppSettings.FilenumbersAsHex then |
| 265 |
< |
id := IntToHex(Fdat_files[i].ID, 4) |
| 266 |
< |
else |
| 267 |
< |
id := FormatNumber(Fdat_files[i].ID, 5, '0'); |
| 248 |
> |
id := FormatNumber(Fdat_files[i].ID, 5, '0'); |
| 249 |
|
name := Fdat_files[i].Name; |
| 250 |
|
extension := Fdat_files[i].Extension; |
| 251 |
|
|
| 253 |
|
ST_IDAsc, ST_IDDesc: list.Add(id + ';' + name + ';' + extension); |
| 254 |
|
ST_NameAsc, ST_NameDesc: list.Add(name + ';' + id + ';' + extension); |
| 255 |
|
ST_ExtAsc, ST_ExtDesc: list.Add(extension + ';' + id + ';' + name); |
| 256 |
+ |
ST_ExtNameAsc, ST_ExtNameDesc: list.Add(name + ';' + extension + ';' + id); |
| 257 |
|
end; |
| 258 |
|
end; |
| 259 |
|
end; |
| 262 |
|
if list.Count > 0 then |
| 263 |
|
begin |
| 264 |
|
fields := TStringList.Create; |
| 265 |
< |
if SortType in [ST_IDAsc, ST_NameAsc, ST_ExtAsc] then |
| 265 |
> |
if SortType in [ST_IDAsc, ST_NameAsc, ST_ExtAsc, ST_ExtNameAsc] then |
| 266 |
|
for i := 0 to list.Count - 1 do |
| 267 |
|
begin |
| 268 |
|
getfields; |
| 597 |
|
end; |
| 598 |
|
end; |
| 599 |
|
|
| 600 |
< |
function TAccess_OniArchive.AppendRawFile(LocSep: Boolean; Size: Integer; Src: TStream): Integer; |
| 600 |
> |
function TAccess_OniArchive.AppendRawFile(LocSep: Boolean; Src: TStream): Integer; |
| 601 |
|
begin |
| 602 |
|
if not LocSep then |
| 603 |
|
begin |
| 606 |
|
fmOpenReadWrite); |
| 607 |
|
Result := Fraw_file.Size; |
| 608 |
|
Fraw_file.Seek(0, soFromEnd); |
| 609 |
< |
Fraw_file.CopyFrom(Src, Size); |
| 609 |
> |
Fraw_file.CopyFrom(Src, Src.Size); |
| 610 |
|
if UnloadWhenUnused then |
| 611 |
|
begin |
| 612 |
|
FRawOpened := False; |
| 622 |
|
fmOpenReadWrite); |
| 623 |
|
Result := Fsep_file.Size; |
| 624 |
|
Fsep_file.Seek(0, soFromEnd); |
| 625 |
< |
Fsep_file.CopyFrom(Src, Size); |
| 625 |
> |
Fsep_file.CopyFrom(Src, Src.Size); |
| 626 |
|
if UnloadWhenUnused then |
| 627 |
|
begin |
| 628 |
|
FSepOpened := False; |