* moved ToSingleByteFileSystemEncodedFileName() to the system unit and

export it so it can be used in all rtl units

git-svn-id: branches/cpstrrtl@24960 -
This commit is contained in:
Jonas Maebe 2013-06-24 09:40:00 +00:00
parent e6c812a60a
commit 3694b4f003
3 changed files with 16 additions and 12 deletions

View File

@ -145,3 +145,6 @@ Procedure SetUnicodeStringManager (Const New : TUnicodeStringManager; Var Old: T
function StringElementSize(const S : UnicodeString): Word; overload;
function StringRefCount(const S : UnicodeString): SizeInt; overload;
function StringCodePage(const S : UnicodeString): TSystemCodePage; overload;
Function ToSingleByteFileSystemEncodedFileName(const Str: UnicodeString): RawByteString;
Function ToSingleByteFileSystemEncodedFileName(const Str: RawByteString): RawByteString;

View File

@ -2281,3 +2281,16 @@ procedure initunicodestringmanager;
end;
{$endif FPC_HAS_BUILTIN_WIDESTR_MANAGER}
Function ToSingleByteFileSystemEncodedFileName(const Str: UnicodeString): RawByteString;
Begin
widestringmanager.Unicode2AnsiMoveProc(punicodechar(Str),Result,
DefaultFileSystemCodePage,Length(Str));
End;
Function ToSingleByteFileSystemEncodedFileName(const Str: RawByteString): RawByteString;
Begin
Result:=Str;
SetCodePage(Result,DefaultFileSystemCodePage,True);
End;

View File

@ -13,18 +13,6 @@
**********************************************************************}
Function ToSingleByteFileSystemEncodedFileName(const Str: UnicodeString): RawByteString;
Begin
widestringmanager.Unicode2AnsiMoveProc(punicodechar(Str),Result,
DefaultFileSystemCodePage,Length(Str));
End;
Function ToSingleByteFileSystemEncodedFileName(const Str: RawByteString): RawByteString;
Begin
Result:=Str;
SetCodePage(Result,DefaultFileSystemCodePage,True);
End;
{$ifndef SYSUTILS_HAS_UNICODESTR_FILEUTIL_IMPL}