Stop channeling printbuffers to stdostream. Instead, provide an invocation CHANNEL_PRINTS.
This commit is contained in:
@@ -17,8 +17,7 @@ struct PrintBufferCore : public eng::opnew {
|
||||
// Line number of the first unchecked line in the buffer. All line
|
||||
// numbers including this one and beyond are unchecked.
|
||||
// "Unchecked" lines are lines in a non-authoritative model
|
||||
// that haven't been verified through difference transmission.
|
||||
|
||||
// that haven't been verified through difference transmission
|
||||
int first_unchecked_;
|
||||
|
||||
// Constructor.
|
||||
@@ -180,13 +179,15 @@ void PrintBuffer::patch(StreamBuffer *sb, DebugCollector *dbc) {
|
||||
}
|
||||
}
|
||||
|
||||
bool PrintChanneler::channel(const PrintBuffer *printbuffer, std::ostream &ostream) {
|
||||
bool PrintChanneler::channel(const PrintBuffer *printbuffer, StreamBuffer *sb) {
|
||||
if (printbuffer == nullptr) return false;
|
||||
if (printbuffer->first_line() > line_) {
|
||||
line_ = printbuffer->first_line();
|
||||
}
|
||||
while (line_ < printbuffer->first_unchecked()) {
|
||||
ostream << "|" << printbuffer->nth(line_) << std::endl;
|
||||
sb->write_bytes("|");
|
||||
sb->write_bytes(printbuffer->nth(line_));
|
||||
sb->write_bytes("\n");
|
||||
line_ += 1;
|
||||
}
|
||||
return line_ > printbuffer->first_line();
|
||||
|
||||
Reference in New Issue
Block a user