rtl: add SetTextCodePage, GetTextCodePage functions which set/get TTextRec.CodePage field

git-svn-id: trunk@19541 -
This commit is contained in:
paul 2011-10-25 02:16:34 +00:00
parent e46e2c3ebd
commit 2254dad68a
2 changed files with 18 additions and 0 deletions

View File

@ -997,6 +997,8 @@ Function SeekEOF:Boolean;
Procedure SetTextBuf(var f:Text; var Buf);[INTERNPROC:fpc_in_settextbuf_file_x];
Procedure SetTextBuf(var f:Text; var Buf; Size:SizeInt);
Procedure SetTextLineEnding(var f:Text; Ending:string);
function GetTextCodePage(var T: Text): TSystemCodePage;
procedure SetTextCodePage(var T: Text; CodePage: TSystemCodePage);
{$endif FPC_HAS_FEATURE_TEXTIO}
{****************************************************************************

View File

@ -441,6 +441,22 @@ Begin
TextRec(F).LineEnd:=Ending;
End;
function GetTextCodePage(var T: Text): TSystemCodePage;
begin
{$ifndef ver2_4}
GetTextCodePage:=TextRec(T).CodePage;
{$else}
GetTextCodePage:=0;
{$endif ver2_4}
end;
procedure SetTextCodePage(var T: Text; CodePage: TSystemCodePage);
begin
{$ifndef ver2_4}
TextRec(T).CodePage:=CodePage;
{$endif ver2_4}
end;
Function fpc_get_input:PText;compilerproc;
begin