diff --git a/device/textstream.cc b/device/textstream.cc index a3e93a6..0f06aeb 100644 --- a/device/textstream.cc +++ b/device/textstream.cc @@ -14,4 +14,12 @@ TextStream::TextStream(unsigned from_col, {} -void TextStream::flush() {} +void TextStream::flush() { + for (unsigned i=0; i <= pos; i++) { + //print(buffer[i]); + } + pos = 0; + + + +} diff --git a/device/textstream.h b/device/textstream.h index f5fb1ff..83d6624 100644 --- a/device/textstream.h +++ b/device/textstream.h @@ -8,7 +8,8 @@ #pragma once #include "../types.h" - +#include "../object/outputstream.h" +#include "../arch/textwindow.h" /*! \brief Output text (form different data type sources) on screen in text * mode * \ingroup io @@ -19,7 +20,7 @@ * \ref TextWindow and only implements the method \ref TextStream::flush(). * Further formatting or special effects are implemented in \ref TextWindow. */ -class TextStream { +class TextStream: public OutputStream, protected TextWindow { // Prevent copies and assignments TextStream(const TextStream&) = delete; TextStream& operator=(const TextStream&) = delete; diff --git a/object/stringbuffer.h b/object/stringbuffer.h index 80bbf5f..8619a6e 100644 --- a/object/stringbuffer.h +++ b/object/stringbuffer.h @@ -43,7 +43,7 @@ class Stringbuffer { protected: /*! \brief Constructor; Marks the buffer as empty */ - Stringbuffer() {} + Stringbuffer() : pos(0){} /*! \brief Inserts a character into the buffer. * @@ -63,7 +63,9 @@ class Stringbuffer { * flush() is required to reset the position pos. */ virtual void flush() = 0; - + + unsigned pos; + char buffer[80+1]; public: /*! \brief Destructor (nothing to do here) */