diff options
author | emaste <emaste@FreeBSD.org> | 2015-07-03 16:57:06 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2015-07-03 16:57:06 +0000 |
commit | 8037fa4ee916fa20b3c63cbf531f4ee7e1c76138 (patch) | |
tree | 3c2e41c3be19b7fc7666ed45a5f91ec3b6e35f2a /source/Target/FileAction.cpp | |
parent | d61b076ede88b56f3372a55e7d1eac6a9d717120 (diff) | |
download | FreeBSD-src-8037fa4ee916fa20b3c63cbf531f4ee7e1c76138.zip FreeBSD-src-8037fa4ee916fa20b3c63cbf531f4ee7e1c76138.tar.gz |
Import LLDB as of upstream SVN 241361 (git 612c075f)
Diffstat (limited to 'source/Target/FileAction.cpp')
-rw-r--r-- | source/Target/FileAction.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/source/Target/FileAction.cpp b/source/Target/FileAction.cpp index 8611ff5..21c37e8 100644 --- a/source/Target/FileAction.cpp +++ b/source/Target/FileAction.cpp @@ -26,7 +26,7 @@ FileAction::FileAction() : m_action(eFileActionNone), m_fd(-1), m_arg(-1), - m_path() + m_file_spec() { } @@ -36,21 +36,25 @@ FileAction::Clear() m_action = eFileActionNone; m_fd = -1; m_arg = -1; - m_path.clear(); + m_file_spec.Clear(); } const char * FileAction::GetPath() const { - if (m_path.empty()) - return NULL; - return m_path.c_str(); + return m_file_spec.GetCString(); +} + +const FileSpec & +FileAction::GetFileSpec() const +{ + return m_file_spec; } bool -FileAction::Open(int fd, const char *path, bool read, bool write) +FileAction::Open(int fd, const FileSpec &file_spec, bool read, bool write) { - if ((read || write) && fd >= 0 && path && path[0]) + if ((read || write) && fd >= 0 && file_spec) { m_action = eFileActionOpen; m_fd = fd; @@ -60,7 +64,7 @@ FileAction::Open(int fd, const char *path, bool read, bool write) m_arg = O_NOCTTY | O_RDONLY; else m_arg = O_NOCTTY | O_CREAT | O_WRONLY; - m_path.assign(path); + m_file_spec = file_spec; return true; } else @@ -111,7 +115,8 @@ FileAction::Dump(Stream &stream) const stream.PutCString("no action"); break; case eFileActionOpen: - stream.Printf("open fd %d with '%s', OFLAGS = 0x%x", m_fd, m_path.c_str(), m_arg); + stream.Printf("open fd %d with '%s', OFLAGS = 0x%x", + m_fd, m_file_spec.GetCString(), m_arg); break; } } |