+ added procedure SetString(AnsiString, PWideChar, SizeInt)

git-svn-id: trunk@17138 -
This commit is contained in:
sergei 2011-03-15 14:09:05 +00:00
parent 7f62d5cfb0
commit 0849132ee1
2 changed files with 8 additions and 0 deletions

View File

@ -1054,6 +1054,13 @@ begin
Move (Buf^,Pointer(S)^,Len);
end;
Procedure SetString (Out S : AnsiString; Buf : PWideChar; Len : SizeInt);
begin
if (Buf<>nil) and (Len>0) then
widestringmanager.Wide2AnsiMoveProc(Buf,S,Len)
else
SetLength(S, Len);
end;
function upcase(const s : ansistring) : ansistring;
var

View File

@ -819,6 +819,7 @@ Function Pos(C:Char;const s:shortstring):SizeInt;
{$ifdef FPC_HAS_FEATURE_ANSISTRINGS}
Function Pos (const Substr : ShortString; const Source : AnsiString) : SizeInt;
Procedure SetString (out S : AnsiString; Buf : PChar; Len : SizeInt);
Procedure SetString (out S : AnsiString; Buf : PWideChar; Len : SizeInt);
{$endif FPC_HAS_FEATURE_ANSISTRINGS}
Procedure SetString (out S : Shortstring; Buf : PChar; Len : SizeInt);
function ShortCompareText(const S1, S2: shortstring): SizeInt;