mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 22:41:42 +02:00
lazutils: added MergeWithDelimiter
git-svn-id: branches/fixes_1_8@54757 -
This commit is contained in:
parent
f97577cb14
commit
f0e96331b8
@ -1240,13 +1240,8 @@ begin
|
|||||||
// normal unit name
|
// normal unit name
|
||||||
|
|
||||||
if Pos('.',AUnitName)<1 then begin
|
if Pos('.',AUnitName)<1 then begin
|
||||||
// generic unit -> search with namespaces first
|
// generic unit -> search with namespaces
|
||||||
NameSpaces:=Strings[ctdcsNamespaces];
|
NameSpaces:=MergeWithDelimiter(Strings[ctdcsNamespaces],AddNameSpaces,';');
|
||||||
if AddNameSpaces<>'' then begin
|
|
||||||
if NameSpaces<>'' then NameSpaces:=NameSpaces+';';
|
|
||||||
NameSpaces:=NameSpaces+AddNameSpaces;
|
|
||||||
end;
|
|
||||||
|
|
||||||
if NameSpaces<>'' then begin
|
if NameSpaces<>'' then begin
|
||||||
// search with additional namespaces, separated by semicolon
|
// search with additional namespaces, separated by semicolon
|
||||||
//debugln(['TCTDirectoryCache.FindUnitSourceInCompletePath NameSpaces="',NameSpaces,'"']);
|
//debugln(['TCTDirectoryCache.FindUnitSourceInCompletePath NameSpaces="',NameSpaces,'"']);
|
||||||
|
@ -29,6 +29,7 @@ function HasDelimitedItem(const List: string; Delimiter: char; FindItem: string
|
|||||||
): boolean;
|
): boolean;
|
||||||
function FindNextDelimitedItem(const List: string; Delimiter: char;
|
function FindNextDelimitedItem(const List: string; Delimiter: char;
|
||||||
var Position: integer; FindItem: string): string;
|
var Position: integer; FindItem: string): string;
|
||||||
|
function MergeWithDelimiter(const a, b: string; Delimiter: char): string;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -145,5 +146,16 @@ begin
|
|||||||
Result:='';
|
Result:='';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function MergeWithDelimiter(const a, b: string; Delimiter: char): string;
|
||||||
|
begin
|
||||||
|
if a<>'' then begin
|
||||||
|
if b<>'' then
|
||||||
|
Result:=a+Delimiter+b
|
||||||
|
else
|
||||||
|
Result:=b;
|
||||||
|
end else
|
||||||
|
Result:=b;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user