9#ifndef LLDB_INTERPRETER_COMMANDRETURNOBJECT_H
10#define LLDB_INTERPRETER_COMMANDRETURNOBJECT_H
19#include "llvm/ADT/StringRef.h"
20#include "llvm/Support/Error.h"
21#include "llvm/Support/FormatVariadic.h"
22#include "llvm/Support/WithColor.h"
40 return std::static_pointer_cast<StreamString>(stream_sp)->GetString();
41 return llvm::StringRef();
56 stream_sp = std::make_shared<StreamString>();
66 stream_sp = std::make_shared<StreamString>();
111 __attribute__((format(printf, 2, 3)));
116 __attribute__((format(printf, 2, 3)));
121 __attribute__((format(printf, 2, 3)));
128 __attribute__((format(printf, 2, 3)));
130 template <typename...
Args>
132 AppendMessage(llvm::formatv(format, std::forward<Args>(args)...).str());
135 template <
typename...
Args>
137 AppendNote(llvm::formatv(format, std::forward<Args>(args)...).str());
140 template <
typename...
Args>
142 AppendWarning(llvm::formatv(format, std::forward<Args>(args)...).str());
145 template <
typename...
Args>
147 AppendError(llvm::formatv(format, std::forward<Args>(args)...).str());
static llvm::raw_ostream & error(Stream &strm)
A command line argument class.
void AppendErrorWithFormatv(const char *format, Args &&... args)
void AppendMessage(llvm::StringRef in_string)
bool GetInteractive() const
void SetImmediateErrorStream(const lldb::StreamSP &stream_sp)
void SetImmediateErrorFile(lldb::FileSP file_sp)
void void AppendError(llvm::StringRef in_string)
bool m_suppress_immediate_output
lldb::StreamSP GetImmediateOutputStream()
void void AppendNote(llvm::StringRef in_string)
bool m_did_change_process_state
void AppendWarningWithFormat(const char *format,...) __attribute__((format(printf
bool GetDidChangeProcessState() const
bool m_interactive
If true, then the input handle from the debugger will be hooked up.
void SetSuppressImmediateOutput(bool b)
void AppendWarningWithFormatv(const char *format, Args &&... args)
void SetInteractive(bool b)
void AppendRawError(llvm::StringRef in_string)
Stream & GetErrorStream()
void SetStatus(lldb::ReturnStatus status)
std::string GetErrorString(bool with_diagnostics=true)
Return the errors as a string.
void void AppendMessageWithFormatv(const char *format, Args &&... args)
std::optional< uint16_t > m_diagnostic_indent
~CommandReturnObject()=default
void SetError(Status error)
std::optional< uint16_t > GetDiagnosticIndent() const
std::string GetInlineDiagnosticString(unsigned indent)
Format any inline diagnostics with an indentation of indent.
void SetImmediateOutputStream(const lldb::StreamSP &stream_sp)
void AppendErrorWithFormat(const char *format,...) __attribute__((format(printf
void AppendMessageWithFormat(const char *format,...) __attribute__((format(printf
lldb::StreamSP GetImmediateErrorStream()
void SetDiagnosticIndent(std::optional< uint16_t > indent)
void SetDidChangeProcessState(bool b)
lldb::ReturnStatus GetStatus() const
StructuredData::ObjectSP GetErrorData()
void SetImmediateOutputFile(lldb::FileSP file_sp)
std::vector< DiagnosticDetail > m_diagnostics
lldb::ReturnStatus m_status
bool GetSuppressImmediateOutput() const
void void AppendWarning(llvm::StringRef in_string)
void AppendNoteWithFormat(const char *format,...) __attribute__((format(printf
void AppendNoteWithFormatv(const char *format, Args &&...args)
Stream & GetOutputStream()
llvm::StringRef GetOutputString()
void SetStreamAtIndex(uint32_t idx, const lldb::StreamSP &stream_sp)
lldb::StreamSP GetStreamAtIndex(uint32_t idx)
A stream class that can stream formatted output to a file.
std::shared_ptr< Object > ObjectSP
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::Stream > StreamSP
ReturnStatus
Command Return Status Types.
std::shared_ptr< lldb_private::File > FileSP