File indexing completed on 2026-05-10 08:42:58
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLDB_UTILITY_STREAMSTRING_H
0010 #define LLDB_UTILITY_STREAMSTRING_H
0011
0012 #include "lldb/Utility/Stream.h"
0013 #include "lldb/lldb-enumerations.h"
0014 #include "llvm/ADT/StringRef.h"
0015
0016 #include <string>
0017
0018 #include <cstddef>
0019 #include <cstdint>
0020
0021 namespace lldb_private {
0022
0023 class ScriptInterpreter;
0024
0025 class StreamString : public Stream {
0026 public:
0027 StreamString(bool colors = false);
0028
0029 StreamString(uint32_t flags, uint32_t addr_size, lldb::ByteOrder byte_order);
0030
0031 ~StreamString() override;
0032
0033 void Flush() override;
0034
0035 void Clear();
0036
0037 bool Empty() const;
0038
0039 size_t GetSize() const;
0040
0041 size_t GetSizeOfLastLine() const;
0042
0043 llvm::StringRef GetString() const;
0044
0045 const char *GetData() const { return m_packet.c_str(); }
0046
0047 void FillLastLineToColumn(uint32_t column, char fill_char);
0048
0049 protected:
0050 friend class ScriptInterpreter;
0051
0052 std::string m_packet;
0053 size_t WriteImpl(const void *s, size_t length) override;
0054 };
0055
0056 }
0057
0058 #endif