+
+class BufferedFile: public Seekable
+{
+private:
+ File file;
+ Buffered buffer;
+ SeekOffset position;
+
+public:
+ BufferedFile(const std::string &, Mode = M_READ, File::CreateMode = File::C_OVERWRITE);
+
+ virtual void set_block(bool);
+ virtual void set_inherit(bool);
+
+protected:
+ virtual unsigned do_write(const char *, unsigned);
+ virtual unsigned do_read(char *, unsigned);
+public:
+ virtual unsigned put(char);
+
+ virtual bool getline(std::string &);
+ virtual int get();
+
+ virtual const Handle &get_handle(Mode);
+
+ virtual SeekOffset seek(SeekOffset, SeekType);
+ virtual SeekOffset tell() const { return position; }
+};