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/FileAction.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/FileAction.cpp')
-rw-r--r-- | lldb/source/Target/FileAction.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/lldb/source/Target/FileAction.cpp b/lldb/source/Target/FileAction.cpp index 5756147eea4..18b039998bc 100644 --- a/lldb/source/Target/FileAction.cpp +++ b/lldb/source/Target/FileAction.cpp @@ -21,9 +21,16 @@ using namespace lldb_private; // FileAction member functions //---------------------------------------------------------------------------- -FileAction::FileAction() : m_action(eFileActionNone), m_fd(-1), m_arg(-1), m_path() {} +FileAction::FileAction() + : m_action(eFileActionNone) + , m_fd(-1) + , m_arg(-1) + , m_path() +{ +} -void FileAction::Clear() +void +FileAction::Clear() { m_action = eFileActionNone; m_fd = -1; @@ -31,14 +38,16 @@ void FileAction::Clear() m_path.clear(); } -const char *FileAction::GetPath() const +const char * +FileAction::GetPath() const { if (m_path.empty()) return NULL; return m_path.c_str(); } -bool FileAction::Open(int fd, const char *path, bool read, bool write) +bool +FileAction::Open(int fd, const char *path, bool read, bool write) { if ((read || write) && fd >= 0 && path && path[0]) { @@ -60,7 +69,8 @@ bool FileAction::Open(int fd, const char *path, bool read, bool write) return false; } -bool FileAction::Close(int fd) +bool +FileAction::Close(int fd) { Clear(); if (fd >= 0) @@ -71,7 +81,8 @@ bool FileAction::Close(int fd) return m_fd >= 0; } -bool FileAction::Duplicate(int fd, int dup_fd) +bool +FileAction::Duplicate(int fd, int dup_fd) { Clear(); if (fd >= 0 && dup_fd >= 0) |