mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 08:48:08 +02:00
Move GetToken function to testu unit
git-svn-id: trunk@38684 -
This commit is contained in:
parent
33de492553
commit
450f62efcc
@ -231,24 +231,6 @@ begin
|
||||
ForceExtension:=Copy(Hstr,1,j-1);
|
||||
end;
|
||||
|
||||
type
|
||||
TCharSet = set of char;
|
||||
|
||||
function GetToken(var s: string; Delims: TCharSet = [' ']):string;
|
||||
var
|
||||
i : longint;
|
||||
p: PChar;
|
||||
begin
|
||||
p:=PChar(s);
|
||||
i:=0;
|
||||
while (p^ <> #0) and not (p^ in Delims) do begin
|
||||
Inc(p);
|
||||
Inc(i);
|
||||
end;
|
||||
GetToken:=Copy(s,1,i);
|
||||
Delete(s,1,i+1);
|
||||
end;
|
||||
|
||||
procedure mkdirtree(const s:string);
|
||||
var
|
||||
SErr, hs : string;
|
||||
|
@ -12,6 +12,8 @@ uses
|
||||
---------------------------------------------------------------------}
|
||||
|
||||
type
|
||||
TCharSet = set of char;
|
||||
|
||||
TVerboseLevel=(V_Abort,V_Error,V_Warning,V_Normal,V_Debug,V_SQL);
|
||||
|
||||
TConfig = record
|
||||
@ -79,9 +81,25 @@ Function SplitFileExt(const s:string):string;
|
||||
Function FileExists (Const F : String) : Boolean;
|
||||
Function PathExists (Const F : String) : Boolean;
|
||||
Function IsAbsolute (Const F : String) : boolean;
|
||||
function GetToken(var s: string; Delims: TCharSet = [' ']):string;
|
||||
|
||||
Implementation
|
||||
|
||||
function GetToken(var s: string; Delims: TCharSet = [' ']):string;
|
||||
var
|
||||
i : longint;
|
||||
p: PChar;
|
||||
begin
|
||||
p:=PChar(s);
|
||||
i:=0;
|
||||
while (p^ <> #0) and not (p^ in Delims) do begin
|
||||
Inc(p);
|
||||
Inc(i);
|
||||
end;
|
||||
GetToken:=Copy(s,1,i);
|
||||
Delete(s,1,i+1);
|
||||
end;
|
||||
|
||||
function SplitPath(const s:string):string;
|
||||
var
|
||||
i : longint;
|
||||
|
Loading…
Reference in New Issue
Block a user