1 //===-- StreamFile.h --------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_StreamFile_h_
11 #define liblldb_StreamFile_h_
13 #include "lldb/Host/File.h"
14 #include "lldb/Utility/Stream.h"
15 #include "lldb/lldb-defines.h"
16 #include "lldb/lldb-enumerations.h"
21 namespace lldb_private {
23 class StreamFile : public Stream {
25 //------------------------------------------------------------------
26 // Constructors and Destructors
27 //------------------------------------------------------------------
30 StreamFile(uint32_t flags, uint32_t addr_size, lldb::ByteOrder byte_order);
32 StreamFile(int fd, bool transfer_ownership);
34 StreamFile(const char *path);
36 StreamFile(const char *path, uint32_t options,
37 uint32_t permissions = lldb::eFilePermissionsFileDefault);
39 StreamFile(FILE *fh, bool transfer_ownership);
41 ~StreamFile() override;
43 File &GetFile() { return m_file; }
45 const File &GetFile() const { return m_file; }
47 void Flush() override;
51 //------------------------------------------------------------------
52 // Classes that inherit from StreamFile can see and modify these
53 //------------------------------------------------------------------
55 size_t WriteImpl(const void *s, size_t length) override;
58 DISALLOW_COPY_AND_ASSIGN(StreamFile);
61 } // namespace lldb_private
63 #endif // liblldb_StreamFile_h_