summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common/FileSystem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Host/common/FileSystem.cpp')
-rw-r--r--lldb/source/Host/common/FileSystem.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lldb/source/Host/common/FileSystem.cpp b/lldb/source/Host/common/FileSystem.cpp
index 8b8b896f797..a9ed5bd1847 100644
--- a/lldb/source/Host/common/FileSystem.cpp
+++ b/lldb/source/Host/common/FileSystem.cpp
@@ -124,6 +124,17 @@ bool FileSystem::Readable(const FileSpec &file_spec) const {
return Readable(file_spec.GetPath());
}
+bool FileSystem::IsDirectory(const Twine &path) const {
+ ErrorOr<vfs::Status> status = m_fs->status(path);
+ if (!status)
+ return false;
+ return status->isDirectory();
+}
+
+bool FileSystem::IsDirectory(const FileSpec &file_spec) const {
+ return IsDirectory(file_spec.GetPath());
+}
+
void FileSystem::EnumerateDirectory(Twine path, bool find_directories,
bool find_files, bool find_other,
EnumerateDirectoryCallbackType callback,
OpenPOWER on IntegriCloud