+ void GetFromBuffer(void *buffer, size_t size);
+ void PutToBuffer(const void *buffer, size_t size);
+
+ protected:
+ char *m_buffer_start, *m_buffer_end, *m_buffer_pos;
+ size_t m_buffer_size;
+
+ char *m_wback;
+ size_t m_wbacksize, m_wbackcur;
+
+ bool m_fixed, m_flushable;
+
+ wxStreamBase *m_stream;
+ BufMode m_mode;
+ bool m_destroybuf, m_destroystream;
+};
+
+// ---------------------------------------------------------------------------
+// wxBufferedStreams
+// ---------------------------------------------------------------------------
+
+class wxBufferedInputStream: public wxFilterInputStream {
+ public:
+ wxBufferedInputStream(wxInputStream& stream);
+ ~wxBufferedInputStream();
+
+ char Peek();
+ wxInputStream& Read(void *buffer, size_t size);
+
+ // Position functions
+ off_t SeekI(off_t pos, wxSeekMode mode = wxFromStart);
+ off_t TellI() const;
+
+ wxStreamBuffer *InputStreamBuffer() const { return m_i_streambuf; }
+
+ protected:
+ size_t OnSysRead(void *buffer, size_t bufsize);
+ off_t OnSysSeek(off_t seek, wxSeekMode mode);
+ off_t OnSysTell() const;
+
+ protected:
+ wxStreamBuffer *m_i_streambuf;
+};
+
+class wxBufferedOutputStream: public wxFilterOutputStream {
+ public:
+ wxBufferedOutputStream(wxOutputStream& stream);
+ ~wxBufferedOutputStream();
+
+ wxOutputStream& Write(const void *buffer, size_t size);
+
+ // Position functions
+ off_t SeekO(off_t pos, wxSeekMode mode = wxFromStart);
+ off_t TellO() const;
+
+ void Sync();
+
+ wxStreamBuffer *OutputStreamBuffer() const { return m_o_streambuf; }
+
+ protected:
+ size_t OnSysWrite(const void *buffer, size_t bufsize);
+ off_t OnSysSeek(off_t seek, wxSeekMode mode);
+ off_t OnSysTell() const;
+
+ protected:
+ wxStreamBuffer *m_o_streambuf;