For PR495:
Change interface to Path class:
readable -> canRead
writable -> canWrite
executable -> canExecute

More (incremental) changes coming to close 495.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22345 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/System/Path.cpp b/lib/System/Path.cpp
index 34cbd6d..d2566fd0 100644
--- a/lib/System/Path.cpp
+++ b/lib/System/Path.cpp
@@ -62,14 +62,14 @@
 
 bool
 Path::isArchive() const {
-  if (readable())
+  if (canRead())
     return hasMagicNumber("!<arch>\012");
   return false;
 }
 
 bool
 Path::isDynamicLibrary() const {
-  if (readable())
+  if (canRead())
     return hasMagicNumber("\177ELF");
   return false;
 }
diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc
index b371d00..f871adb 100644
--- a/lib/System/Unix/Path.inc
+++ b/lib/System/Unix/Path.inc
@@ -168,14 +168,14 @@
   while( delim != 0 ) {
     std::string tmp(at, size_t(delim-at));
     if (tmpPath.setDirectory(tmp))
-      if (tmpPath.readable())
+      if (tmpPath.canRead())
         Paths.push_back(tmpPath);
     at = delim + 1;
     delim = strchr(at, ':');
   }
   if (*at != 0)
     if (tmpPath.setDirectory(std::string(at)))
-      if (tmpPath.readable())
+      if (tmpPath.canRead())
         Paths.push_back(tmpPath);
 
 }
@@ -205,7 +205,7 @@
   {
     Path tmpPath;
     if (tmpPath.setDirectory(LLVM_LIBDIR))
-      if (tmpPath.readable())
+      if (tmpPath.canRead())
         Paths.push_back(tmpPath);
   }
 #endif
@@ -305,17 +305,17 @@
 }
 
 bool
-Path::readable() const {
+Path::canRead() const {
   return 0 == access(path.c_str(), F_OK | R_OK );
 }
 
 bool
-Path::writable() const {
+Path::canWrite() const {
   return 0 == access(path.c_str(), F_OK | W_OK );
 }
 
 bool
-Path::executable() const {
+Path::canExecute() const {
   struct stat st;
   int r = stat(path.c_str(), &st);
   if (r != 0 || !S_ISREG(st.st_mode))
diff --git a/lib/System/Unix/Program.inc b/lib/System/Unix/Program.inc
index de5ae7f..774bd02 100644
--- a/lib/System/Unix/Program.inc
+++ b/lib/System/Unix/Program.inc
@@ -46,7 +46,7 @@
     return Path();
   // FIXME: have to check for absolute filename - we cannot assume anything
   // about "." being in $PATH
-  if (temp.executable()) // already executable as is
+  if (temp.canExecute()) // already executable as is
     return temp;
 
   // At this point, the file name is valid and its not executable
@@ -66,7 +66,7 @@
     Path FilePath;
     if (FilePath.setDirectory(std::string(PathStr,Colon))) {
       FilePath.appendFile(progName);
-      if (FilePath.executable())
+      if (FilePath.canExecute())
         return FilePath;                    // Found the executable!
     }
 
@@ -109,7 +109,7 @@
                         const Path** redirects,
                         unsigned secondsToWait
 ) {
-  if (!path.executable())
+  if (!path.canExecute())
     throw path.toString() + " is not executable"; 
 
 #ifdef HAVE_SYS_WAIT_H
diff --git a/lib/System/Win32/Path.inc b/lib/System/Win32/Path.inc
index d3c8591..b9132da 100644
--- a/lib/System/Win32/Path.inc
+++ b/lib/System/Win32/Path.inc
@@ -139,14 +139,14 @@
   while( delim != 0 ) {
     std::string tmp(at, size_t(delim-at));
     if (tmpPath.setDirectory(tmp))
-      if (tmpPath.readable())
+      if (tmpPath.canRead())
         Paths.push_back(tmpPath);
     at = delim + 1;
     delim = strchr(at, ';');
   }
   if (*at != 0)
     if (tmpPath.setDirectory(std::string(at)))
-      if (tmpPath.readable())
+      if (tmpPath.canRead())
         Paths.push_back(tmpPath);
 
 }
@@ -167,7 +167,7 @@
   {
     Path tmpPath;
     if (tmpPath.setDirectory(LLVM_LIBDIR))
-      if (tmpPath.readable())
+      if (tmpPath.canRead())
         Paths.push_back(tmpPath);
   }
 #endif
@@ -237,21 +237,21 @@
 }
 
 bool
-Path::readable() const {
+Path::canRead() const {
   // FIXME: take security attributes into account.
   DWORD attr = GetFileAttributes(path.c_str());
   return attr != INVALID_FILE_ATTRIBUTES;
 }
 
 bool
-Path::writable() const {
+Path::canWrite() const {
   // FIXME: take security attributes into account.
   DWORD attr = GetFileAttributes(path.c_str());
   return (attr != INVALID_FILE_ATTRIBUTES) && !(attr & FILE_ATTRIBUTE_READONLY);
 }
 
 bool
-Path::executable() const {
+Path::canExecute() const {
   // FIXME: take security attributes into account.
   DWORD attr = GetFileAttributes(path.c_str());
   return attr != INVALID_FILE_ATTRIBUTES;