X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/79c3e0e1aeebb64da2ac893e6ed7b27edca01a64..3bbb630a217d8212c63ac16d5338f692b70ab392:/include/wx/stream.h diff --git a/include/wx/stream.h b/include/wx/stream.h index 3fef67ff56..c56b8c6171 100644 --- a/include/wx/stream.h +++ b/include/wx/stream.h @@ -17,20 +17,15 @@ #endif #include -#include -#include +#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(); }