diff options
author | Zachary Turner <zturner@google.com> | 2014-08-15 22:04:21 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2014-08-15 22:04:21 +0000 |
commit | c00cf4a0688ea62229a5d44d5f000bc62c172263 (patch) | |
tree | 3c9aad742b18c8fe789c3f96b2291d4a3cdfb92f /lldb/source/Target/Platform.cpp | |
parent | 5d62c26fa01c0ff7915fe8f8bb779ce2a8a2d8a7 (diff) | |
download | bcm5719-llvm-c00cf4a0688ea62229a5d44d5f000bc62c172263.tar.gz bcm5719-llvm-c00cf4a0688ea62229a5d44d5f000bc62c172263.zip |
Move FileSystem functions out of Host and into their own classes.
More specifically, this change can be summarized as follows:
1) Makes an lldbHostPosix library which contains code common to
all posix platforms.
2) Creates Host/FileSystem.h which defines a common FileSystem
interface.
3) Implements FileSystem.h in Host/windows and Host/posix.
4) Creates Host/FileCache.h, implemented in Host/common, which
defines a class useful for storing handles to open files needed
by the debugger.
Differential Revision: http://reviews.llvm.org/D4889
llvm-svn: 215775
Diffstat (limited to 'lldb/source/Target/Platform.cpp')
-rw-r--r-- | lldb/source/Target/Platform.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp index 7187d88bed2..82185847f3f 100644 --- a/lldb/source/Target/Platform.cpp +++ b/lldb/source/Target/Platform.cpp @@ -19,6 +19,7 @@ #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" #include "lldb/Host/FileSpec.h" +#include "lldb/Host/FileSystem.h" #include "lldb/Host/Host.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" @@ -494,8 +495,8 @@ RecurseCopy_Callback (void *baton, dst_file.GetFilename() = src.GetFilename(); char buf[PATH_MAX]; - - rc_baton->error = Host::Readlink (src.GetPath().c_str(), buf, sizeof(buf)); + + rc_baton->error = FileSystem::Readlink(src.GetPath().c_str(), buf, sizeof(buf)); if (rc_baton->error.Fail()) return FileSpec::eEnumerateDirectoryResultQuit; // got an error, bail out @@ -649,7 +650,7 @@ Platform::Install (const FileSpec& src, const FileSpec& dst) if (GetFileExists (fixed_dst)) Unlink (fixed_dst.GetPath().c_str()); char buf[PATH_MAX]; - error = Host::Readlink(src.GetPath().c_str(), buf, sizeof(buf)); + error = FileSystem::Readlink(src.GetPath().c_str(), buf, sizeof(buf)); if (error.Success()) error = CreateSymlink(dst.GetPath().c_str(), buf); } @@ -701,7 +702,7 @@ Error Platform::MakeDirectory (const char *path, uint32_t permissions) { if (IsHost()) - return Host::MakeDirectory (path, permissions); + return FileSystem::MakeDirectory(path, permissions); else { Error error; @@ -714,7 +715,7 @@ Error Platform::GetFilePermissions (const char *path, uint32_t &file_permissions) { if (IsHost()) - return Host::GetFilePermissions(path, file_permissions); + return FileSystem::GetFilePermissions(path, file_permissions); else { Error error; @@ -727,7 +728,7 @@ Error Platform::SetFilePermissions (const char *path, uint32_t file_permissions) { if (IsHost()) - return Host::SetFilePermissions(path, file_permissions); + return FileSystem::SetFilePermissions(path, file_permissions); else { Error error; @@ -1182,7 +1183,7 @@ Platform::CalculateMD5 (const FileSpec& file_spec, uint64_t &high) { if (IsHost()) - return Host::CalculateMD5(file_spec, low, high); + return FileSystem::CalculateMD5(file_spec, low, high); else return false; } |