mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 09:59:25 +02:00
+ added Ansi* routines to widestring manager
* made them using OS calls on windows
This commit is contained in:
parent
1d003c58a0
commit
0bfbd0a18e
@ -60,10 +60,21 @@ Type
|
||||
CompUTF8 : function(p1,p2:PUTF8String) : shortint;
|
||||
CompUCS2 : function(p1,p2:PUCS2Char) : shortint;
|
||||
CompUCS4 : function(p1,p2:PUC42Char) : shortint;
|
||||
}
|
||||
}
|
||||
CompareWideStringProc : function(const s1, s2 : WideString) : PtrInt;
|
||||
CompareTextWideStringProc : function(const s1, s2 : WideString): PtrInt;
|
||||
CharLengthPCharProc : function(const Str: PChar): PtrInt;
|
||||
|
||||
UpperAnsiStringProc : function(const s : ansistring) : ansistring;
|
||||
LowerAnsiStringProc : function(const s : ansistring) : ansistring;
|
||||
CompareStrAnsiStringProc : function(const S1, S2: ansistring): PtrInt;
|
||||
CompareTextAnsiStringProc : function(const S1, S2: ansistring): PtrInt;
|
||||
StrCompAnsiStringProc : function(S1, S2: PChar): PtrInt;
|
||||
StrICompAnsiStringProc : function(S1, S2: PChar): PtrInt;
|
||||
StrLCompAnsiStringProc : function(S1, S2: PChar; MaxLen: PtrUInt): PtrInt;
|
||||
StrLICompAnsiStringProc : function(S1, S2: PChar; MaxLen: PtrUInt): PtrInt;
|
||||
StrLowerAnsiStringProc : function(Str: PChar): PChar;
|
||||
StrUpperAnsiStringProc : function(Str: PChar): PChar;
|
||||
end;
|
||||
|
||||
|
||||
@ -85,7 +96,11 @@ Procedure SetWideStringManager (Const New : TWideStringManager; Var Old: TWideSt
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.5 2005-02-26 15:00:14 florian
|
||||
Revision 1.6 2005-03-12 14:56:22 florian
|
||||
+ added Ansi* routines to widestring manager
|
||||
* made them using OS calls on windows
|
||||
|
||||
Revision 1.5 2005/02/26 15:00:14 florian
|
||||
+ WideSameStr
|
||||
|
||||
Revision 1.4 2005/02/26 10:21:17 florian
|
||||
|
@ -18,10 +18,28 @@
|
||||
procedure InitInternationalGeneric;
|
||||
begin
|
||||
fillchar(SysLocale,sizeof(SysLocale),0);
|
||||
|
||||
{ keep these routines out of the executable? }
|
||||
{$ifndef FPC_NOGENERICANSIROUTINES}
|
||||
widestringmanager.UpperAnsiStringProc:=@GenericAnsiUpperCase;
|
||||
widestringmanager.LowerAnsiStringProc:=@GenericAnsiLowerCase;
|
||||
widestringmanager.CompareStrAnsiStringProc:=@GenericAnsiCompareStr;
|
||||
widestringmanager.CompareTextAnsiStringProc:=@GenericAnsiCompareText;
|
||||
widestringmanager.StrCompAnsiStringProc:=@GenericAnsiStrComp;
|
||||
widestringmanager.StrICompAnsiStringProc:=@GenericAnsiStrIComp;
|
||||
widestringmanager.StrLCompAnsiStringProc:=@GenericAnsiStrLComp;
|
||||
widestringmanager.StrLICompAnsiStringProc:=@GenericAnsiStrLIComp;
|
||||
widestringmanager.StrLowerAnsiStringProc:=@GenericAnsiStrLower;
|
||||
widestringmanager.StrUpperAnsiStringProc:=@GenericAnsiStrUpper;
|
||||
{$endif FPC_NOGENERICANSIROUTINES}
|
||||
end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.1 2005-02-26 19:25:01 florian
|
||||
Revision 1.2 2005-03-12 14:56:22 florian
|
||||
+ added Ansi* routines to widestring manager
|
||||
* made them using OS calls on windows
|
||||
|
||||
Revision 1.1 2005/02/26 19:25:01 florian
|
||||
+ initial commit
|
||||
}
|
@ -198,29 +198,31 @@ end;
|
||||
{ these functions rely on the character set loaded by the OS }
|
||||
{==============================================================================}
|
||||
|
||||
|
||||
function AnsiUpperCase(const s: string): string;
|
||||
var len, i: integer;
|
||||
function GenericAnsiUpperCase(const s: string): string;
|
||||
var
|
||||
len, i: integer;
|
||||
begin
|
||||
len := length(s);
|
||||
SetLength(result, len);
|
||||
for i := 1 to len do
|
||||
result[i] := UpperCaseTable[ord(s[i])];
|
||||
end ;
|
||||
len := length(s);
|
||||
SetLength(result, len);
|
||||
for i := 1 to len do
|
||||
result[i] := UpperCaseTable[ord(s[i])];
|
||||
end;
|
||||
|
||||
function AnsiLowerCase(const s: string): string;
|
||||
var len, i: integer;
|
||||
|
||||
function GenericAnsiLowerCase(const s: string): string;
|
||||
var
|
||||
len, i: integer;
|
||||
begin
|
||||
len := length(s);
|
||||
SetLength(result, len);
|
||||
for i := 1 to len do
|
||||
result[i] := LowerCaseTable[ord(s[i])];
|
||||
end ;
|
||||
len := length(s);
|
||||
SetLength(result, len);
|
||||
for i := 1 to len do
|
||||
result[i] := LowerCaseTable[ord(s[i])];
|
||||
end;
|
||||
|
||||
function AnsiCompareStr(const S1, S2: string): integer;
|
||||
|
||||
Var I,L1,L2 : Longint;
|
||||
|
||||
function GenericAnsiCompareStr(const S1, S2: string): PtrInt;
|
||||
Var
|
||||
I,L1,L2 : SizeInt;
|
||||
begin
|
||||
Result:=0;
|
||||
L1:=Length(S1);
|
||||
@ -235,9 +237,9 @@ begin
|
||||
Result:=L1-L2;
|
||||
end;
|
||||
|
||||
function AnsiCompareText(const S1, S2: string): integer;
|
||||
Var I,L1,L2 : Longint;
|
||||
|
||||
function GenericAnsiCompareText(const S1, S2: string): PtrInt;
|
||||
Var
|
||||
I,L1,L2 : SizeInt;
|
||||
begin
|
||||
Result:=0;
|
||||
L1:=Length(S1);
|
||||
@ -252,19 +254,19 @@ begin
|
||||
Result:=L1-L2;
|
||||
end;
|
||||
|
||||
function AnsiSameText(const s1,s2:String):Boolean;
|
||||
function AnsiSameText(const s1,s2:String):Boolean;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
|
||||
begin
|
||||
AnsiSameText:=AnsiCompareText(S1,S2)=0;
|
||||
end;
|
||||
|
||||
function AnsiSameStr(const s1,s2:String):Boolean;
|
||||
function AnsiSameStr(const s1,s2:String):Boolean;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
|
||||
begin
|
||||
AnsiSameStr:=AnsiCompareStr(S1,S2)=0;
|
||||
end;
|
||||
|
||||
function AnsiStrComp(S1, S2: PChar): integer;
|
||||
function GenericAnsiStrComp(S1, S2: PChar): PtrInt;
|
||||
|
||||
begin
|
||||
Result:=0;
|
||||
@ -286,7 +288,8 @@ begin
|
||||
Until (Result<>0) or ((S1[0]=#0) or (S2[0]=#0))
|
||||
end;
|
||||
|
||||
function AnsiStrIComp(S1, S2: PChar): integer;
|
||||
|
||||
function GenericAnsiStrIComp(S1, S2: PChar): PtrInt;
|
||||
|
||||
begin
|
||||
Result:=0;
|
||||
@ -308,7 +311,8 @@ begin
|
||||
Until (Result<>0) or ((S1[0]=#0) or (S2[0]=#0))
|
||||
end;
|
||||
|
||||
function AnsiStrLComp(S1, S2: PChar; MaxLen: cardinal): integer;
|
||||
|
||||
function GenericAnsiStrLComp(S1, S2: PChar; MaxLen: PtrUInt): PtrInt;
|
||||
|
||||
Var I : cardinal;
|
||||
|
||||
@ -333,9 +337,10 @@ begin
|
||||
Inc(S2);
|
||||
Inc(I);
|
||||
Until (Result<>0) or ((S1[0]=#0) or (S2[0]=#0)) or (I=MaxLen)
|
||||
end ;
|
||||
end;
|
||||
|
||||
function AnsiStrLIComp(S1, S2: PChar; MaxLen: cardinal): integer;
|
||||
|
||||
function GenericAnsiStrLIComp(S1, S2: PChar; MaxLen: PtrUInt): PtrInt;
|
||||
|
||||
Var I : cardinal;
|
||||
|
||||
@ -360,20 +365,22 @@ begin
|
||||
Inc(S2);
|
||||
Inc(I);
|
||||
Until (Result<>0) or ((S1[0]=#0) or (S2[0]=#0)) or (I=MaxLen)
|
||||
end ;
|
||||
end;
|
||||
|
||||
function AnsiStrLower(Str: PChar): PChar;
|
||||
|
||||
function GenericAnsiStrLower(Str: PChar): PChar;
|
||||
begin
|
||||
result := Str;
|
||||
if Str <> Nil then begin
|
||||
while Str^ <> #0 do begin
|
||||
Str^ := LowerCaseTable[byte(Str^)];
|
||||
Str := Str + 1;
|
||||
end ;
|
||||
end ;
|
||||
end ;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
function AnsiStrUpper(Str: PChar): PChar;
|
||||
|
||||
function GenericAnsiStrUpper(Str: PChar): PChar;
|
||||
begin
|
||||
result := Str;
|
||||
if Str <> Nil then begin
|
||||
@ -399,6 +406,67 @@ begin
|
||||
Dec(Result);
|
||||
end ;
|
||||
|
||||
|
||||
function AnsiUpperCase(const s: string): string;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
begin
|
||||
result:=widestringmanager.UpperAnsiStringProc(s);
|
||||
end;
|
||||
|
||||
|
||||
function AnsiLowerCase(const s: string): string;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
begin
|
||||
result:=widestringmanager.LowerAnsiStringProc(s);
|
||||
end;
|
||||
|
||||
|
||||
function AnsiCompareStr(const S1, S2: string): integer;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
begin
|
||||
result:=widestringmanager.CompareStrAnsiStringProc(s1,s2);
|
||||
end;
|
||||
|
||||
|
||||
function AnsiCompareText(const S1, S2: string): integer;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
begin
|
||||
result:=widestringmanager.CompareTextAnsiStringProc(s1,s2);
|
||||
end;
|
||||
|
||||
|
||||
function AnsiStrComp(S1, S2: PChar): integer;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
begin
|
||||
result:=widestringmanager.StrCompAnsiStringProc(s1,s2);
|
||||
end;
|
||||
|
||||
|
||||
function AnsiStrIComp(S1, S2: PChar): integer;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
begin
|
||||
result:=widestringmanager.StrICompAnsiStringProc(s1,s2);
|
||||
end;
|
||||
|
||||
|
||||
function AnsiStrLComp(S1, S2: PChar; MaxLen: cardinal): integer;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
begin
|
||||
result:=widestringmanager.StrLCompAnsiStringProc(s1,s2,maxlen);
|
||||
end;
|
||||
|
||||
|
||||
function AnsiStrLIComp(S1, S2: PChar; MaxLen: cardinal): integer;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
begin
|
||||
result:=widestringmanager.StrLICompAnsiStringProc(s1,s2,maxlen);
|
||||
end;
|
||||
|
||||
|
||||
function AnsiStrLower(Str: PChar): PChar;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
begin
|
||||
result:=widestringmanager.StrLowerAnsiStringProc(Str);
|
||||
end;
|
||||
|
||||
|
||||
function AnsiStrUpper(Str: PChar): PChar;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
begin
|
||||
result:=widestringmanager.StrUpperAnsiStringProc(Str);
|
||||
end;
|
||||
|
||||
|
||||
{==============================================================================}
|
||||
{ End of Ansi functions }
|
||||
{==============================================================================}
|
||||
@ -2009,7 +2077,11 @@ const
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.32 2005-03-01 19:23:03 jonas
|
||||
Revision 1.33 2005-03-12 14:56:22 florian
|
||||
+ added Ansi* routines to widestring manager
|
||||
* made them using OS calls on windows
|
||||
|
||||
Revision 1.32 2005/03/01 19:23:03 jonas
|
||||
* fixed newstr() and disposestr()
|
||||
|
||||
Revision 1.31 2005/02/28 11:12:17 jonas
|
||||
|
@ -87,18 +87,18 @@ function CompareMem(P1, P2: Pointer; Length: cardinal): Boolean;
|
||||
function CompareText(const S1, S2: string): integer;
|
||||
function SameText(const s1,s2:String):Boolean;
|
||||
|
||||
function AnsiUpperCase(const s: string): string;
|
||||
function AnsiLowerCase(const s: string): string;
|
||||
function AnsiCompareStr(const S1, S2: string): integer;
|
||||
function AnsiCompareText(const S1, S2: string): integer;
|
||||
function AnsiSameText(const s1,s2:String):Boolean;
|
||||
function AnsiSameStr(const s1,s2:String):Boolean;
|
||||
function AnsiStrComp(S1, S2: PChar): integer;
|
||||
function AnsiStrIComp(S1, S2: PChar): integer;
|
||||
function AnsiStrLComp(S1, S2: PChar; MaxLen: cardinal): integer;
|
||||
function AnsiStrLIComp(S1, S2: PChar; MaxLen: cardinal): integer;
|
||||
function AnsiStrLower(Str: PChar): PChar;
|
||||
function AnsiStrUpper(Str: PChar): PChar;
|
||||
function AnsiUpperCase(const s: string): string;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
function AnsiLowerCase(const s: string): string;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
function AnsiCompareStr(const S1, S2: string): integer;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
function AnsiCompareText(const S1, S2: string): integer;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
function AnsiSameText(const s1,s2:String):Boolean;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
function AnsiSameStr(const s1,s2:String):Boolean;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
function AnsiStrComp(S1, S2: PChar): integer;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
function AnsiStrIComp(S1, S2: PChar): integer;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
function AnsiStrLComp(S1, S2: PChar; MaxLen: cardinal): integer;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
function AnsiStrLIComp(S1, S2: PChar; MaxLen: cardinal): integer;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
function AnsiStrLower(Str: PChar): PChar;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
function AnsiStrUpper(Str: PChar): PChar;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
function AnsiLastChar(const S: string): PChar;
|
||||
function AnsiStrLastChar(Str: PChar): PChar;
|
||||
|
||||
@ -202,7 +202,11 @@ function BCDToInt(Value: integer): integer;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.15 2005-02-14 17:13:31 peter
|
||||
Revision 1.16 2005-03-12 14:56:22 florian
|
||||
+ added Ansi* routines to widestring manager
|
||||
* made them using OS calls on windows
|
||||
|
||||
Revision 1.15 2005/02/14 17:13:31 peter
|
||||
* truncate log
|
||||
|
||||
Revision 1.14 2005/02/06 09:38:45 florian
|
||||
|
@ -12,6 +12,11 @@
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
**********************************************************************}
|
||||
{ Using inlining for small system functions/wrappers }
|
||||
{$ifdef HASINLINE}
|
||||
{$inline on}
|
||||
{$define SYSUTILSINLINE}
|
||||
{$endif}
|
||||
|
||||
{ Read date & Time function declarations }
|
||||
{$i osutilsh.inc}
|
||||
@ -232,7 +237,11 @@ Type
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.13 2005-02-14 17:13:31 peter
|
||||
Revision 1.14 2005-03-12 14:56:22 florian
|
||||
+ added Ansi* routines to widestring manager
|
||||
* made them using OS calls on windows
|
||||
|
||||
Revision 1.13 2005/02/14 17:13:31 peter
|
||||
* truncate log
|
||||
|
||||
Revision 1.12 2005/02/03 18:40:02 florian
|
||||
|
@ -20,37 +20,37 @@
|
||||
}
|
||||
|
||||
|
||||
function WideUpperCase(const s : WideString) : WideString;
|
||||
function WideUpperCase(const s : WideString) : WideString;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
begin
|
||||
result:=widestringmanager.UpperWideStringProc(s);
|
||||
end;
|
||||
|
||||
|
||||
function WideLowerCase(const s : WideString) : WideString;
|
||||
function WideLowerCase(const s : WideString) : WideString;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
begin
|
||||
result:=widestringmanager.LowerWideStringProc(s);
|
||||
end;
|
||||
|
||||
|
||||
function WideCompareStr(const s1, s2 : WideString) : PtrInt;
|
||||
function WideCompareStr(const s1, s2 : WideString) : PtrInt;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
begin
|
||||
result:=widestringmanager.CompareWideStringProc(s1,s2);
|
||||
end;
|
||||
|
||||
|
||||
function WideSameStr(const s1, s2 : WideString) : Boolean;
|
||||
function WideSameStr(const s1, s2 : WideString) : Boolean;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
begin
|
||||
result:=widestringmanager.CompareWideStringProc(s1,s2)=0;
|
||||
end;
|
||||
|
||||
|
||||
function WideCompareText(const s1, s2 : WideString) : PtrInt;
|
||||
function WideCompareText(const s1, s2 : WideString) : PtrInt;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
begin
|
||||
result:=widestringmanager.CompareTextWideStringProc(s1,s2);
|
||||
end;
|
||||
|
||||
|
||||
function WideSameText(const s1, s2 : WideString) : Boolean;
|
||||
function WideSameText(const s1, s2 : WideString) : Boolean;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
begin
|
||||
result:=widestringmanager.CompareTextWideStringProc(s1,s2)=0;
|
||||
end;
|
||||
@ -97,7 +97,11 @@ Procedure WideFmtStr(Var Res: WideString; Const Fmt : WideString; Const args: Ar
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.6 2005-03-06 18:28:23 florian
|
||||
Revision 1.7 2005-03-12 14:56:22 florian
|
||||
+ added Ansi* routines to widestring manager
|
||||
* made them using OS calls on windows
|
||||
|
||||
Revision 1.6 2005/03/06 18:28:23 florian
|
||||
+ WideFormatBuf and WideFmtStr implemented
|
||||
|
||||
Revision 1.5 2005/02/26 15:00:14 florian
|
||||
|
@ -19,12 +19,12 @@
|
||||
*********************************************************************
|
||||
}
|
||||
|
||||
function WideUpperCase(const s : WideString) : WideString;
|
||||
function WideLowerCase(const s : WideString) : WideString;
|
||||
function WideCompareStr(const s1, s2 : WideString) : PtrInt;
|
||||
function WideSameStr(const s1, s2 : WideString) : Boolean;
|
||||
function WideCompareText(const s1, s2 : WideString) : PtrInt;
|
||||
function WideSameText(const s1, s2 : WideString) : Boolean;
|
||||
function WideUpperCase(const s : WideString) : WideString;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
function WideLowerCase(const s : WideString) : WideString;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
function WideCompareStr(const s1, s2 : WideString) : PtrInt;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
function WideSameStr(const s1, s2 : WideString) : Boolean;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
function WideCompareText(const s1, s2 : WideString) : PtrInt;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
function WideSameText(const s1, s2 : WideString) : Boolean;{$ifdef SYSUTILSINLINE}inline;{$endif}
|
||||
|
||||
Function WideFormat (Const Fmt : WideString; const Args : Array of const) : WideString;
|
||||
Function WideFormatBuf (Var Buffer; BufLen : Cardinal;
|
||||
@ -35,7 +35,11 @@ Procedure WideFmtStr(Var Res: WideString; Const Fmt : WideString; Const args: Ar
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.5 2005-03-06 18:28:23 florian
|
||||
Revision 1.6 2005-03-12 14:56:22 florian
|
||||
+ added Ansi* routines to widestring manager
|
||||
* made them using OS calls on windows
|
||||
|
||||
Revision 1.5 2005/03/06 18:28:23 florian
|
||||
+ WideFormatBuf and WideFmtStr implemented
|
||||
|
||||
Revision 1.4 2005/02/26 15:00:14 florian
|
||||
|
@ -1022,6 +1022,84 @@ function Win32CompareTextWideString(const s1, s2 : WideString) : PtrInt;
|
||||
end;
|
||||
|
||||
|
||||
function Win32AnsiUpperCase(const s: string): string;
|
||||
begin
|
||||
if length(s)>0 then
|
||||
begin
|
||||
result:=s;
|
||||
UniqueString(result);
|
||||
CharUpperBuff(pchar(result),length(result));
|
||||
end
|
||||
else
|
||||
result:='';
|
||||
end;
|
||||
|
||||
|
||||
function Win32AnsiLowerCase(const s: string): string;
|
||||
begin
|
||||
if length(s)>0 then
|
||||
begin
|
||||
result:=s;
|
||||
UniqueString(result);
|
||||
CharLowerBuff(pchar(result),length(result));
|
||||
end
|
||||
else
|
||||
result:='';
|
||||
end;
|
||||
|
||||
|
||||
function Win32AnsiCompareStr(const S1, S2: string): PtrInt;
|
||||
begin
|
||||
result:=CompareString(LOCALE_USER_DEFAULT,0,pchar(s1),length(s1),
|
||||
pchar(s2),length(s2))-2;
|
||||
end;
|
||||
|
||||
|
||||
function Win32AnsiCompareText(const S1, S2: string): PtrInt;
|
||||
begin
|
||||
result:=CompareString(LOCALE_USER_DEFAULT,NORM_IGNORECASE,pchar(s1),length(s1),
|
||||
pchar(s2),length(s2))-2;
|
||||
end;
|
||||
|
||||
|
||||
function Win32AnsiStrComp(S1, S2: PChar): PtrInt;
|
||||
begin
|
||||
result:=CompareString(LOCALE_USER_DEFAULT,0,s1,-1,s2,-1)-2;
|
||||
end;
|
||||
|
||||
|
||||
function Win32AnsiStrIComp(S1, S2: PChar): PtrInt;
|
||||
begin
|
||||
result:=CompareString(LOCALE_USER_DEFAULT,NORM_IGNORECASE,s1,-1,s2,-1)-2;
|
||||
end;
|
||||
|
||||
|
||||
function Win32AnsiStrLComp(S1, S2: PChar; MaxLen: PtrUInt): PtrInt;
|
||||
begin
|
||||
result:=CompareString(LOCALE_USER_DEFAULT,0,s1,maxlen,s2,maxlen)-2;
|
||||
end;
|
||||
|
||||
|
||||
function Win32AnsiStrLIComp(S1, S2: PChar; MaxLen: PtrUInt): PtrInt;
|
||||
begin
|
||||
result:=CompareString(LOCALE_USER_DEFAULT,NORM_IGNORECASE,s1,maxlen,s2,maxlen)-2;
|
||||
end;
|
||||
|
||||
|
||||
function Win32AnsiStrLower(Str: PChar): PChar;
|
||||
begin
|
||||
CharLower(str);
|
||||
result:=str;
|
||||
end;
|
||||
|
||||
|
||||
function Win32AnsiStrUpper(Str: PChar): PChar;
|
||||
begin
|
||||
CharUpper(str);
|
||||
result:=str;
|
||||
end;
|
||||
|
||||
|
||||
{ there is a similiar procedure in the system unit which inits the fields which
|
||||
are relevant already for the system unit }
|
||||
procedure InitWin32Widestrings;
|
||||
@ -1051,7 +1129,11 @@ Finalization
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.44 2005-03-10 19:12:28 florian
|
||||
Revision 1.45 2005-03-12 14:56:22 florian
|
||||
+ added Ansi* routines to widestring manager
|
||||
* made them using OS calls on windows
|
||||
|
||||
Revision 1.44 2005/03/10 19:12:28 florian
|
||||
* applied fix from Vincent to fix make cyle crash on P4 with WinXP SP2
|
||||
|
||||
Revision 1.43 2005/03/02 21:10:08 florian
|
||||
|
Loading…
Reference in New Issue
Block a user