X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e49f47aa77457548df1a86f74c285ea3226b3cce..f4a8c29f7a3ffa7eb60d9b7f055565eb2df368d9:/include/wx/mstream.h diff --git a/include/wx/mstream.h b/include/wx/mstream.h index b239c36e67..a07ce80ceb 100644 --- a/include/wx/mstream.h +++ b/include/wx/mstream.h @@ -8,8 +8,8 @@ // Copyright: (c) Guilhem Lavaux // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __WXMMSTREAM_H__ -#define __WXMMSTREAM_H__ +#ifndef _WX_WXMMSTREAM_H__ +#define _WX_WXMMSTREAM_H__ #include @@ -31,18 +31,17 @@ class wxMemoryInputStream: virtual public wxMemoryStreamBase, public wxInputStre public: wxMemoryInputStream(const char *data, size_t length); virtual ~wxMemoryInputStream(); - - wxInputStream& Read(void *buffer, size_t size); - off_t SeekI(off_t pos, wxSeekMode mode); - off_t TellI() const { return m_position_i; } - bool Eof() const { return m_eof; } - size_t LastRead() const { return m_lastread; } + char Peek(); + + protected: + + size_t DoRead(void *buffer, size_t size); + off_t DoSeekInput(off_t pos, wxSeekMode mode); + off_t DoTellInput() const { return m_position_i; } protected: - bool m_eof; off_t m_position_i; - size_t m_lastread; }; class wxMemoryOutputStream: virtual public wxMemoryStreamBase, public wxOutputStream { @@ -50,20 +49,17 @@ class wxMemoryOutputStream: virtual public wxMemoryStreamBase, public wxOutputSt wxMemoryOutputStream(char *data = NULL, size_t length = 0); virtual ~wxMemoryOutputStream(); - wxOutputStream& Write(const void *buffer, size_t size); - off_t SeekO(off_t pos, wxSeekMode mode); - off_t TellO() const { return m_position_o; } + char *GetData() { Sync(); return m_buffer; } + size_t GetLength() { Sync(); return m_length; } - bool Bad() const { return m_bad; } - size_t LastWrite() const { return m_lastwrite; } + protected: - char *GetData() { return m_buffer; } - size_t GetLength() { return m_length; } + size_t DoWrite(const void *buffer, size_t size); + off_t DoSeekOutput(off_t pos, wxSeekMode mode); + off_t DoTellOutput() const { return m_position_o; } protected: - bool m_bad; off_t m_position_o; - size_t m_lastwrite; }; class wxMemoryStream: public wxMemoryInputStream, public wxMemoryOutputStream {