28 : m_opaque_up(std::move(rhs.m_opaque_up)), m_is_file(rhs.m_is_file) {}
34 return this->
operator bool();
36SBStream::operator bool()
const {
39 return (m_opaque_up !=
nullptr);
71void SBStream::Printf(
const char *format, ...) {
75 va_start(args, format);
86 std::string local_data;
91 local_data = std::string(
100 llvm::Expected<FileUP> file =
104 "Cannot open {1}: {0}", path);
108 m_opaque_up = std::make_unique<StreamFile>(std::move(file.get()));
113 if (!local_data.empty())
114 m_opaque_up->Write(&local_data[0], local_data.size());
119 FileSP file = std::make_unique<NativeFile>(fh, transfer_fh_ownership);
131 if (!file_sp || !file_sp->IsValid())
134 std::string local_data;
139 local_data = std::string(
143 m_opaque_up = std::make_unique<StreamFile>(file_sp);
148 if (!local_data.empty())
149 m_opaque_up->Write(&local_data[0], local_data.size());
155 std::string local_data;
160 local_data = std::string(
164 m_opaque_up = std::make_unique<StreamFile>(fd, transfer_fh_ownership);
169 if (!local_data.empty())
170 m_opaque_up->Write(&local_data[0], local_data.size());
#define LLDB_INSTRUMENT_VA(...)
#define LLDB_LOG_ERROR(log, error,...)
void Print(const char *str)
void RedirectToFileDescriptor(int fd, bool transfer_fh_ownership)
void RedirectToFileHandle(FILE *fh, bool transfer_fh_ownership)
lldb_private::Stream & ref()
std::unique_ptr< lldb_private::Stream > m_opaque_up
void RedirectToFile(const char *path, bool append)
lldb_private::Stream * operator->()
lldb_private::Stream * get()
A uniqued constant string class.
const char * GetCString() const
Get the string value as a C string.
int Open(const char *path, int flags, int mode=0600)
Wraps ::open in a platform-independent way.
static FileSystem & Instance()
const char * GetData() const
llvm::StringRef GetString() const
A stream class that can stream formatted output to a file.
size_t size_t PrintfVarArg(const char *format, va_list args)
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
std::shared_ptr< lldb_private::File > FileSP