9#ifndef LLDB_API_SBCOMMANDRETURNOBJECT_H
10#define LLDB_API_SBCOMMANDRETURNOBJECT_H
19class CommandPluginInterfaceImplementation;
20class SBCommandReturnObjectImpl;
41 explicit operator bool()
const;
45 const char *GetOutput();
47 const char *GetError();
53 size_t PutOutput(FILE *fh);
56 size_t PutOutput(
SBFile file);
58 size_t PutOutput(
FileSP BORROWED);
60 size_t GetOutputSize();
62 size_t GetErrorSize();
67 size_t PutError(FILE *fh);
70 size_t PutError(
SBFile file);
72 size_t PutError(
FileSP BORROWED);
84 void AppendMessage(
const char *message);
86 void AppendWarning(
const char *message);
92 "Use SetImmediateOutputFile(SBFile) or SetImmediateOutputFile(FileSP)",
93 "SetImmediateOutputFile(SBFile)")
94 void SetImmediateOutputFile(FILE *fh);
97 "Use SetImmediateErrorFile(
SBFile) or SetImmediateErrorFile(
FileSP)",
98 "SetImmediateErrorFile(
SBFile)")
99 void SetImmediateErrorFile(FILE *fh);
102 "Use SetImmediateOutputFile(
SBFile) or SetImmediateOutputFile(
FileSP)",
103 "SetImmediateOutputFile(
SBFile)")
104 void SetImmediateOutputFile(FILE *fh,
bool transfer_ownership);
107 "Use SetImmediateErrorFile(
SBFile) or SetImmediateErrorFile(
FileSP)",
108 "SetImmediateErrorFile(
SBFile)")
109 void SetImmediateErrorFile(FILE *fh,
bool transfer_ownership);
112 void SetImmediateOutputFile(
SBFile file);
114 void SetImmediateErrorFile(
SBFile file);
116 void SetImmediateOutputFile(
FileSP BORROWED);
118 void SetImmediateErrorFile(
FileSP BORROWED);
120 void PutCString(
const char *
string,
int len = -1);
123 __attribute__((format(printf, 2, 3))) size_t Printf(const
char *format, ...);
126 const char *GetOutput(
bool only_if_no_immediate);
128 const char *GetError(
bool only_if_no_immediate);
131 const char *fallback_error_cstr =
nullptr);
133 void SetError(
const char *error_cstr);
137 friend class SBOptions;
140 friend class lldb_private::python::SWIGBridge;
153 std::unique_ptr<lldb_private::SBCommandReturnObjectImpl>
m_opaque_up;
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_DEPRECATED_FIXME(MSG, FIX)
LLDB_DEPRECATED_FIXME("Use PutOutput(SBFile) or PutOutput(FileSP)", "PutOutput(SBFile)") size_t PutOutput(FILE *fh)
LLDB_DEPRECATED_FIXME("Use SetImmediateOutputFile(SBFile) or SetImmediateOutputFile(FileSP)", "SetImmediateOutputFile(SBFile)") void SetImmediateOutputFile(FILE *fh)
LLDB_DEPRECATED_FIXME("Use PutError(SBFile) or PutError(FileSP)", "PutError(SBFile)") size_t PutError(FILE *fh)
std::unique_ptr< lldb_private::SBCommandReturnObjectImpl > m_opaque_up
__attribute__((format(printf, 2, 3))) size_t Printf(const char *format
A class that represents a running process on the host machine.
ReturnStatus
Command Return Status Types.
std::shared_ptr< lldb_private::File > FileSP