From: Mikko Rasa Date: Sun, 17 Aug 2008 06:48:08 +0000 (+0000) Subject: Add put, getline and get to Filtered to make use of possible optimizations in the... X-Git-Tag: io-1.1~5 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=528bc5708065a8c6d21c49fd64473570e974aee0;p=libs%2Fcore.git Add put, getline and get to Filtered to make use of possible optimizations in the filter Set active in ~Filtered, since the filter may want to write something in its destructor --- diff --git a/source/filtered.h b/source/filtered.h index 0575175..e3ff219 100644 --- a/source/filtered.h +++ b/source/filtered.h @@ -28,6 +28,7 @@ private: public: Filtered(): filter(*this), active(false) { } + ~Filtered() { active=true; } template Filtered(A0 a0): B(a0), filter(*this), active(false) { } @@ -35,6 +36,10 @@ public: template Filtered(A0 a0, A1 a1): B(a0, a1), filter(*this), active(false) { } + virtual unsigned put(char c) { return filter.put(c); } + virtual bool getline(std::string &l) { return filter.getline(l); } + virtual int get() { return filter.get(); } + F &get_filter() { return filter; } protected: virtual unsigned do_write(const char *b, unsigned s)