X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fbuffered.h;h=36d2a1165a3e52b7413397bf01575984efa3ac49;hb=b97d4e9f86e90254ab9edef7ee62a910f6333c78;hp=8d52d1dc9983276d434dfa208037716bf08190c0;hpb=dd318ef67b0c683c8306da0abf806e99cff346e9;p=libs%2Fcore.git diff --git a/source/buffered.h b/source/buffered.h index 8d52d1d..36d2a11 100644 --- a/source/buffered.h +++ b/source/buffered.h @@ -1,9 +1,3 @@ -/* $Id$ - -This file is part of libmspio -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ #ifndef MSP_IO_BUFFERED_H_ #define MSP_IO_BUFFERED_H_ @@ -15,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