Core: FindFile::IsExecutable

git-svn-id: svn://ultimatepp.org/upp/trunk@2200 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2010-03-09 08:16:55 +00:00
parent dc00b266e2
commit 449208fcc9
2 changed files with 12 additions and 0 deletions

View file

@ -449,6 +449,11 @@ bool FindFile::IsSymLink() const
return sGetSymLinkPath0(AppendFileName(path, name), NULL);
}
bool FindFile::IsExecutable() const
{
return !IsDirectory() && ToLower(GetName()).EndsWith(".exe"); }
}
void FindFile::Close() {
if(handle != INVALID_HANDLE_VALUE) FindClose(handle);
handle = INVALID_HANDLE_VALUE;
@ -654,6 +659,11 @@ bool FindFile::IsSymLink() const
return false;
}
bool FindFile::IsExecutable() const
{
return !IsDirectory() && ((S_IXUSR|S_IXGRP|S_IXOTH) & GetMode());
}
bool FindFile::Next() {
if(!dir) return false;
statis = false;

View file

@ -76,6 +76,7 @@ public:
bool IsFolder() const;
bool IsFile() const { return !IsDirectory(); }
bool IsSymLink() const;
bool IsExecutable() const;
bool IsArchive() const;
bool IsCompressed() const;
@ -137,6 +138,7 @@ public:
bool IsFolder() const;
bool IsFile() const { return S_ISREG(GetMode()); }
bool IsSymLink() const;
bool IsExecutable() const;
operator bool() const { return file; }