mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 10:59:19 +02:00
Converter: use $ instead if % for replacement parameters.
git-svn-id: trunk@26507 -
This commit is contained in:
parent
29d3c92962
commit
f98b96c723
@ -487,7 +487,7 @@ begin
|
||||
end;
|
||||
|
||||
procedure SplitParam(const aStr: string; aDelimiter: Char; Result: TStringList);
|
||||
// A modified split function. Removes '%' in front of every token.
|
||||
// A modified split function. Removes '$' in front of every token.
|
||||
|
||||
procedure SetItem(Start, Len: integer); // Add the item.
|
||||
begin
|
||||
@ -497,12 +497,12 @@ procedure SplitParam(const aStr: string; aDelimiter: Char; Result: TStringList);
|
||||
end;
|
||||
while (aStr[Start+Len-1]=' ') do // Trim trailing space.
|
||||
Dec(Len);
|
||||
if (aStr[Start]='%') then begin // Parameters must begin with '%'.
|
||||
if (aStr[Start]='$') then begin // Parameters must begin with '$'.
|
||||
Inc(Start);
|
||||
Dec(Len);
|
||||
end
|
||||
else
|
||||
raise EConverterError.Create('Replacement function parameter should start with "%".');
|
||||
raise EConverterError.Create('Replacement function parameter should start with "$".');
|
||||
Result.Add(Copy(aStr, Start, Len));
|
||||
end;
|
||||
|
||||
|
@ -253,14 +253,14 @@ begin
|
||||
|
||||
// Map Delphi function names to FCL/LCL functions.
|
||||
TheMap:=fReplaceFuncs;
|
||||
MapReplacement('ShellExecute', 'OpenURL(%3)');
|
||||
MapReplacement('ShellExecute', 'OpenURL($3)');
|
||||
// File name encoding. ToDo: add other similar funcs with UTF8 counterparts.
|
||||
MapReplacement('FileExists', 'FileExistsUTF8(%1)');
|
||||
MapReplacement('FileExists', 'FileExistsUTF8($1)');
|
||||
// File functions using a handle.
|
||||
MapReplacement('CreateFile', 'FileCreate(%1)'); // in SysUtils
|
||||
MapReplacement('GetFileSize', 'FileSize(%1)'); // in SysUtils
|
||||
MapReplacement('ReadFile', 'FileRead(%1)'); // in SysUtils
|
||||
MapReplacement('CloseHandle', 'FileClose(%1)'); // in SysUtils
|
||||
MapReplacement('CreateFile', 'FileCreate($1)'); // in SysUtils
|
||||
MapReplacement('GetFileSize', 'FileSize($1)'); // in SysUtils
|
||||
MapReplacement('ReadFile', 'FileRead($1)'); // in SysUtils
|
||||
MapReplacement('CloseHandle', 'FileClose($1)'); // in SysUtils
|
||||
end;
|
||||
|
||||
destructor TConvertSettings.Destroy;
|
||||
|
Loading…
Reference in New Issue
Block a user