mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 11:09:42 +02:00
* Code cleanup, part 2: remove functions already in sysutils, most of them not used anyway.
git-svn-id: trunk@39570 -
This commit is contained in:
parent
f6e9abeaf3
commit
aa4a470cfb
@ -677,90 +677,6 @@ const
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
{=============================================================}
|
||||
{=================== WideString functions ====================}
|
||||
{=============================================================}
|
||||
|
||||
{$IFDEF UniCode}
|
||||
|
||||
function StrPCopy (Dest: PRegExprChar; const Source: RegExprString): PRegExprChar;
|
||||
var
|
||||
Len : PtrInt;
|
||||
begin
|
||||
Len := length (Source); //###0.932
|
||||
if Len>0 then
|
||||
move(Source[1],Dest[0],Len*sizeof(ReChar));
|
||||
Dest [Len] := #0;
|
||||
Result := Dest;
|
||||
end; { of function StrPCopy
|
||||
--------------------------------------------------------------}
|
||||
|
||||
function StrLCopy (Dest, Source: PRegExprChar; MaxLen: PtrUInt): PRegExprChar;
|
||||
|
||||
begin
|
||||
if MaxLen>0 then
|
||||
move(Source[0],Dest[0],MaxLen*sizeof(ReChar));
|
||||
Result := Dest;
|
||||
end; { of function StrLCopy
|
||||
--------------------------------------------------------------}
|
||||
|
||||
function StrLen (Str: PRegExprChar): PtrUInt;
|
||||
|
||||
begin
|
||||
Result:=0;
|
||||
while Str [result] <> #0 do
|
||||
Inc (Result);
|
||||
end; { of function StrLen
|
||||
--------------------------------------------------------------}
|
||||
|
||||
function StrPos (Str1, Str2: PRegExprChar): PRegExprChar;
|
||||
|
||||
var
|
||||
n: PtrInt;
|
||||
|
||||
begin
|
||||
Result := nil;
|
||||
n := Pos (RegExprString (Str2), RegExprString (Str1));
|
||||
if n = 0 then
|
||||
EXIT;
|
||||
Result := Str1 + n - 1;
|
||||
end; { of function StrPos
|
||||
--------------------------------------------------------------}
|
||||
|
||||
function StrLComp (Str1, Str2: PRegExprChar; MaxLen: PtrUInt): PtrInt;
|
||||
|
||||
var
|
||||
S1, S2: RegExprString;
|
||||
begin
|
||||
S1 := Str1;
|
||||
S2 := Str2;
|
||||
if Length(S1) > MaxLen then
|
||||
SetLength(S1, MaxLen);
|
||||
if Length(S2) > MaxLen then
|
||||
SetLength(S2, MaxLen);
|
||||
if S1 > S2 then
|
||||
Result := 1
|
||||
else if S1 < S2 then
|
||||
Result := -1
|
||||
else
|
||||
Result := 0;
|
||||
end; { function StrLComp
|
||||
--------------------------------------------------------------}
|
||||
|
||||
function StrScan (Str: PRegExprChar; Chr: WideChar): PRegExprChar;
|
||||
|
||||
begin
|
||||
Result := nil;
|
||||
while (Str^ <> #0) and (Str^ <> Chr) do
|
||||
Inc (Str);
|
||||
if (Str^ <> #0) then
|
||||
Result := Str;
|
||||
end; { of function StrScan
|
||||
--------------------------------------------------------------}
|
||||
|
||||
{$ENDIF}
|
||||
|
||||
|
||||
{=============================================================}
|
||||
{===================== Global functions ======================}
|
||||
{=============================================================}
|
||||
|
Loading…
Reference in New Issue
Block a user