+#include "wx/object.h"
+#include "wx/string.h"
+#include "wx/filefn.h" // for off_t, wxInvalidOffset and wxSeekMode
+
+class WXDLLEXPORT wxInputStream;
+class WXDLLEXPORT wxOutputStream;
+
+typedef wxInputStream& (*__wxInputManip)(wxInputStream&);
+typedef wxOutputStream& (*__wxOutputManip)(wxOutputStream&);
+
+wxOutputStream& WXDLLEXPORT wxEndL(wxOutputStream& o_stream);
+
+class WXDLLEXPORT wxStreamBuffer {
+ public:
+ wxStreamBuffer(wxInputStream& stream);
+ wxStreamBuffer(wxOutputStream& stream);
+ ~wxStreamBuffer();
+
+ void Read(void *buffer, size_t size);
+ void Write(const void *buffer, size_t size);
+ void WriteBack(char c);
+
+ void SetBufferIO(char *buffer_start, char *buffer_end);
+ void SetBufferIO(size_t bufsize);
+ void ResetBuffer();
+
+ void SetBufferPosition(char *buffer_position)
+ { m_buffer_pos = buffer_position; }
+ void SetIntPosition(size_t pos)
+ { m_buffer_pos = m_buffer_start + pos; }
+ char *GetBufferPosition() const { return m_buffer_pos; }
+ size_t GetIntPosition() const { return m_buffer_pos - m_buffer_start; }
+
+ char *GetBufferStart() const { return m_buffer_start; }
+ char *GetBufferEnd() const { return m_buffer_end; }
+ size_t GetBufferSize() const { return m_buffer_size; }
+ size_t GetLastAccess() const { return m_buffer_end - m_buffer_start; }
+
+ protected:
+ char *m_buffer_start, *m_buffer_end, *m_buffer_pos;
+ size_t m_buffer_size;
+
+ wxInputStream *m_istream;
+ wxOutputStream *m_ostream;
+};