Converter: use $ instead if % for replacement parameters.

git-svn-id: trunk@26507 -
This commit is contained in:
juha 2010-07-07 15:04:52 +00:00
parent 29d3c92962
commit f98b96c723
2 changed files with 9 additions and 9 deletions

View File

@ -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;

View File

@ -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;