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);
74 va_start(args, format);
85 std::string local_data;
90 local_data = std::string(
99 llvm::Expected<FileUP> file =
103 "Cannot open {1}: {0}", path);
107 m_opaque_up = std::make_unique<StreamFile>(std::move(file.get()));
112 if (!local_data.empty())
113 m_opaque_up->Write(&local_data[0], local_data.size());
118 FileSP file = std::make_unique<NativeFile>(fh, transfer_fh_ownership);
130 if (!file_sp || !file_sp->IsValid())
133 std::string local_data;
138 local_data = std::string(
142 m_opaque_up = std::make_unique<StreamFile>(file_sp);
147 if (!local_data.empty())
148 m_opaque_up->Write(&local_data[0], local_data.size());
154 std::string local_data;
159 local_data = std::string(
163 m_opaque_up = std::make_unique<StreamFile>(fd, transfer_fh_ownership);
168 if (!local_data.empty())
169 m_opaque_up->Write(&local_data[0], local_data.size());
#define LLDB_INSTRUMENT_VA(...)
#define LLDB_LOG_ERROR(log, error,...)
void Printf(const char *format,...) __attribute__((format(printf
void 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()
int Open(const char *path, int flags, int mode)
Wraps ::open in a platform-independent way.
static FileSystem & Instance()
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.