diff options
Diffstat (limited to 'lldb/include/lldb/Host/File.h')
-rw-r--r-- | lldb/include/lldb/Host/File.h | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/lldb/include/lldb/Host/File.h b/lldb/include/lldb/Host/File.h index 90d4fa93500..eb28c4ada0e 100644 --- a/lldb/include/lldb/Host/File.h +++ b/lldb/include/lldb/Host/File.h @@ -21,13 +21,11 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class File File.h "lldb/Host/File.h" /// A file class. /// /// A file class that divides abstracts the LLDB core from host file /// functionality. -//---------------------------------------------------------------------- class File : public IOObject { public: static int kInvalidDescriptor; @@ -72,18 +70,15 @@ public: m_is_interactive(eLazyBoolCalculate), m_is_real_terminal(eLazyBoolCalculate) {} - //------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual in case this class is subclassed. - //------------------------------------------------------------------ ~File() override; bool IsValid() const override { return DescriptorIsValid() || StreamIsValid(); } - //------------------------------------------------------------------ /// Convert to pointer operator. /// /// This allows code to check a File object to see if it contains anything @@ -98,10 +93,8 @@ public: /// \return /// A pointer to this object if either the directory or filename /// is valid, nullptr otherwise. - //------------------------------------------------------------------ operator bool() const { return DescriptorIsValid() || StreamIsValid(); } - //------------------------------------------------------------------ /// Logical NOT operator. /// /// This allows code to check a File object to see if it is invalid using @@ -116,15 +109,12 @@ public: /// \return /// Returns \b true if the object has an empty directory and /// filename, \b false otherwise. - //------------------------------------------------------------------ bool operator!() const { return !DescriptorIsValid() && !StreamIsValid(); } - //------------------------------------------------------------------ /// Get the file spec for this file. /// /// \return /// A reference to the file specification object. - //------------------------------------------------------------------ Status GetFileSpec(FileSpec &file_spec) const; Status Close() override; @@ -141,7 +131,6 @@ public: void SetStream(FILE *fh, bool transfer_ownership); - //------------------------------------------------------------------ /// Read bytes from a file from the current file position. /// /// NOTE: This function is NOT thread safe. Use the read function @@ -158,10 +147,8 @@ public: /// \return /// An error object that indicates success or the reason for /// failure. - //------------------------------------------------------------------ Status Read(void *buf, size_t &num_bytes) override; - //------------------------------------------------------------------ /// Write bytes to a file at the current file position. /// /// NOTE: This function is NOT thread safe. Use the write function @@ -179,10 +166,8 @@ public: /// \return /// An error object that indicates success or the reason for /// failure. - //------------------------------------------------------------------ Status Write(const void *buf, size_t &num_bytes) override; - //------------------------------------------------------------------ /// Seek to an offset relative to the beginning of the file. /// /// NOTE: This function is NOT thread safe, other threads that @@ -201,10 +186,8 @@ public: /// /// \return /// The resulting seek offset, or -1 on error. - //------------------------------------------------------------------ off_t SeekFromStart(off_t offset, Status *error_ptr = nullptr); - //------------------------------------------------------------------ /// Seek to an offset relative to the current file position. /// /// NOTE: This function is NOT thread safe, other threads that @@ -223,10 +206,8 @@ public: /// /// \return /// The resulting seek offset, or -1 on error. - //------------------------------------------------------------------ off_t SeekFromCurrent(off_t offset, Status *error_ptr = nullptr); - //------------------------------------------------------------------ /// Seek to an offset relative to the end of the file. /// /// NOTE: This function is NOT thread safe, other threads that @@ -246,10 +227,8 @@ public: /// /// \return /// The resulting seek offset, or -1 on error. - //------------------------------------------------------------------ off_t SeekFromEnd(off_t offset, Status *error_ptr = nullptr); - //------------------------------------------------------------------ /// Read bytes from a file from the specified file offset. /// /// NOTE: This function is thread safe in that clients manager their @@ -271,10 +250,8 @@ public: /// \return /// An error object that indicates success or the reason for /// failure. - //------------------------------------------------------------------ Status Read(void *dst, size_t &num_bytes, off_t &offset); - //------------------------------------------------------------------ /// Read bytes from a file from the specified file offset. /// /// NOTE: This function is thread safe in that clients manager their @@ -302,11 +279,9 @@ public: /// \return /// An error object that indicates success or the reason for /// failure. - //------------------------------------------------------------------ Status Read(size_t &num_bytes, off_t &offset, bool null_terminate, lldb::DataBufferSP &data_buffer_sp); - //------------------------------------------------------------------ /// Write bytes to a file at the specified file offset. /// /// NOTE: This function is thread safe in that clients manager their @@ -330,46 +305,36 @@ public: /// \return /// An error object that indicates success or the reason for /// failure. - //------------------------------------------------------------------ Status Write(const void *src, size_t &num_bytes, off_t &offset); - //------------------------------------------------------------------ /// Flush the current stream /// /// \return /// An error object that indicates success or the reason for /// failure. - //------------------------------------------------------------------ Status Flush(); - //------------------------------------------------------------------ /// Sync to disk. /// /// \return /// An error object that indicates success or the reason for /// failure. - //------------------------------------------------------------------ Status Sync(); - //------------------------------------------------------------------ /// Get the permissions for a this file. /// /// \return /// Bits logical OR'ed together from the permission bits defined /// in lldb_private::File::Permissions. - //------------------------------------------------------------------ uint32_t GetPermissions(Status &error) const; - //------------------------------------------------------------------ /// Return true if this file is interactive. /// /// \return /// True if this file is a terminal (tty or pty), false /// otherwise. - //------------------------------------------------------------------ bool GetIsInteractive(); - //------------------------------------------------------------------ /// Return true if this file from a real terminal. /// /// Just knowing a file is a interactive isn't enough, we also need to know @@ -379,12 +344,10 @@ public: /// \return /// True if this file is a terminal (tty, not a pty) that has /// a non-zero width and height, false otherwise. - //------------------------------------------------------------------ bool GetIsRealTerminal(); bool GetIsTerminalWithColors(); - //------------------------------------------------------------------ /// Output printf formatted output to the stream. /// /// Print some formatted output to the stream. @@ -395,7 +358,6 @@ public: /// \param[in] ... /// Variable arguments that are needed for the printf style /// format string \a format. - //------------------------------------------------------------------ size_t Printf(const char *format, ...) __attribute__((format(printf, 2, 3))); size_t PrintfVarArg(const char *format, va_list args); @@ -411,9 +373,7 @@ protected: void CalculateInteractiveAndTerminal(); - //------------------------------------------------------------------ // Member variables - //------------------------------------------------------------------ int m_descriptor; FILE *m_stream; uint32_t m_options; |