From 528bc5708065a8c6d21c49fd64473570e974aee0 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 17 Aug 2008 06:48:08 +0000 Subject: [PATCH] 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 --- source/filtered.h | 5 +++++ 1 file changed, 5 insertions(+) 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) -- 2.43.0