]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/stream.h
Changes to allow OLE to compile under mingw32/gcc-2.95
[wxWidgets.git] / include / wx / stream.h
index 7e0045323c31fefdc93e81175751456ec8b0581a..d9fe1b89c00f6dc8ce8d41ce3c19351f6ab20bec 100644 (file)
@@ -38,10 +38,10 @@ WXDLLEXPORT wxOutputStream& wxEndL(wxOutputStream& o_stream);
 // wxStream: base classes
 // ---------------------------------------------------------------------------
 
-#define wxStream_NOERROR    wxSTR_NOERROR
-#define wxStream_EOF        wxSTR_EOF
-#define wxStream_WRITE_ERR  wxSTR_WRITE_ERROR
-#define wxStream_READ_ERR   wxSTR_READ_ERROR
+#define wxStream_NOERROR    wxSTREAM_NOERROR
+#define wxStream_EOF        wxSTREAM_EOF
+#define wxStream_WRITE_ERR  wxSTREAM_WRITE_ERROR
+#define wxStream_READ_ERR   wxSTREAM_READ_ERROR
   
 typedef enum {
   wxStream_NOERROR = 0,
@@ -55,8 +55,10 @@ class WXDLLEXPORT wxStreamBase {
   wxStreamBase();
   virtual ~wxStreamBase();
 
+  bool operator!() const { return (LastError() != wxSTREAM_NOERROR); }
   wxStreamError LastError() const { return m_lasterror; }
-  virtual size_t StreamSize() const { return ~((size_t)0); }
+  virtual size_t GetSize() const { return ~((size_t)0); }
+  size_t StreamSize() const { return GetSize(); }
 
  protected:
 
@@ -91,7 +93,7 @@ class WXDLLEXPORT wxInputStream: public wxStreamBase {
   virtual size_t LastRead() { return wxStreamBase::m_lastcount; }
 
   // Ungetch
-  size_t Ungetch(void *buffer, size_t size);
+  size_t Ungetch(const void *buffer, size_t size);
   bool Ungetch(char c);
 
   // Operators
@@ -147,7 +149,7 @@ class WXDLLEXPORT wxFilterInputStream: public wxInputStream {
   char Peek() { return m_parent_i_stream->Peek(); }
 
   wxStreamError LastError() const { return m_parent_i_stream->LastError(); }
-  size_t StreamSize() const { return m_parent_i_stream->StreamSize(); }
+  size_t GetSize() const { return m_parent_i_stream->GetSize(); }
 
  protected:
   wxInputStream *m_parent_i_stream;
@@ -160,7 +162,7 @@ class WXDLLEXPORT wxFilterOutputStream: public wxOutputStream {
   ~wxFilterOutputStream();
 
   wxStreamError LastError() const { return m_parent_o_stream->LastError(); }
-  size_t StreamSize() const { return m_parent_o_stream->StreamSize(); }
+  size_t GetSize() const { return m_parent_o_stream->GetSize(); }
 
  protected:
   wxOutputStream *m_parent_o_stream;