mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-04 16:00:30 +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
|
out MatchStart, MatchEnd: PtrInt;// 0 based
|
||||||
WholeWords: boolean = false; MultiLine: boolean = false): boolean;
|
WholeWords: boolean = false; MultiLine: boolean = false): boolean;
|
||||||
|
|
||||||
|
// misc
|
||||||
|
function SubString(p: PChar; Count: SizeInt): string; overload;
|
||||||
|
|
||||||
// files
|
// files
|
||||||
type
|
type
|
||||||
@ -5000,6 +5002,18 @@ begin
|
|||||||
end;
|
end;
|
||||||
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,
|
function GatherUnitFiles(const BaseDir, SearchPath,
|
||||||
Extensions: string; KeepDoubles, CaseInsensitive: boolean;
|
Extensions: string; KeepDoubles, CaseInsensitive: boolean;
|
||||||
var TreeOfUnitFiles: TAVLTree): boolean;
|
var TreeOfUnitFiles: TAVLTree): boolean;
|
||||||
|
@ -636,10 +636,10 @@ begin
|
|||||||
FCaseSensitive:=TheCaseSensitive;
|
FCaseSensitive:=TheCaseSensitive;
|
||||||
if CaseSensitive then begin
|
if CaseSensitive then begin
|
||||||
FCompareKeyItemFunc:=@CompareStringAndStringToStringTreeItem;
|
FCompareKeyItemFunc:=@CompareStringAndStringToStringTreeItem;
|
||||||
FTree:=TAVLTree.Create(@CompareStringToStringItems);
|
FTree:=TMTAVLTree.Create(@CompareStringToStringItems);
|
||||||
end else begin
|
end else begin
|
||||||
FCompareKeyItemFunc:=@CompareStringAndStringToStringTreeItemI;
|
FCompareKeyItemFunc:=@CompareStringAndStringToStringTreeItemI;
|
||||||
FTree:=TAVLTree.Create(@CompareStringToStringItemsI);
|
FTree:=TMTAVLTree.Create(@CompareStringToStringItemsI);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user