+ /// Disable the stream completely
+ void disable()
+ {
+ if (enabled_) {
+ realbuf_ = this->rdbuf();
+ rdbuf(nullstream.rdbuf());
+ enabled_ = false;
+ }
+ }
+ /// Enable the stream after a possible call of disable()
+ void enable()
+ {
+ if (!enabled_) {
+ this->rdbuf(realbuf_);
+ enabled_ = true;
+ }
+ }