| 4 |
|
|
| 5 |
|
uses Classes, Dialogs, SysUtils, StrUtils, Math, Data; |
| 6 |
|
|
| 7 |
– |
type |
| 8 |
– |
TExportSet = set of (DO_dat, DO_raw, DO_convert, DO_toone); |
| 9 |
– |
|
| 7 |
|
function BoolToStr(bool: Boolean): String; |
| 8 |
|
function HexToLong(hex: String): LongWord; |
| 9 |
|
function Decode_Int(buffer: Tdata): LongWord; |
| 13 |
|
function DataToBin(Data: Tdata): String; |
| 14 |
|
function BinToInt(bin: String): Byte; |
| 15 |
|
|
| 19 |
– |
function ExportFile(fileid: LongWord; filename: String; settings: TExportSet; |
| 20 |
– |
path: String): Integer; |
| 21 |
– |
|
| 16 |
|
function StringSmaller(string1, string2: String): Boolean; |
| 17 |
|
|
| 18 |
|
function FormatNumber(Value: LongWord; Width: Byte; leadingzeros: Char): String; |
| 317 |
|
|
| 318 |
|
|
| 319 |
|
|
| 326 |
– |
|
| 327 |
– |
function ExportFile(fileid: LongWord; filename: String; settings: TExportSet; |
| 328 |
– |
path: String): Integer; |
| 329 |
– |
var |
| 330 |
– |
i: Byte; |
| 331 |
– |
extension: String; |
| 332 |
– |
rawlist: TRawList; |
| 333 |
– |
begin |
| 334 |
– |
Result := export_noerror; |
| 335 |
– |
extension := RightStr(filename, 4); |
| 336 |
– |
if DO_toone in settings then |
| 337 |
– |
begin |
| 338 |
– |
ExportDatFile(fileid, path + '\' + GetWinFileName(filename)); |
| 339 |
– |
end |
| 340 |
– |
else |
| 341 |
– |
begin |
| 342 |
– |
if DO_dat in settings then |
| 343 |
– |
ExportDatFile(fileid, path + '\' + GetWinFileName(filename)); |
| 344 |
– |
if DO_raw in settings then |
| 345 |
– |
begin |
| 346 |
– |
rawlist := OniDataConnection.GetRawList(fileid); |
| 347 |
– |
if Length(rawlist) > 0 then |
| 348 |
– |
begin |
| 349 |
– |
for i := 0 to High(rawlist) do |
| 350 |
– |
begin |
| 351 |
– |
ExportRawFile(fileid, rawlist[i].src_offset, path + '\' + |
| 352 |
– |
GetWinFileName(filename)); |
| 353 |
– |
end; |
| 354 |
– |
end; |
| 355 |
– |
end; |
| 356 |
– |
end; |
| 357 |
– |
end; |
| 358 |
– |
|
| 359 |
– |
|
| 360 |
– |
|
| 361 |
– |
|
| 320 |
|
function Explode(_string: String; delimiter: Char): TStringArray; |
| 321 |
|
var |
| 322 |
|
start, len: Word; |