X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fio%2Fbuffered.h;h=cd742fee291ea4614c6f0a1d8190bb1d67bbfa49;hp=bda2318ba5e7370205157f6242355c042f60c68d;hb=c8bf2d6c15893ccc9dbc4e04611b7229029f4808;hpb=e7790ec6cde4190fba02598933074cdaee070bfd diff --git a/source/io/buffered.h b/source/io/buffered.h index bda2318..cd742fe 100644 --- a/source/io/buffered.h +++ b/source/io/buffered.h @@ -11,7 +11,7 @@ class Buffered: public Base, public sigc::trackable { private: Base &below; - unsigned buf_size; + std::size_t buf_size; char *buf; char *begin; char *end; @@ -21,22 +21,27 @@ public: Buffered(Base &, unsigned =8192); ~Buffered(); + virtual void set_block(bool); + virtual void set_inherit(bool); + void flush(); protected: - unsigned do_write(const char *, unsigned); - unsigned do_read(char *, unsigned); + virtual std::size_t do_write(const char *, std::size_t); + virtual std::size_t do_read(char *, std::size_t); public: - unsigned put(char); + virtual std::size_t put(char); bool getline(std::string &); int get(); + virtual const Handle &get_handle(Mode); + private: void set_op(Mode); public: Mode get_current_op() const { return cur_op; } - unsigned get_current_size() const; + std::size_t get_current_size() const; }; } // namespace IO