X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fbuffered.h;fp=source%2Fbuffered.h;h=36d2a1165a3e52b7413397bf01575984efa3ac49;hp=9142a47e60f776e8f5a678bb2cb643b3101831d7;hb=b97d4e9f86e90254ab9edef7ee62a910f6333c78;hpb=49c1f3c3ffdf318579a809f3f800442c0c76c818 diff --git a/source/buffered.h b/source/buffered.h index 9142a47..36d2a11 100644 --- a/source/buffered.h +++ b/source/buffered.h @@ -9,29 +9,35 @@ namespace IO { class Buffered: public Base { private: - Base &below; + Base &below; unsigned buf_size; - char *buf; - char *begin; - char *end; - Mode cur_op; + char *buf; + char *begin; + char *end; + Mode cur_op; public: Buffered(Base &, unsigned =8192); ~Buffered(); - unsigned put(char); void flush(); - bool getline(std::string &); - int get(); - Handle get_event_handle(); - Mode get_current_op() const { return cur_op; } - unsigned get_current_size() const; -private: - void set_op(Mode); + protected: unsigned do_write(const char *, unsigned); unsigned do_read(char *, unsigned); +public: + unsigned put(char); + + bool getline(std::string &); + int get(); + +private: + void set_op(Mode); +public: + Mode get_current_op() const { return cur_op; } + unsigned get_current_size() const; + + virtual Handle get_event_handle(); }; } // namespace IO