17 template <
class Elem =
char,
class Tr = std::
char_traits<Elem>>
19 typedef void (*cb_func_ptr)(
const Elem*, std::streamsize
count,
void* data);
25 : stream_(stream), cb_func_(cb_func), data_(data) {
26 buf_ = stream_.rdbuf(
this);
31 std::streamsize
xsputn(
const Elem* ptr, std::streamsize
count) {
32 cb_func_(ptr,
count, data_);
36 typename Tr::int_type
overflow(
typename Tr::int_type v) {
37 Elem ch = Tr::to_char_type(v);
38 cb_func_(&ch, 1, data_);
39 return Tr::not_eof(v);
43 std::basic_ostream<Elem, Tr>& stream_;
51 LogWidget(QWidget* parent,
const int max_num_blocks = 100000);
54 void Append(
const std::string& text);
59 static void Update(
const char* text,
60 std::streamsize
count,
66 std::string text_queue_;
68 std::string cvlog_buffer_;
69 QPlainTextEdit* text_box_;
70 std::ofstream log_file_;
std::streamsize xsputn(const Elem *ptr, std::streamsize count)
StandardOutputRedirector(std::ostream &stream, cb_func_ptr cb_func, void *data)
~StandardOutputRedirector()
Tr::int_type overflow(typename Tr::int_type v)
Generic file read and write utility for python interface.