]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Core/StreamString.h
Merge ^/head r293280 through r293429.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Core / StreamString.h
1 //===-- StreamString.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_StreamString_h_
11 #define liblldb_StreamString_h_
12
13 #include <string>
14
15 #include "lldb/Core/Stream.h"
16
17 namespace lldb_private {
18
19 class StreamString : public Stream
20 {
21 public:
22     StreamString ();
23
24     StreamString (uint32_t flags,
25                   uint32_t addr_size,
26                   lldb::ByteOrder byte_order);
27
28     ~StreamString () override;
29
30     void
31     Flush () override;
32
33     size_t
34     Write (const void *s, size_t length) override;
35
36     void
37     Clear();
38
39     bool
40     Empty() const;
41
42     const char *
43     GetData () const;
44
45     size_t
46     GetSize() const;
47
48     size_t
49     GetSizeOfLastLine () const;
50
51     std::string &
52     GetString();
53
54     const std::string &
55     GetString() const;
56
57     void
58     FillLastLineToColumn (uint32_t column, char fill_char);
59
60 protected:
61     std::string m_packet;
62 };
63
64 } // namespace lldb_private
65
66 #endif // liblldb_StreamString_h_