summaryrefslogtreecommitdiff
path: root/lib/System/Win32
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-12-18 19:46:22 +0000
committerTed Kremenek <kremenek@apple.com>2007-12-18 19:46:22 +0000
commitfd52711675cb581e7672f131046e355a2b5ba167 (patch)
tree109d63b4c000db4e87f7bbdf5c6fe84d52e8de73 /lib/System/Win32
parent636e5a216c8dab7567b5e5d8d1c7d982f507f7eb (diff)
downloadllvm-fd52711675cb581e7672f131046e355a2b5ba167.tar.gz
llvm-fd52711675cb581e7672f131046e355a2b5ba167.tar.bz2
llvm-fd52711675cb581e7672f131046e355a2b5ba167.tar.xz
Added "isDirectory" method to llvm::sys::Path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45168 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/Win32')
-rw-r--r--lib/System/Win32/Path.inc7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/System/Win32/Path.inc b/lib/System/Win32/Path.inc
index 994bc671c1..2484b8a744 100644
--- a/lib/System/Win32/Path.inc
+++ b/lib/System/Win32/Path.inc
@@ -254,6 +254,13 @@ Path::exists() const {
}
bool
+Path::isDirectory() const {
+ DWORD attr = GetFileAttributes(path.c_str());
+ return (attr != INVALID_FILE_ATTRIBUTES) &&
+ (attr & FILE_ATTRIBUTE_DIRECTORY);
+}
+
+bool
Path::canRead() const {
// FIXME: take security attributes into account.
DWORD attr = GetFileAttributes(path.c_str());