]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Core/StreamString.h
Merge llvm, clang, lld and lldb trunk r291274, and resolve conflicts.
[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 public:
21   StreamString();
22
23   StreamString(uint32_t flags, uint32_t addr_size, lldb::ByteOrder byte_order);
24
25   ~StreamString() override;
26
27   void Flush() override;
28
29   size_t Write(const void *s, size_t length) override;
30
31   void Clear();
32
33   bool Empty() const;
34
35   size_t GetSize() const;
36
37   size_t GetSizeOfLastLine() const;
38
39   llvm::StringRef GetString() const;
40
41   const char *GetData() const { return m_packet.c_str(); }
42
43   void FillLastLineToColumn(uint32_t column, char fill_char);
44
45 protected:
46   std::string m_packet;
47 };
48
49 } // namespace lldb_private
50
51 #endif // liblldb_StreamString_h_