xref: /NextBSD/contrib/llvm/tools/lldb/include/lldb/Core/StreamString.h (revision 287e3b14e9552995def1802ec9c5034f4adf28ec)
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     virtual
29     ~StreamString ();
30 
31     virtual void
32     Flush ();
33 
34     virtual size_t
35     Write (const void *s, size_t length);
36 
37     void
38     Clear();
39 
40     bool
41     Empty() const;
42 
43     const char *
44     GetData () const;
45 
46     size_t
47     GetSize() const;
48 
49     size_t
50     GetSizeOfLastLine () const;
51 
52     std::string &
53     GetString();
54 
55     const std::string &
56     GetString() const;
57 
58     void
59     FillLastLineToColumn (uint32_t column, char fill_char);
60 
61 protected:
62     std::string m_packet;
63 
64 };
65 
66 } // namespace lldb_private
67 #endif  // #ifndef liblldb_StreamString_h_
68