X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Ffiltered.h;h=98cda4740a1700c3e41903156fce1de3c088f9b2;hp=057517547c5ea7aa9afdfd80a9f78ff2292bfa75;hb=49c1f3c3ffdf318579a809f3f800442c0c76c818;hpb=dd318ef67b0c683c8306da0abf806e99cff346e9 diff --git a/source/filtered.h b/source/filtered.h index 0575175..98cda47 100644 --- a/source/filtered.h +++ b/source/filtered.h @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of libmspio -Copyright © 2008 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef MSP_IO_FILTERED_H_ #define MSP_IO_FILTERED_H_ @@ -19,8 +12,8 @@ private: { Filtered &f; - Activator(Filtered &f_): f(f_) { f.active=true; } - ~Activator() { f.active=false; } + Activator(Filtered &f_): f(f_) { f.active = true; } + ~Activator() { f.active = false; } }; F filter; @@ -28,6 +21,7 @@ private: public: Filtered(): filter(*this), active(false) { } + ~Filtered() { active = true; } template Filtered(A0 a0): B(a0), filter(*this), active(false) { } @@ -35,6 +29,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)