]> git.tdb.fi Git - libs/core.git/blobdiff - source/buffered.h
Move class members and comments around
[libs/core.git] / source / buffered.h
index b6584c1c23e289ce1d974cf02c0a247cf4f52f38..36d2a1165a3e52b7413397bf01575984efa3ac49 100644 (file)
@@ -1,9 +1,3 @@
-/* $Id$
-
-This file is part of libmspio
-Copyright © 2007 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
 #ifndef MSP_IO_BUFFERED_H_
 #define MSP_IO_BUFFERED_H_
 
@@ -14,27 +8,36 @@ namespace IO {
 
 class Buffered: public Base
 {
+private:
+       Base &below;
+       unsigned buf_size;
+       char *buf;
+       char *begin;
+       char *end;
+       Mode cur_op;
+
 public:
        Buffered(Base &, unsigned =8192);
-       unsigned put(char);
-       void flush();
-       bool getline(std::string &);
-       int  get();
-       int  tell() const;
-       Handle get_event_handle();
        ~Buffered();
-private:
-       Base     &below;
-       unsigned buf_size;
-       char     *in_buf;
-       char     *in_ptr;
-       unsigned in_avail;
-       char     *out_buf;
-       unsigned out_used;
 
-       void  below_closing();
+       void flush();
+
+protected:
        unsigned do_write(const char *, unsigned);
        unsigned do_read(char *, unsigned);
+public:
+       unsigned put(char);
+
+       bool getline(std::string &);
+       int get();
+
+private:
+       void set_op(Mode);
+public:
+       Mode get_current_op() const { return cur_op; }
+       unsigned get_current_size() const;
+
+       virtual Handle get_event_handle();
 };
 
 } // namespace IO