 |
Computer Assited Medical Intervention Tool Kit
version 4.1
|
Go to the documentation of this file.
26 #ifndef ConsoleStream_H
27 #define ConsoleStream_H
71 class ConsoleStream :
public std::basic_streambuf<char> {
75 init(stream, textEdit);
109 void init(std::ostream* stream, QTextEdit* textEdit) {
135 std::streamsize
xsputn(
const char* p, std::streamsize n) {
138 std::string::size_type pos = 0;
139 while (pos != std::string::npos) {
141 if (pos != std::string::npos) {
std::streambuf * previousBuffer
Definition: ConsoleStream.h:196
std::ostream * myStream
Definition: ConsoleStream.h:195
std::streamsize xsputn(const char *p, std::streamsize n)
rewriting of the inherited method xsputn
Definition: ConsoleStream.h:178
void setTextEdit(QTextEdit *text_edit)
set the log QTextEdit
Definition: ConsoleStream.h:147
std::string myString
Definition: ConsoleStream.h:197
void init(std::ostream *stream, QTextEdit *textEdit)
initialize ConsoleStream using both input stream and output text edit
Definition: ConsoleStream.h:152
void setStream(std::ostream *stream)
set the value for the buffer to be replaced by the ConsoleStream
Definition: ConsoleStream.h:139
ConsoleStream()
default constructor, init(..) have to be called later, before first use
Definition: ConsoleStream.h:122
~ConsoleStream()
destructor: use free() to restore previous stream output buffer
Definition: ConsoleStream.h:129
QTextEdit * logTextEdit
Definition: ConsoleStream.h:198
int_type overflow(int_type v)
rewriting of the inherited method overflow
Definition: ConsoleStream.h:165
void free()
reset the state as it was before (stream use the old buffer again)
Definition: ConsoleStream.h:158
Definition: Action.cpp:36