aboutsummaryrefslogtreecommitdiff
path: root/include/lldb/Host/File.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/lldb/Host/File.h')
-rw-r--r--include/lldb/Host/File.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/include/lldb/Host/File.h b/include/lldb/Host/File.h
index 814d96059f37..2738679b5e03 100644
--- a/include/lldb/Host/File.h
+++ b/include/lldb/Host/File.h
@@ -16,6 +16,7 @@
#include <sys/types.h>
#include "lldb/lldb-private.h"
+#include "lldb/Host/IOObject.h"
namespace lldb_private {
@@ -26,7 +27,7 @@ namespace lldb_private {
/// A file class that divides abstracts the LLDB core from host file
/// functionality.
//----------------------------------------------------------------------
-class File
+class File : public IOObject
{
public:
static int kInvalidDescriptor;
@@ -48,22 +49,22 @@ public:
ConvertOpenOptionsForPOSIXOpen (uint32_t open_options);
File() :
+ IOObject(eFDTypeFile, false),
m_descriptor (kInvalidDescriptor),
m_stream (kInvalidStream),
m_options (0),
m_own_stream (false),
- m_own_descriptor (false),
m_is_interactive (eLazyBoolCalculate),
m_is_real_terminal (eLazyBoolCalculate)
{
}
File (FILE *fh, bool transfer_ownership) :
+ IOObject(eFDTypeFile, false),
m_descriptor (kInvalidDescriptor),
m_stream (fh),
m_options (0),
m_own_stream (transfer_ownership),
- m_own_descriptor (false),
m_is_interactive (eLazyBoolCalculate),
m_is_real_terminal (eLazyBoolCalculate)
{
@@ -118,11 +119,11 @@ public:
uint32_t permissions = lldb::eFilePermissionsFileDefault);
File (int fd, bool transfer_ownership) :
+ IOObject(eFDTypeFile, transfer_ownership),
m_descriptor (fd),
m_stream (kInvalidStream),
m_options (0),
- m_own_stream (false),
- m_own_descriptor (transfer_ownership)
+ m_own_stream (false)
{
}
@@ -222,6 +223,10 @@ public:
int
GetDescriptor() const;
+ WaitableHandle
+ GetWaitableHandle();
+
+
void
SetDescriptor(int fd, bool transfer_ownership);
@@ -331,7 +336,7 @@ public:
///
/// @param[in/out] offset
/// The offset to seek to within the file relative to the
- /// end of the file which gets filled in the the resulting
+ /// end of the file which gets filled in with the resulting
/// absolute file offset.
///
/// @param[in] error_ptr
@@ -482,7 +487,7 @@ public:
///
/// Just knowing a file is a interactive isn't enough, we also need
/// to know if the terminal has a width and height so we can do
- /// cursor movement and other terminal maninpulations by sending
+ /// cursor movement and other terminal manipulations by sending
/// escape sequences.
///
/// @return
@@ -541,7 +546,6 @@ protected:
FILE *m_stream;
uint32_t m_options;
bool m_own_stream;
- bool m_own_descriptor;
LazyBool m_is_interactive;
LazyBool m_is_real_terminal;
};