diff options
Diffstat (limited to 'src/corelib/gdi')
-rw-r--r-- | src/corelib/gdi/gfx_gdi.pas | 18 | ||||
-rw-r--r-- | src/corelib/gdi/gfx_utils_impl.inc | 33 |
2 files changed, 36 insertions, 15 deletions
diff --git a/src/corelib/gdi/gfx_gdi.pas b/src/corelib/gdi/gfx_gdi.pas index b198fa24..41505413 100644 --- a/src/corelib/gdi/gfx_gdi.pas +++ b/src/corelib/gdi/gfx_gdi.pas @@ -210,8 +210,7 @@ type { TfpgFileListImpl } TfpgFileListImpl = class(TfpgFileListBase) - function InitializeEntry(sr: TSearchRec): TFileEntry; override; - function UpdateDirectory(const aDirectory: TfpgString): TfpgString; override; + procedure PopulateSpecialDirs(const aDirectory: TfpgString); override; end; implementation @@ -1999,18 +1998,7 @@ end; { TfpgFileListImpl } -function TfpgFileListImpl.InitializeEntry(sr: TSearchRec): TFileEntry; -begin - Result := inherited InitializeEntry(sr); - if Assigned(Result) then - begin - Result.Name := UTF8Encode(Result.Name); - Result.Extention := UTF8Encode(Result.Extention); - end; -end; - -function TfpgFileListImpl.UpdateDirectory(const aDirectory: TfpgString - ): TfpgString; +procedure TfpgFileListImpl.PopulateSpecialDirs(const aDirectory: TfpgString); var n: integer; drvs: string; @@ -2035,7 +2023,7 @@ begin end; end; - Result := inherited UpdateDirectory(aDirectory); + inherited PopulateSpecialDirs(aDirectory); end; initialization diff --git a/src/corelib/gdi/gfx_utils_impl.inc b/src/corelib/gdi/gfx_utils_impl.inc index f9ee80b3..2597d977 100644 --- a/src/corelib/gdi/gfx_utils_impl.inc +++ b/src/corelib/gdi/gfx_utils_impl.inc @@ -2,5 +2,38 @@ // GDI specific implementations of RTL wrapper functions +function fpgFindFirst(const Path: TfpgString; Attr: Longint; out + Rslt: TSearchRec): Longint; +begin + Result := FindFirst(Utf8ToAnsi(Path), Attr, Rslt); + Rslt.Name := AnsiToUtf8(Rslt.Name); +end; + +function fpgFindNext(var Rslt: TSearchRec): Longint; +begin + Result := FindNext(Rslt); + Rslt.Name := AnsiToUtf8(Rslt.Name); +end; + +function fpgGetCurrentDir: TfpgString; +begin + Result := AnsiToUtf8(GetCurrentDir); +end; + +function fpgSetCurrentDir(const NewDir: TfpgString): Boolean; +begin + Result := SetCurrentDir(Utf8ToAnsi(NewDir)); +end; + +function fpgExpandFileName(const FileName: TfpgString): TfpgString; +begin + Result := AnsiToUtf8(ExpandFileName(Utf8ToAnsi(FileName))); +end; + +function fpgFileExists(const FileName: TfpgString): Boolean; +begin + Result := FileExists(Utf8ToAnsi(FileName)); +end; + |