-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJclMapScannerHelper.pas
More file actions
48 lines (40 loc) · 936 Bytes
/
Copy pathJclMapScannerHelper.pas
File metadata and controls
48 lines (40 loc) · 936 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
unit JclMapScannerHelper;
interface
uses
JclDebug;
type
TJclAbstractMapParserHelper = class helper for TJclAbstractMapParser
class function MapStringToSourceFile(MapString: PJclMapString): string; static;
end;
implementation
uses
System.SysUtils;
{ TJclAbstractMapParserHelper }
class function TJclAbstractMapParserHelper.MapStringToSourceFile(
MapString: PJclMapString): string;
var
P: PJclMapString;
begin
if MapString = nil then
begin
Result := '';
Exit;
end;
if MapString^ = '(' then
begin
Inc(MapString);
P := MapString;
while (P^ <> #0) and not (P^ in [')', #10, #13]) do
Inc(P);
end
else
begin
P := MapString;
while (P^ <> #0) and (P^ > ' ') do
Inc(P);
end;
SetString(Result, MapString, P - MapString);
if Result.Contains('(') then
Result := Result.Substring(Result.IndexOf('(')+1, Result.IndexOf(')') - Result.IndexOf('(') - 1)
end;
end.