X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ffiltered.h;h=0d323ecea69667e57c9c148a163837d7a2237149;hb=b97d4e9f86e90254ab9edef7ee62a910f6333c78;hp=e3ff219834aac6641260b58abb324353b0bd041a;hpb=528bc5708065a8c6d21c49fd64473570e974aee0;p=libs%2Fcore.git diff --git a/source/filtered.h b/source/filtered.h index e3ff219..0d323ec 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,7 +21,7 @@ private: public: Filtered(): filter(*this), active(false) { } - ~Filtered() { active=true; } + ~Filtered() { active = true; } template Filtered(A0 a0): B(a0), filter(*this), active(false) { } @@ -36,11 +29,6 @@ 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) { @@ -63,6 +51,13 @@ protected: else return B::do_read(b, s); } + +public: + 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; } }; } // namespace IO