]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/stream.h
added "access" parameter to wxFile::Create and Open. The default value is
[wxWidgets.git] / include / wx / stream.h
index 3fef67ff565de01c22c42067394e14ebacaba04d..c56b8c6171763966f0d444c18d1f4c048af15cc6 100644 (file)
 #endif
 
 #include <stdio.h>
-#include <wx/object.h>
-#include <wx/string.h>
+#include "wx/object.h"
+#include "wx/string.h"
+#include "wx/filefn.h"  // for off_t and wxSeekMode
 
 /*
  * wxStream: base classes
  */
-
-typedef enum {
-  wxFromStart, wxFromCurrent, wxFromEnd
-} wxSeekMode;
-
 class wxOutputStream;
-class wxInputStream: virtual public wxObject {
-  DECLARE_ABSTRACT_CLASS(wxInputStream)
+class wxInputStream {
  public:
   wxInputStream();
   virtual ~wxInputStream();
@@ -43,10 +38,11 @@ class wxInputStream: virtual public wxObject {
 
   virtual bool Eof() const = 0;
   virtual size_t LastRead() const = 0;
+
+  wxInputStream& operator>>(wxOutputStream& out) { return Read(out); }
 };
 
-class wxOutputStream: virtual public wxObject {
-  DECLARE_ABSTRACT_CLASS(wxOutputStream)
+class wxOutputStream {
  public:
   wxOutputStream();
   virtual ~wxOutputStream();
@@ -63,18 +59,11 @@ class wxOutputStream: virtual public wxObject {
   virtual void Sync() {}
 };
 
-class wxStream: virtual public wxInputStream, virtual public wxOutputStream {
- public:
-  wxStream() {}
-  virtual ~wxStream() { }
-};
-
 /*
  * "Filter" streams
  */
 
 class wxFilterInputStream: public wxInputStream {
-  DECLARE_CLASS(wxFilterInputStream)
  public:
   wxFilterInputStream(wxInputStream& stream);
   virtual ~wxFilterInputStream();
@@ -83,6 +72,8 @@ class wxFilterInputStream: public wxInputStream {
      { return m_parent_i_stream->Read(buffer, size); }
   virtual off_t SeekI(off_t pos, wxSeekMode mode = wxFromStart)
      { return m_parent_i_stream->SeekI(pos, mode); }
+  virtual off_t TellI() const
+     { return m_parent_i_stream->TellI(); }
 
   virtual bool Eof() const { return m_parent_i_stream->Eof(); } 
   virtual size_t LastRead() const { return m_parent_i_stream->LastRead(); } 
@@ -92,7 +83,6 @@ class wxFilterInputStream: public wxInputStream {
 };
 
 class wxFilterOutputStream: public wxOutputStream {
-  DECLARE_CLASS(wxFilterOutputStream)
  public:
   wxFilterOutputStream(wxOutputStream& stream);
   virtual ~wxFilterOutputStream();
@@ -101,6 +91,8 @@ class wxFilterOutputStream: public wxOutputStream {
      { return m_parent_o_stream->Write(buffer, size); }
   virtual off_t SeekO(off_t pos, wxSeekMode mode = wxFromStart)
      { return m_parent_o_stream->SeekO(pos, mode); }
+  virtual off_t TellO() const
+     { return m_parent_o_stream->TellO(); }
 
   virtual bool Bad() const { return m_parent_o_stream->Bad(); }
   virtual size_t LastWrite() const { return m_parent_o_stream->LastWrite(); }