mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-29 12:23:54 +02:00
codetools: added substring
git-svn-id: trunk@35657 -
This commit is contained in:
parent
8004b97fea
commit
95659a5d58
@ -200,6 +200,8 @@ function SearchNextInText(Search: PChar; SearchLen: PtrInt;
|
||||
out MatchStart, MatchEnd: PtrInt;// 0 based
|
||||
WholeWords: boolean = false; MultiLine: boolean = false): boolean;
|
||||
|
||||
// misc
|
||||
function SubString(p: PChar; Count: SizeInt): string; overload;
|
||||
|
||||
// files
|
||||
type
|
||||
@ -5000,6 +5002,18 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function SubString(p: PChar; Count: SizeInt): string;
|
||||
var
|
||||
l: SizeInt;
|
||||
begin
|
||||
if (p=nil) or (Count=0) then exit('');
|
||||
l:=IndexByte(p,Count,0);
|
||||
if l<0 then l:=Count;
|
||||
if l=0 then exit('');
|
||||
SetLength(Result,l);
|
||||
System.Move(p^,Result[1],l);
|
||||
end;
|
||||
|
||||
function GatherUnitFiles(const BaseDir, SearchPath,
|
||||
Extensions: string; KeepDoubles, CaseInsensitive: boolean;
|
||||
var TreeOfUnitFiles: TAVLTree): boolean;
|
||||
|
@ -636,10 +636,10 @@ begin
|
||||
FCaseSensitive:=TheCaseSensitive;
|
||||
if CaseSensitive then begin
|
||||
FCompareKeyItemFunc:=@CompareStringAndStringToStringTreeItem;
|
||||
FTree:=TAVLTree.Create(@CompareStringToStringItems);
|
||||
FTree:=TMTAVLTree.Create(@CompareStringToStringItems);
|
||||
end else begin
|
||||
FCompareKeyItemFunc:=@CompareStringAndStringToStringTreeItemI;
|
||||
FTree:=TAVLTree.Create(@CompareStringToStringItemsI);
|
||||
FTree:=TMTAVLTree.Create(@CompareStringToStringItemsI);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user