Browse Source

+ StrCharLength infrastructure

florian 20 years ago
parent
commit
3ed23de88e
4 changed files with 31 additions and 4 deletions
  1. 5 1
      rtl/inc/wstringh.inc
  2. 9 1
      rtl/inc/wstrings.inc
  3. 11 1
      rtl/objpas/sysutils/sysstr.inc
  4. 6 1
      rtl/objpas/sysutils/sysstrh.inc

+ 5 - 1
rtl/inc/wstringh.inc

@@ -60,6 +60,7 @@ Type
     CompareWideStringProc : function(const s1, s2 : WideString) : PtrInt;
     CompareWideStringProc : function(const s1, s2 : WideString) : PtrInt;
     SameWideStringProc : function(const s1, s2 : WideString) : Boolean;
     SameWideStringProc : function(const s1, s2 : WideString) : Boolean;
     CompareTextWideStringProc : function(const s1, s2 : WideString): PtrInt;
     CompareTextWideStringProc : function(const s1, s2 : WideString): PtrInt;
+    CharLengthPCharProc : function(const Str: PChar): PtrInt;
   end;
   end;
 
 
 
 
@@ -81,7 +82,10 @@ Procedure SetWideStringManager (Const New : TWideStringManager; Var Old: TWideSt
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.2  2005-02-03 18:40:50  florian
+  Revision 1.3  2005-02-06 09:38:45  florian
+    +  StrCharLength infrastructure
+
+  Revision 1.2  2005/02/03 18:40:50  florian
     + infrastructure for WideCompareText implemented
     + infrastructure for WideCompareText implemented
 
 
   Revision 1.1  2005/02/01 20:22:49  florian
   Revision 1.1  2005/02/01 20:22:49  florian

+ 9 - 1
rtl/inc/wstrings.inc

@@ -1405,6 +1405,10 @@ function CompareTextWideString(const s1, s2 : WideString): PtrInt;
     unimplementedwidestring;
     unimplementedwidestring;
   end;
   end;
 
 
+function CharLengthPChar(const Str: PChar): PtrInt;
+begin
+    unimplementedwidestring;
+end;
 
 
 procedure initwidestringmanager;
 procedure initwidestringmanager;
   begin
   begin
@@ -1415,12 +1419,16 @@ procedure initwidestringmanager;
     widestringmanager.CompareWideStringProc:=@CompareWideString;
     widestringmanager.CompareWideStringProc:=@CompareWideString;
     widestringmanager.SameWideStringProc:=@SameWideString;
     widestringmanager.SameWideStringProc:=@SameWideString;
     widestringmanager.CompareTextWideStringProc:=@CompareTextWideString;
     widestringmanager.CompareTextWideStringProc:=@CompareTextWideString;
+    widestringmanager.CharLengthPCharProc:=@CharLengthPChar;
   end;
   end;
 
 
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.49  2005-02-03 18:40:50  florian
+  Revision 1.50  2005-02-06 09:38:45  florian
+    +  StrCharLength infrastructure
+
+  Revision 1.49  2005/02/03 18:40:50  florian
     + infrastructure for WideCompareText implemented
     + infrastructure for WideCompareText implemented
 
 
   Revision 1.48  2005/02/01 20:22:49  florian
   Revision 1.48  2005/02/01 20:22:49  florian

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

@@ -2176,6 +2176,13 @@ begin
   Result:=mbSingleByte;
   Result:=mbSingleByte;
 end;
 end;
 
 
+
+Function StrCharLength(const Str: PChar): Integer;
+begin
+  result:=widestringmanager.CharLengthPCharProc(Str);
+end;
+
+  
 Function FindCmdLineSwitch(const Switch: string; const Chars: TSysCharSet;IgnoreCase: Boolean): Boolean;
 Function FindCmdLineSwitch(const Switch: string; const Chars: TSysCharSet;IgnoreCase: Boolean): Boolean;
 
 
 Var
 Var
@@ -2337,7 +2344,10 @@ const
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.26  2005-01-17 18:38:48  peter
+  Revision 1.27  2005-02-06 09:38:45  florian
+    +  StrCharLength infrastructure
+
+  Revision 1.26  2005/01/17 18:38:48  peter
     * extended overload disabled for powerpc
     * extended overload disabled for powerpc
 
 
   Revision 1.25  2005/01/16 17:53:27  michael
   Revision 1.25  2005/01/16 17:53:27  michael

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

@@ -171,6 +171,8 @@ Function StrByteType(Str: PChar; Index: Cardinal): TMbcsByteType;
 Function ByteToCharLen(const S: string; MaxLen: Integer): Integer;
 Function ByteToCharLen(const S: string; MaxLen: Integer): Integer;
 Function CharToByteLen(const S: string; MaxLen: Integer): Integer;
 Function CharToByteLen(const S: string; MaxLen: Integer): Integer;
 Function ByteToCharIndex(const S: string; Index: Integer): Integer;
 Function ByteToCharIndex(const S: string; Index: Integer): Integer;
+Function StrCharLength(const Str: PChar): Integer;
+
 
 
 const
 const
 {$ifndef unix}
 {$ifndef unix}
@@ -200,7 +202,10 @@ function BCDToInt(Value: integer): integer;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.13  2005-01-17 18:38:48  peter
+  Revision 1.14  2005-02-06 09:38:45  florian
+    +  StrCharLength infrastructure
+
+  Revision 1.13  2005/01/17 18:38:48  peter
     * extended overload disabled for powerpc
     * extended overload disabled for powerpc
 
 
   Revision 1.12  2005/01/16 17:53:27  michael
   Revision 1.12  2005/01/16 17:53:27  michael