]> git.tdb.fi Git - libs/core.git/blobdiff - source/filtered.h
Move class members and comments around
[libs/core.git] / source / filtered.h
index 057517547c5ea7aa9afdfd80a9f78ff2292bfa75..0d323ecea69667e57c9c148a163837d7a2237149 100644 (file)
@@ -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<typename A0>
        Filtered(A0 a0): B(a0), filter(*this), active(false) { }
@@ -35,7 +29,6 @@ public:
        template<typename A0, typename A1>
        Filtered(A0 a0, A1 a1): B(a0, a1), filter(*this), active(false) { }
 
-       F &get_filter() { return filter; }
 protected:
        virtual unsigned do_write(const char *b, unsigned s)
        {
@@ -58,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