Browse Source

* moved ToSingleByteFileSystemEncodedFileName() to the system unit and
export it so it can be used in all rtl units

git-svn-id: branches/cpstrrtl@24960 -

Jonas Maebe 12 years ago
parent
commit
3694b4f003
3 changed files with 16 additions and 12 deletions
  1. 3 0
      rtl/inc/ustringh.inc
  2. 13 0
      rtl/inc/ustrings.inc
  3. 0 12
      rtl/objpas/sysutils/filutil.inc

+ 3 - 0
rtl/inc/ustringh.inc

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

+ 13 - 0
rtl/inc/ustrings.inc

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

+ 0 - 12
rtl/objpas/sysutils/filutil.inc

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