소스 검색

+ added procedure SetString(AnsiString, PWideChar, SizeInt)

git-svn-id: trunk@17138 -
sergei 14 년 전
부모
커밋
0849132ee1
2개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      rtl/inc/astrings.inc
  2. 1 0
      rtl/inc/systemh.inc

+ 7 - 0
rtl/inc/astrings.inc

@@ -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

+ 1 - 0
rtl/inc/systemh.inc

@@ -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;