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_
18 // Other libraries and framework includes
21 #include "lldb/Core/Stream.h"
22 #include "lldb/Host/File.h"
24 namespace lldb_private {
26 class StreamFile : public Stream {
28 //------------------------------------------------------------------
29 // Constructors and Destructors
30 //------------------------------------------------------------------
33 StreamFile(uint32_t flags, uint32_t addr_size, lldb::ByteOrder byte_order);
35 StreamFile(int fd, bool transfer_ownership);
37 StreamFile(const char *path);
39 StreamFile(const char *path, uint32_t options,
40 uint32_t permissions = lldb::eFilePermissionsFileDefault);
42 StreamFile(FILE *fh, bool transfer_ownership);
44 ~StreamFile() override;
46 File &GetFile() { return m_file; }
48 const File &GetFile() const { return m_file; }
50 void Flush() override;
52 size_t Write(const void *s, size_t length) override;
55 //------------------------------------------------------------------
56 // Classes that inherit from StreamFile can see and modify these
57 //------------------------------------------------------------------
61 DISALLOW_COPY_AND_ASSIGN(StreamFile);
64 } // namespace lldb_private
66 #endif // liblldb_StreamFile_h_