summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7550b93)
raw | patch | inline | side by side (parent: 7550b93)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Mon, 11 Sep 2023 12:25:31 +0000 (15:25 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Mon, 11 Sep 2023 12:25:31 +0000 (15:25 +0300) |
src/shared/WADEDITOR_dfzip.pas | patch | blob | history |
index 8d168a0c8266c5b35ad9f8af2faa8f00a6f8d20c..2b6960015305fb242653e590534aa1ff3b0cc28f 100644 (file)
var s: TMemoryStream; cs: TCompressionStream; p: PResource;
var comp, crc: UInt32;
begin
+ Name := win2utf(Name);
+ Section := win2utf(Section);
Result := False;
if Name <> '' then
begin
procedure TZIPEditor.AddSection(Name: String);
begin
+ Name := win2utf(Name);
if InsertSection(Name, DateTimeToDosDateTime(Now())) = nil then
raise Exception.Create('DFZIP: AddSection[' + Name + ']: failed to insert');
end;
function TZIPEditor.HaveResource(Section, Resource: String): Boolean;
begin
+ Section := win2utf(Section);
+ Resource := win2utf(Resource);
Result := FindResource(FindSection(Section), Resource) <> nil;
end;
function TZIPEditor.HaveSection(Section: String): Boolean;
begin
+ Section := win2utf(Section);
Result := FindSection(Section) <> nil;
end;
function TZIPEditor.GetResource(Section, Resource: String; var pData: Pointer; var Len: Integer): Boolean;
var p: PResource; ptr: PByte; src: TStream; tmp: TDecompressionStream; crc: UInt32;
begin
+ Section := win2utf(Section);
+ Resource := win2utf(Resource);
FLastError := DFWAD_ERROR_CANTOPENWAD;
Result := False;
pData := nil;
function TZIPEditor.GetResourcesList(Section: String): SArray;
var p: PSection; i: Integer;
begin
+ Section := win2utf(Section);
Result := nil;
p := FindSection(Section);
if (p <> nil) and (p.list <> nil) then
SetLength(Result, Length(p.list));
for i := 0 to High(p.list) do
begin
- Result[i] := p.list[i].name;
+ Result[i] := utf2win(p.list[i].name);
end;
end;
end;
SetLength(Result, Length(FSection));
for i := 0 to High(FSection) do
begin
- Result[i] := FSection[i].name;
+ Result[i] := utf2win(FSection[i].name);
end;
end;
end;
procedure TZIPEditor.RemoveResource(Section, Resource: String);
var p: PSection; i: Integer;
begin
+ Section := win2utf(Section);
+ Resource := win2utf(Resource);
p := FindSection(Section);
i := FindResourceID(p, Resource);
if i >= 0 then