+
+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 std::size_t do_write(const char *, std::size_t);
+ virtual std::size_t do_read(char *, std::size_t);
+public:
+ virtual std::size_t 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; }
+};