Remove some now-dead methods. Use getFileStatus instead.
authorChris Lattner <sabre@nondot.org>
Tue, 1 Aug 2006 18:16:02 +0000 (18:16 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 1 Aug 2006 18:16:02 +0000 (18:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29447 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/System/Path.h
lib/System/Unix/Path.inc
lib/System/Win32/Path.inc

index c2fb2b911974c2e7db6abb9921e85fd9891b729f..ef946f12c1101e1bc4c55adf25fb9c3552376089 100644 (file)
@@ -259,28 +259,6 @@ namespace sys {
     /// @name Disk Accessors
     /// @{
     public:
-      /// This function determines if the object referenced by this path is
-      /// a file or not. This function accesses the underlying file system to
-      /// determine the type of entity referenced by the path.
-      /// @returns true if this path name references a file.
-      /// @brief Determines if the path name references a file.
-      bool isFile() const;
-
-      /// This function determines if the object referenced by this path is a
-      /// directory or not. This function accesses the underlying file system to
-      /// determine the type of entity referenced by the path.
-      /// @returns true if the path name references a directory
-      /// @brief Determines if the path name references a directory.
-      bool isDirectory() const;
-
-      /// This function determines if the path refers to a hidden file. The
-      /// notion of hidden files is defined by  the underlying system. The
-      /// system may not support hidden files in which case this function always
-      /// returns false on such systems. Hidden files have the "hidden"
-      /// attribute set on Win32. On Unix, hidden files start with a period.
-      /// @brief Determines if the path name references a hidden file.
-      bool isHidden() const;
-
       /// This function determines if the path name in this object references
       /// the root (top level directory) of the file system. The details of what
       /// is considered the "root" may vary from system to system so this method
index 41349d940e2da340e9ce7483b9b88b157939b5d5..83885c31b0da53e8db4890cfdc607e4f0695b438 100644 (file)
@@ -236,38 +236,6 @@ Path::GetUserHomeDirectory() {
   return GetRootDirectory();
 }
 
-bool
-Path::isFile() const {
-  if (!exists())
-    return false;
-  struct stat buf;
-  if (stat(path.c_str(), &buf) != 0) {
-    ThrowErrno(path + ": can't determine type of path object: ");
-  }
-  return S_ISREG(buf.st_mode);
-}
-
-bool
-Path::isDirectory() const {
-  if (!exists())
-    return false;
-  struct stat buf;
-  if (0 != stat(path.c_str(), &buf)) {
-    ThrowErrno(path + ": can't determine type of path object: ");
-  }
-  return S_ISDIR(buf.st_mode);
-}
-
-bool
-Path::isHidden() const {
-  if (!exists())
-    return false;
-  size_t slash = path.rfind('/');
-  return (slash != std::string::npos && 
-          slash < path.length()-1 && 
-          path[slash+1] == '.') || 
-         (!path.empty() && slash == std::string::npos && path[0] == '.');
-}
 
 std::string
 Path::getBasename() const {
@@ -432,8 +400,6 @@ void Path::makeExecutableOnDisk() {
 
 bool
 Path::getDirectoryContents(std::set<Path>& result) const {
-  if (!isDirectory())
-    return false;
   DIR* direntries = ::opendir(path.c_str());
   if (direntries == 0)
     ThrowErrno(path + ": can't open directory");
index 73432ba69e447793ef2fb780951bd4949d849f35..8bc39f498db6a8fcb2745804b0f3a1b9dd340883 100644 (file)
@@ -216,39 +216,6 @@ Path::GetUserHomeDirectory() {
 }
 // FIXME: the above set of functions don't map to Windows very well.
 
-bool
-Path::isFile() const {
-  WIN32_FILE_ATTRIBUTE_DATA fi;
-  BOOL rc = GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &fi);
-  if (rc)
-    return !(fi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
-  else if (GetLastError() != ERROR_FILE_NOT_FOUND) {
-    ThrowError("isFile(): " + std::string(path) + ": Can't get status: ");
-  }
-  return false;
-}
-
-bool
-Path::isDirectory() const {
-  WIN32_FILE_ATTRIBUTE_DATA fi;
-  BOOL rc = GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &fi);
-  if (rc)
-    return fi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
-  else if (GetLastError() != ERROR_FILE_NOT_FOUND)
-    ThrowError("isDirectory(): " + std::string(path) + ": Can't get status: ");
-  return false;
-}
-
-bool
-Path::isHidden() const {
-  WIN32_FILE_ATTRIBUTE_DATA fi;
-  BOOL rc = GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &fi);
-  if (rc)
-    return fi.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN;
-  else if (GetLastError() != ERROR_FILE_NOT_FOUND)
-    ThrowError("isHidden(): " + std::string(path) + ": Can't get status: ");
-  return false;
-}
 
 bool
 Path::isRootDirectory() const {