소스 검색

Add TPath.Exists for Delphi compatibility

Bi0T1N 1 개월 전
부모
커밋
305c7734dd
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      packages/vcl-compat/src/system.ioutils.pp

+ 6 - 0
packages/vcl-compat/src/system.ioutils.pp

@@ -228,6 +228,7 @@ type
     class function GetRingtonesPath: string; static;
     class function GetSharedRingtonesPath: string; static;
     class function GetTemplatesPath: string;
+    class function Exists(const aPath: string; aFollowLink: Boolean = True): Boolean; static;
     class function GetAttributes(const aPath: string; aFollowLink: Boolean = True): TFileAttributes; static;
     class procedure SetAttributes(const aPath: string; const aAttributes: TFileAttributes); static;
     class function HasExtension(const aPath: string): Boolean; static;
@@ -1513,6 +1514,11 @@ begin
 
 end;
 
+class function TPath.Exists(const aPath: string; aFollowLink: Boolean): Boolean;
+begin
+  Result:=TDirectory.Exists(aPath, aFollowLink) and TFile.Exists(aPath, aFollowLink);
+end;
+
 class function TPath.GetAttributes(const aPath: string; aFollowLink: Boolean
   ): TFileAttributes;
 begin