mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 03:29:33 +02:00
* SetString(WideString,[PChar|PWideChar],Len) added
This commit is contained in:
parent
8bb7e03d19
commit
438fbdedee
@ -476,6 +476,8 @@ Function Pos (c : Char; Const s : WideString) : Longint;
|
|||||||
Function Pos (c : WideChar; Const s : WideString) : Longint;
|
Function Pos (c : WideChar; Const s : WideString) : Longint;
|
||||||
Procedure Insert (Const Source : WideString; Var S : WideString; Index : Longint);
|
Procedure Insert (Const Source : WideString; Var S : WideString; Index : Longint);
|
||||||
Procedure Delete (Var S : WideString; Index,Size: Longint);
|
Procedure Delete (Var S : WideString; Index,Size: Longint);
|
||||||
|
Procedure SetString (Var S : WideString; Buf : PWideChar; Len : Longint);
|
||||||
|
Procedure SetString (Var S : WideString; Buf : PChar; Len : Longint);
|
||||||
|
|
||||||
function WideCharToString(S : PWideChar) : AnsiString;
|
function WideCharToString(S : PWideChar) : AnsiString;
|
||||||
function StringToWideChar(const Src : AnsiString;Dest : PWideChar;DestSize : LongInt) : PWideChar;
|
function StringToWideChar(const Src : AnsiString;Dest : PWideChar;DestSize : LongInt) : PWideChar;
|
||||||
@ -654,7 +656,10 @@ const
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.60 2002-11-16 20:12:22 florian
|
Revision 1.61 2002-12-15 22:33:12 peter
|
||||||
|
* SetString(WideString,[PChar|PWideChar],Len) added
|
||||||
|
|
||||||
|
Revision 1.60 2002/11/16 20:12:22 florian
|
||||||
+ sparc types added
|
+ sparc types added
|
||||||
+ UTF*/UCS* types added
|
+ UTF*/UCS* types added
|
||||||
|
|
||||||
|
@ -823,12 +823,37 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{!!!:Procedure SetString (Var S : WideString; Buf : PWideChar; Len : Longint);
|
Procedure SetString (Var S : WideString; Buf : PWideChar; Len : Longint);
|
||||||
|
var
|
||||||
|
BufLen: longint;
|
||||||
begin
|
begin
|
||||||
SetLength(S,Len);
|
SetLength(S,Len);
|
||||||
Move (Buf[0],S[1],Len*2);
|
If (Buf<>Nil) and (Len>0) then
|
||||||
end;}
|
begin
|
||||||
|
BufLen := IndexWord(Buf^, Len+1, 0);
|
||||||
|
If (BufLen>0) and (BufLen < Len) then
|
||||||
|
Len := BufLen;
|
||||||
|
Move (Buf[0],S[1],Len*sizeof(WideChar));
|
||||||
|
PWideChar(Pointer(S)+Len*sizeof(WideChar))^:=#0;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Procedure SetString (Var S : WideString; Buf : PChar; Len : Longint);
|
||||||
|
var
|
||||||
|
BufLen: longint;
|
||||||
|
begin
|
||||||
|
SetLength(S,Len);
|
||||||
|
If (Buf<>Nil) and (Len>0) then
|
||||||
|
begin
|
||||||
|
BufLen := IndexByte(Buf^, Len+1, 0);
|
||||||
|
If (BufLen>0) and (BufLen < Len) then
|
||||||
|
Len := BufLen;
|
||||||
|
Ansi2WideMoveProc(Buf,PWideChar(S),Len);
|
||||||
|
PWideChar(Pointer(S)+Len*sizeof(WideChar))^:=#0;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function fpc_Val_Real_WideStr(Const S : WideString; Var Code : ValSInt): ValReal; [public, alias:'FPC_VAL_REAL_WIDESTR']; {$ifdef hascompilerproc} compilerproc; {$endif}
|
Function fpc_Val_Real_WideStr(Const S : WideString; Var Code : ValSInt): ValReal; [public, alias:'FPC_VAL_REAL_WIDESTR']; {$ifdef hascompilerproc} compilerproc; {$endif}
|
||||||
Var
|
Var
|
||||||
@ -935,7 +960,10 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.26 2002-12-14 19:16:45 sg
|
Revision 1.27 2002-12-15 22:33:12 peter
|
||||||
|
* SetString(WideString,[PChar|PWideChar],Len) added
|
||||||
|
|
||||||
|
Revision 1.26 2002/12/14 19:16:45 sg
|
||||||
* Ported improvements from the AnsiString equivalents to NewWideString and
|
* Ported improvements from the AnsiString equivalents to NewWideString and
|
||||||
fpc_WideStr_SetLength
|
fpc_WideStr_SetLength
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user