]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Core/StreamFile.h
Upgrade to OpenSSH 7.2p2.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Core / StreamFile.h
1 //===-- StreamFile.h --------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef liblldb_StreamFile_h_
11 #define liblldb_StreamFile_h_
12
13 // C Includes
14 // C++ Includes
15
16 #include <string>
17
18 // Other libraries and framework includes
19 // Project includes
20
21 #include "lldb/Core/Stream.h"
22 #include "lldb/Host/File.h"
23
24 namespace lldb_private {
25
26 class StreamFile : public Stream
27 {
28 public:
29     //------------------------------------------------------------------
30     // Constructors and Destructors
31     //------------------------------------------------------------------
32     StreamFile ();
33
34     StreamFile (uint32_t flags, uint32_t addr_size, lldb::ByteOrder byte_order);
35
36     StreamFile (int fd, bool transfer_ownership);
37
38     StreamFile (const char *path);
39
40     StreamFile (const char *path,
41                 uint32_t options,
42                 uint32_t permissions = lldb::eFilePermissionsFileDefault);
43
44     StreamFile (FILE *fh, bool transfer_ownership);
45
46     ~StreamFile() override;
47
48     File &
49     GetFile ()
50     {
51         return m_file;
52     }
53
54     const File &
55     GetFile () const
56     {
57         return m_file;
58     }
59
60     void
61     Flush () override;
62
63     size_t
64     Write (const void *s, size_t length) override;
65
66 protected:
67     //------------------------------------------------------------------
68     // Classes that inherit from StreamFile can see and modify these
69     //------------------------------------------------------------------
70     File m_file;
71     
72 private:
73     DISALLOW_COPY_AND_ASSIGN (StreamFile);
74 };
75
76 } // namespace lldb_private
77
78 #endif // liblldb_StreamFile_h_