mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: JSON-Pack utility
This commit is contained in:
parent
39cabbae06
commit
3dc144d2e2
1 changed files with 11 additions and 11 deletions
|
|
@ -13,7 +13,7 @@ uses
|
||||||
|
|
||||||
var
|
var
|
||||||
AFileName: String;
|
AFileName: String;
|
||||||
AConfig: TJSONObject;
|
AConfig: TJSONData;
|
||||||
AStream: TFileStream;
|
AStream: TFileStream;
|
||||||
AOptions: TFormatOptions;
|
AOptions: TFormatOptions;
|
||||||
begin
|
begin
|
||||||
|
|
@ -39,20 +39,20 @@ begin
|
||||||
|
|
||||||
AStream:= TFileStream.Create(AFileName, fmOpenRead or fmShareDenyNone);
|
AStream:= TFileStream.Create(AFileName, fmOpenRead or fmShareDenyNone);
|
||||||
try
|
try
|
||||||
AConfig:= GetJSON(AStream, True) as TJSONObject;
|
AConfig:= GetJSON(AStream, True);
|
||||||
try
|
|
||||||
with TStringList.Create do
|
|
||||||
try
|
|
||||||
Text:= AConfig.FormatJSON(AOptions);
|
|
||||||
SaveToFile(AFileName);
|
|
||||||
finally
|
|
||||||
Free;
|
|
||||||
end;
|
|
||||||
finally
|
|
||||||
AConfig.Free;
|
|
||||||
end;
|
|
||||||
finally
|
finally
|
||||||
AStream.Free;
|
AStream.Free;
|
||||||
end;
|
end;
|
||||||
|
try
|
||||||
|
with TStringList.Create do
|
||||||
|
try
|
||||||
|
Text:= AConfig.FormatJSON(AOptions);
|
||||||
|
SaveToFile(AFileName);
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
AConfig.Free;
|
||||||
|
end;
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue