diff --git a/components/codetools/basiccodetools.pas b/components/codetools/basiccodetools.pas index 11a90f82e2..7c74da015d 100644 --- a/components/codetools/basiccodetools.pas +++ b/components/codetools/basiccodetools.pas @@ -153,6 +153,8 @@ procedure AdjustPositionAfterInsert(var p: integer; IsStart: boolean; // comparison function CompareText(Txt1: PChar; Len1: integer; Txt2: PChar; Len2: integer; CaseSensitive: boolean): integer; overload; +function CompareText(const Txt1, Txt2: string; + CaseSensitive: boolean = false): integer; overload; function CompareText(Txt1: PChar; Len1: integer; Txt2: PChar; Len2: integer; CaseSensitive, IgnoreSpace: boolean): integer; overload; function CompareTextIgnoringSpace(const Txt1, Txt2: string; @@ -5380,6 +5382,12 @@ begin Result:=0; end; +function CompareText(const Txt1, Txt2: string; CaseSensitive: boolean): integer; +begin + Result:=CompareText(PChar(Pointer(Txt1)),length(Txt1), + PChar(Pointer(Txt2)),length(Txt2),CaseSensitive); +end; + function CompareText(Txt1: PChar; Len1: integer; Txt2: PChar; Len2: integer; CaseSensitive, IgnoreSpace: boolean): integer; begin diff --git a/components/codetools/codetoolsstructs.pas b/components/codetools/codetoolsstructs.pas index 4d0ba35769..869ab6b427 100644 --- a/components/codetools/codetoolsstructs.pas +++ b/components/codetools/codetoolsstructs.pas @@ -123,6 +123,7 @@ type procedure Remove(const Name: string); virtual; property CaseSensitive: boolean read FCaseSensitive; property Tree: TAVLTree read FTree; // tree of PStringMapItem + function Count: integer; function FindNode(const s: string): TAVLTreeNode; function Equals(OtherTree: TStringMap): boolean; reintroduce; procedure Assign(Source: TStringMap); virtual; @@ -710,6 +711,11 @@ begin end; end; +function TStringMap.Count: integer; +begin + Result:=Tree.Count; +end; + function TStringMap.Equals(OtherTree: TStringMap): boolean; var Node: TAVLTreeNode;