mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 14:59:30 +02:00
LazFileUtils: inline FileAgeUTF8 to LazFileUtils.FileAgeUTF8
git-svn-id: trunk@41288 -
This commit is contained in:
parent
486d00d68c
commit
d1e6e77a05
@ -59,6 +59,11 @@ begin
|
||||
Result := LazFileUtils.DirectoryExistsUTF8(Directory);
|
||||
end;
|
||||
|
||||
function FileAgeUTF8(const FileName: string): Longint;
|
||||
begin
|
||||
Result := LazFileUtils.FileAgeUTF8(FileName);
|
||||
end;
|
||||
|
||||
{$IFDEF darwin}
|
||||
function GetDarwinSystemFilename(Filename: string): string;
|
||||
var
|
||||
|
@ -214,7 +214,7 @@ function UTF8ToConsole(const s: string): string;// converts UTF8 string to conso
|
||||
|
||||
// file operations
|
||||
function FileExistsUTF8(const Filename: string): boolean; inline;
|
||||
function FileAgeUTF8(const FileName: string): Longint;
|
||||
function FileAgeUTF8(const FileName: string): Longint; inline;
|
||||
function DirectoryExistsUTF8(const Directory: string): Boolean; inline;
|
||||
function ExpandFileNameUTF8(const FileName: string): string; inline;
|
||||
function ExpandUNCFileNameUTF8(const FileName: string): string;
|
||||
|
@ -122,13 +122,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
FileAgeUTF8
|
||||
------------------------------------------------------------------------------}
|
||||
function FileAgeUTF8(const FileName: String): Longint;
|
||||
begin
|
||||
Result:=SysUtils.FileAge(UTF8ToSys(Filename));
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
FileSize
|
||||
|
@ -173,9 +173,6 @@ begin
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
{-------------------------------------------------------------------------------
|
||||
function FileAgeUTF8(const FileName: String): Longint;
|
||||
-------------------------------------------------------------------------------}
|
||||
|
||||
function WinToDosTime (Var Wtime : TFileTime;var DTime:longint):longbool;
|
||||
var
|
||||
@ -199,29 +196,6 @@ begin
|
||||
LocalFileTimeToFileTime(lft,Wintime); ;
|
||||
end;
|
||||
|
||||
{$ifndef WinCE}
|
||||
function FileAgeAnsi(const FileName: String): Longint;
|
||||
begin
|
||||
Result:=SysUtils.FileAge(UTF8ToSys(Filename));
|
||||
end;
|
||||
{$endif}
|
||||
|
||||
function FileAgeWide(const FileName: String): Longint;
|
||||
var
|
||||
Hnd: THandle;
|
||||
FindData: TWin32FindDataW;
|
||||
begin
|
||||
Hnd := FindFirstFileW(PWideChar(UTF8ToUTF16(FileName)), FindData);
|
||||
if Hnd <> INVALID_HANDLE_VALUE then
|
||||
begin
|
||||
Windows.FindClose(Hnd);
|
||||
if (FindData.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY) = 0 then
|
||||
If WinToDosTime(FindData.ftLastWriteTime,Result) then
|
||||
exit;
|
||||
end;
|
||||
Result := -1;
|
||||
end;
|
||||
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
FileSize
|
||||
@ -545,7 +519,6 @@ begin
|
||||
end;
|
||||
|
||||
var
|
||||
FileAge_ : function (const Filename:string):Longint = @FileAgeWide;
|
||||
FileSize_ : function (const Filename: string): int64 = @FileSizeWide;
|
||||
FileSetDate_ : function (const FileName: String; Age: Longint): Longint = @FileSetDateWide;
|
||||
FindFirst_ : function (const Path: string; Attr: Longint;
|
||||
@ -560,10 +533,7 @@ var
|
||||
RemoveDir_ : function (const Dir: String): Boolean = @RemoveDirWide;
|
||||
|
||||
|
||||
function FileAgeUTF8(const FileName: String): Longint;
|
||||
begin
|
||||
Result:=FileAge_(FileName);
|
||||
end;
|
||||
|
||||
|
||||
function FileSize(const Filename: string): int64;
|
||||
begin
|
||||
@ -655,7 +625,6 @@ begin
|
||||
{$ifndef WinCE}
|
||||
if Win32MajorVersion <= 4 then
|
||||
begin
|
||||
FileAge_:=@FileAgeAnsi;
|
||||
FileSize_:=@FileSizeAnsi;
|
||||
FileSetDate_:=@FileSetDateAnsi;
|
||||
DeleteFile_:=@DeleteFileAnsi;
|
||||
|
Loading…
Reference in New Issue
Block a user