9#ifndef LLDB_INTERPRETER_COMMANDRETURNOBJECT_H
10#define LLDB_INTERPRETER_COMMANDRETURNOBJECT_H
20#include "llvm/ADT/StringRef.h"
21#include "llvm/Support/Error.h"
22#include "llvm/Support/FormatVariadic.h"
23#include "llvm/Support/WithColor.h"
47 return std::static_pointer_cast<StreamString>(stream_sp)->GetString();
48 return llvm::StringRef();
63 stream_sp = std::make_shared<StreamString>();
73 stream_sp = std::make_shared<StreamString>();
118 __attribute__((format(printf, 2, 3)));
123 __attribute__((format(printf, 2, 3)));
128 __attribute__((format(printf, 2, 3)));
135 __attribute__((format(printf, 2, 3)));
137 template <typename...
Args>
139 AppendMessage(llvm::formatv(format, std::forward<Args>(args)...).str());
142 template <
typename...
Args>
144 AppendNote(llvm::formatv(format, std::forward<Args>(args)...).str());
147 template <
typename...
Args>
149 AppendWarning(llvm::formatv(format, std::forward<Args>(args)...).str());
152 template <
typename...
Args>
154 AppendError(llvm::formatv(format, std::forward<Args>(args)...).str());
static llvm::raw_ostream & error(Stream &strm)
A command line argument class.
void AppendMessage(llvm::StringRef in_string)
bool GetInteractive() const
void SetImmediateErrorStream(const lldb::StreamSP &stream_sp)
ValueObjectList m_value_objects
An optionally empty list of values produced by this command.
void SetImmediateErrorFile(lldb::FileSP file_sp)
void void AppendError(llvm::StringRef in_string)
std::string GetErrorString(bool with_diagnostics=true) const
Return the errors as a string.
bool m_suppress_immediate_output
llvm::StringRef GetOutputString() const
const ValueObjectList & GetValueObjectList() const
void void AppendNote(llvm::StringRef in_string)
ValueObjectList & GetValueObjectList()
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)
CommandReturnObject(bool colors)
void SetInteractive(bool b)
void AppendRawError(llvm::StringRef in_string)
void AppendWarningWithFormatv(const char *format, Args &&...args)
Stream & GetErrorStream()
void SetStatus(lldb::ReturnStatus status)
std::optional< uint16_t > m_diagnostic_indent
~CommandReturnObject()=default
void SetError(Status error)
std::optional< uint16_t > GetDiagnosticIndent() const
void SetImmediateOutputStream(const lldb::StreamSP &stream_sp)
void AppendErrorWithFormat(const char *format,...) __attribute__((format(printf
void AppendMessageWithFormat(const char *format,...) __attribute__((format(printf
void void AppendMessageWithFormatv(const char *format, Args &&...args)
void SetDiagnosticIndent(std::optional< uint16_t > indent)
void SetDidChangeProcessState(bool b)
lldb::ReturnStatus GetStatus() const
StructuredData::ObjectSP GetErrorData()
lldb::StreamSP GetImmediateErrorStream() const
void SetImmediateOutputFile(lldb::FileSP file_sp)
std::vector< DiagnosticDetail > m_diagnostics
lldb::ReturnStatus m_status
void SetCommand(std::string command)
lldb::StreamSP GetImmediateOutputStream() const
bool GetSuppressImmediateOutput() const
void void AppendWarning(llvm::StringRef in_string)
void AppendNoteWithFormat(const char *format,...) __attribute__((format(printf
const std::string & GetCommand() const
Get the command as the user typed it.
void AppendNoteWithFormatv(const char *format, Args &&...args)
std::string GetInlineDiagnosticString(unsigned indent) const
Format any inline diagnostics with an indentation of indent.
void AppendErrorWithFormatv(const char *format, Args &&...args)
Stream & GetOutputStream()
A stream class that can stream formatted output to a file.
std::shared_ptr< Object > ObjectSP
A collection of ValueObject values that.
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