浏览代码

* sametext and ansisametext added. (simple (ansi)comparetext wrappers)

marco 22 年之前
父节点
当前提交
d086084380
共有 2 个文件被更改,包括 22 次插入2 次删除
  1. 16 1
      rtl/objpas/sysutils/sysstr.inc
  2. 6 1
      rtl/objpas/sysutils/sysstrh.inc

+ 16 - 1
rtl/objpas/sysutils/sysstr.inc

@@ -193,6 +193,12 @@ begin
     result:=(count1-count2);
     result:=(count1-count2);
 end;
 end;
 
 
+function SameText(const s1,s2:String):Boolean;
+
+begin
+ Result:=CompareText(S1,S2)=0;
+end;
+
 {==============================================================================}
 {==============================================================================}
 {   Ansi string functions                                                      }
 {   Ansi string functions                                                      }
 {   these functions rely on the character set loaded by the OS                 }
 {   these functions rely on the character set loaded by the OS                 }
@@ -252,6 +258,12 @@ begin
     Result:=L1-L2;
     Result:=L1-L2;
 end;
 end;
 
 
+function AnsiSameText(const s1,s2:String):Boolean;
+
+begin
+ AnsiSameText:=AnsiCompareText(S1,S2)=0;
+end;
+
 function AnsiStrComp(S1, S2: PChar): integer;
 function AnsiStrComp(S1, S2: PChar): integer;
 
 
 begin
 begin
@@ -2000,7 +2012,10 @@ const
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.1  2003-10-06 21:01:06  peter
+  Revision 1.2  2003-10-07 12:02:47  marco
+   * sametext and ansisametext added. (simple (ansi)comparetext wrappers)
+
+  Revision 1.1  2003/10/06 21:01:06  peter
     * moved classes unit to rtl
     * moved classes unit to rtl
 
 
   Revision 1.26  2003/09/06 21:22:07  marco
   Revision 1.26  2003/09/06 21:22:07  marco

+ 6 - 1
rtl/objpas/sysutils/sysstrh.inc

@@ -68,11 +68,13 @@ function CompareStr(const S1, S2: string): Integer;
 function CompareMemRange(P1, P2: Pointer; Length: cardinal): integer;
 function CompareMemRange(P1, P2: Pointer; Length: cardinal): integer;
 function CompareMem(P1, P2: Pointer; Length: cardinal): Boolean;
 function CompareMem(P1, P2: Pointer; Length: cardinal): Boolean;
 function CompareText(const S1, S2: string): integer;
 function CompareText(const S1, S2: string): integer;
+function SameText(const s1,s2:String):Boolean;
 
 
 function AnsiUpperCase(const s: string): string;
 function AnsiUpperCase(const s: string): string;
 function AnsiLowerCase(const s: string): string;
 function AnsiLowerCase(const s: string): string;
 function AnsiCompareStr(const S1, S2: string): integer;
 function AnsiCompareStr(const S1, S2: string): integer;
 function AnsiCompareText(const S1, S2: string): integer;
 function AnsiCompareText(const S1, S2: string): integer;
+function AnsiSameText(const s1,s2:String):Boolean;
 function AnsiStrComp(S1, S2: PChar): integer;
 function AnsiStrComp(S1, S2: PChar): integer;
 function AnsiStrIComp(S1, S2: PChar): integer;
 function AnsiStrIComp(S1, S2: PChar): integer;
 function AnsiStrLComp(S1, S2: PChar; MaxLen: cardinal): integer;
 function AnsiStrLComp(S1, S2: PChar; MaxLen: cardinal): integer;
@@ -160,7 +162,10 @@ function BCDToInt(Value: integer): integer;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.1  2003-10-06 21:01:06  peter
+  Revision 1.2  2003-10-07 12:02:47  marco
+   * sametext and ansisametext added. (simple (ansi)comparetext wrappers)
+
+  Revision 1.1  2003/10/06 21:01:06  peter
     * moved classes unit to rtl
     * moved classes unit to rtl
 
 
   Revision 1.17  2003/09/06 21:22:08  marco
   Revision 1.17  2003/09/06 21:22:08  marco